Now laoding card subtitle from env
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Nicolai Ort 2021-04-22 17:41:36 +02:00
parent 8f30d8933f
commit e97e209746
5 changed files with 6 additions and 5 deletions

View File

@ -166,7 +166,7 @@ export class PdfCreator {
await i18next.changeLanguage(locale);
const template_source = fs.readFileSync(`${this.templateDir}/runner_card.html`, 'utf8');
const template = Handlebars.compile(template_source);
let result = template({ cards, cards_swapped, eventname: config.eventname, codeformat: codeformat })
let result = template({ cards, cards_swapped, eventname: config.eventname, codeformat: codeformat, card_subtitle: config.card_subtitle })
result = await awaitAsyncHandlebarHelpers(result);
const pdf = await this.renderPdf(result, { format: "A4", landscape: false });
return pdf

View File

@ -15,6 +15,7 @@ export const config = {
disclaimer_text: process.env.DISCLAIMER_TEXT || "",
donations_footer_text: process.env.DONATIONS_FOOTER_TEXT || "",
contracts_per_runner: parseInt(process.env.CONTRACTS_PER_RUNNER) || 1,
card_subtitle: process.env.CARD_SUBTITLE || ""
}
let errors = 0
if (typeof config.internal_port !== "number") {

View File

@ -13,7 +13,7 @@
"id": "ID",
"lastname": "Nachname",
"location": "Ort",
"mit-unterstuetzung-von": "Mit Unterstützung von:",
"mit_unterstuetzung_von": "Mit Unterstützung von:",
"please_use_blockletters": "Bitte in DRUCKBUCHSTABEN schreiben",
"postalcode": "Postleitzahl",
"signature": "Unterschrift",

View File

@ -13,7 +13,7 @@
"id": "ID",
"lastname": "Last name",
"location": "Location",
"mit-unterstuetzung-von": "Supported by:",
"mit_unterstuetzung_von": "Supported by:",
"please_use_blockletters": "Please write in BLOCK LETTERS.",
"postalcode": "Postal code",
"signature": "Signature",

View File

@ -33,8 +33,8 @@
{{#each cards}}
<div class="column is-half runnercard">
<p class="title is-5" style="text-align: center; padding-bottom: 0; margin-top: -0.75rem;">{{../eventname}}</p>
<p style="text-align: center; margin-top: -1.5rem; font-size: small;">lauf-fuer-kaya.de - am 01.01.2021</p>
<p style="font-size: small;">Mit unterstützung von:</p>
<p style="text-align: center; margin-top: -1.5rem; font-size: small;">{{../card_subtitle}}</p>
<p style="font-size: small;">{{__ "mit_unterstuetzung_von"}}</p>
<div class="columns" style="height: 6rem; overflow: hidden;">
<div class="column is-half">
<!--SPONSOR LOGO HERE-->