diff --git a/server/AyaNova/resource/rpt/ay-report.js b/server/AyaNova/resource/rpt/ay-report.js index b0c710ca..54dfef9e 100644 --- a/server/AyaNova/resource/rpt/ay-report.js +++ b/server/AyaNova/resource/rpt/ay-report.js @@ -9,8 +9,6 @@ async function ayPreRender(ayAllData) { } } - - /////////////////////////////////////// // Set our stock handlebars helpers // @@ -55,6 +53,25 @@ function ayRegisterHelpers() { }); Handlebars.registerHelper("ayLogo", function (size) { + if (this.ayServerMetaData) { + switch (size) { + case "small": + if (!this.ayServerMetaData.HasSmallLogo) { + return ""; + } + break; + case "medium": + if (!this.ayServerMetaData.HasMediumLogo) { + return ""; + } + break; + case "large": + if (!this.ayServerMetaData.HasLargeLogo) { + return ""; + } + break; + } + } var url = `${Handlebars.escapeExpression( this.ayServerMetaData.ayApiUrl )}logo/${size}`; @@ -63,7 +80,11 @@ function ayRegisterHelpers() { Handlebars.registerHelper("ayT", function (translationKey) { if (ayTranslationKeyCache[translationKey] == undefined) { - throw `ayT reporting helper error: the key "${translationKey}" is not present in the translation cache, did you forget to include it in your call to "await ayGetTranslations([KeyList]);" in ayPrepareData()\nTranslationKeyCache contains: ${JSON.stringify(ayTranslationKeyCache, null, 3)}?`; + throw `ayT reporting helper error: the key "${translationKey}" is not present in the translation cache, did you forget to include it in your call to "await ayGetTranslations([KeyList]);" in ayPrepareData()\nTranslationKeyCache contains: ${JSON.stringify( + ayTranslationKeyCache, + null, + 3 + )}?`; // return translationKey; } return ayTranslationKeyCache[translationKey];