From a57e0909b919a1c720c9994b6baa8910b78dc569 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Wed, 31 Mar 2021 18:16:18 +0000 Subject: [PATCH 01/21] =?UTF-8?q?=F0=9F=A7=BENew=20changelog=20file=20vers?= =?UTF-8?q?ion=20[CI=20SKIP]=20[skip=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2156fdc..798af33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file. Dates are d #### [v0.5.0](https://git.odit.services/lfk/document-server/compare/v0.4.3...v0.5.0) +- Merge pull request 'Release 0.5.0' (#42) from dev into main [`a81db03`](https://git.odit.services/lfk/document-server/commit/a81db03ba3b274c44be4b4c0c318083bdeb07987) - Added translations [`ac572f1`](https://git.odit.services/lfk/document-server/commit/ac572f1ea31cb66985e04cb5d56cc67f521e990d) - Added translations [`7fea1ca`](https://git.odit.services/lfk/document-server/commit/7fea1ca78ff6fdbb38dee0edd9918eaeb1264d18) - Sorted translations 🌍 [`2278e4a`](https://git.odit.services/lfk/document-server/commit/2278e4ad06947b540323856ea1e71022562ea719) @@ -23,11 +24,12 @@ All notable changes to this project will be documented in this file. Dates are d - Added template strings [`2b21957`](https://git.odit.services/lfk/document-server/commit/2b2195727b15b8666edf0d925f2e68a98030153d) - Fixed background opacity [`2a4cfdb`](https://git.odit.services/lfk/document-server/commit/2a4cfdb2f88ad3ac1ebc925199a440756e9e9d3a) - Now with embedded background [`64fce5b`](https://git.odit.services/lfk/document-server/commit/64fce5bd019a00bf34c1ebd133c1904bb577b67b) -- Made footer text configureable [`63c7beb`](https://git.odit.services/lfk/document-server/commit/63c7beb8b9cdc564186c5b86a4f305c8575f5b9f) +- 🧾New changelog file version [CI SKIP] [skip ci] [`7ae4750`](https://git.odit.services/lfk/document-server/commit/7ae47503076f6721d1cfd82fbf8218b9febfa580) - 🚀Bumped version to v0.5.0 [`f623c0a`](https://git.odit.services/lfk/document-server/commit/f623c0a7cd06f707ac488456c9e8a051d3ceae46) - Merge pull request 'Generate runner certificates feature/36-runner_certificates' (#41) from feature/36-runner_certificates into dev [`d3f7d1a`](https://git.odit.services/lfk/document-server/commit/d3f7d1a6c9858d7fdf09c696622962e6f8471e78) - disabled testing for now [`cec8930`](https://git.odit.services/lfk/document-server/commit/cec893032dea9f312e37841232a9434e19b79003) - Added missing interpolations [`b43aeec`](https://git.odit.services/lfk/document-server/commit/b43aeec0cf40a9c37a10072062ab5d93102f6c81) +- Made footer text configureable [`63c7beb`](https://git.odit.services/lfk/document-server/commit/63c7beb8b9cdc564186c5b86a4f305c8575f5b9f) - 🧾New changelog file version [CI SKIP] [skip ci] [`f1084b5`](https://git.odit.services/lfk/document-server/commit/f1084b59a74dcc5981fd314721c36726706f386c) - disabled testing for now [`e75f151`](https://git.odit.services/lfk/document-server/commit/e75f15142e293349a071a7cdcc53cc10780304f6) - Removed temporary background-image fix [`5ba26c4`](https://git.odit.services/lfk/document-server/commit/5ba26c4cbfae7d3f31d3709aaeb372c14de78fa9) From 76418f65e1e111e83838f0d42c541ae6a8063a09 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Sun, 11 Apr 2021 19:49:05 +0200 Subject: [PATCH 02/21] =?UTF-8?q?Quick=20callstack=20fix=F0=9F=9B=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/PdfCreator.ts | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/PdfCreator.ts b/src/PdfCreator.ts index f929c83..d123721 100644 --- a/src/PdfCreator.ts +++ b/src/PdfCreator.ts @@ -122,11 +122,6 @@ export class PdfCreator { if (runners.length == 1 && Object.keys(runners[0]).length == 0) { runners[0] = this.generateEmptyRunner(); } - for (var i = 1; i < PdfCreator.contractsPerRunner; i++) { - runners = runners.reduce(function (res, current, index, array) { - return res.concat([current, current]); - }, []); - } if (runners.length > 50) { let pdf_promises = new Array>(); let i, j; @@ -137,6 +132,11 @@ export class PdfCreator { const pdfs = await Promise.all(pdf_promises); return await this.mergePdfs(pdfs); } + for (var i = 1; i < PdfCreator.contractsPerRunner; i++) { + runners = runners.reduce(function (res, current, index, array) { + return res.concat([current, current]); + }, []); + } await i18next.changeLanguage(locale); const template_source = fs.readFileSync(`${this.templateDir}/sponsoring_contract.html`, 'utf8'); const template = Handlebars.compile(template_source); @@ -179,14 +179,13 @@ export class PdfCreator { */ public async generateRunnerCertficates(runners: CertificateRunner[], locale: string = "en"): Promise { if (runners.length > 50) { - let pdf_promises = new Array>(); + let pdf_promises = new Array(); let i, j; for (i = 0, j = runners.length; i < j; i += 50) { let chunk = runners.slice(i, i + 50); - pdf_promises.push(this.generateRunnerCertficates(chunk, locale)); + pdf_promises.push(await this.generateRunnerCertficates(chunk, locale)); } - const pdfs = await Promise.all(pdf_promises); - return await this.mergePdfs(pdfs); + return await this.mergePdfs(pdf_promises); } await i18next.changeLanguage(locale); const template_source = fs.readFileSync(`${this.templateDir}/runner_certificate.html`, 'utf8'); From 2ee4c060557a44db1974a015412288f7942ebe72 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Sun, 11 Apr 2021 17:49:45 +0000 Subject: [PATCH 03/21] =?UTF-8?q?=F0=9F=A7=BENew=20changelog=20file=20vers?= =?UTF-8?q?ion=20[CI=20SKIP]=20[skip=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 798af33..5025297 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,15 @@ All notable changes to this project will be documented in this file. Dates are displayed in UTC. +#### [v0.5.0](https://git.odit.services/lfk/document-server/compare/v0.5.0...v0.5.0) + +- Quick callstack fix🛠 [`76418f6`](https://git.odit.services/lfk/document-server/commit/76418f65e1e111e83838f0d42c541ae6a8063a09) +- 🧾New changelog file version [CI SKIP] [skip ci] [`a57e090`](https://git.odit.services/lfk/document-server/commit/a57e0909b919a1c720c9994b6baa8910b78dc569) + #### [v0.5.0](https://git.odit.services/lfk/document-server/compare/v0.4.3...v0.5.0) +> 31 March 2021 + - Merge pull request 'Release 0.5.0' (#42) from dev into main [`a81db03`](https://git.odit.services/lfk/document-server/commit/a81db03ba3b274c44be4b4c0c318083bdeb07987) - Added translations [`ac572f1`](https://git.odit.services/lfk/document-server/commit/ac572f1ea31cb66985e04cb5d56cc67f521e990d) - Added translations [`7fea1ca`](https://git.odit.services/lfk/document-server/commit/7fea1ca78ff6fdbb38dee0edd9918eaeb1264d18) From d8f3a6ed063a9cdf6189e85ae01a5516b4295892 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Fri, 16 Apr 2021 21:09:03 +0200 Subject: [PATCH 04/21] =?UTF-8?q?Dependenc=20bump=20=F0=9F=94=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index a3bf208..23dbc73 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "handlebars": "4.7.7", "i18next": "20.1.0", "i18next-fs-backend": "1.1.1", - "mime-types": "2.1.29", + "mime-types": "2.1.30", "pdf-lib": "1.16.0", "puppeteer": "8.0.0", "reflect-metadata": "0.1.13", @@ -87,4 +87,4 @@ "publish": false } } -} +} \ No newline at end of file From 3c02e13997b1626fb0e6496da4c58eac2cc6fcf8 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Fri, 16 Apr 2021 19:10:33 +0000 Subject: [PATCH 05/21] =?UTF-8?q?=F0=9F=A7=BENew=20changelog=20file=20vers?= =?UTF-8?q?ion=20[CI=20SKIP]=20[skip=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5025297..079359d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ All notable changes to this project will be documented in this file. Dates are d #### [v0.5.0](https://git.odit.services/lfk/document-server/compare/v0.5.0...v0.5.0) - Quick callstack fix🛠 [`76418f6`](https://git.odit.services/lfk/document-server/commit/76418f65e1e111e83838f0d42c541ae6a8063a09) +- 🧾New changelog file version [CI SKIP] [skip ci] [`2ee4c06`](https://git.odit.services/lfk/document-server/commit/2ee4c060557a44db1974a015412288f7942ebe72) +- Dependenc bump 🔝 [`d8f3a6e`](https://git.odit.services/lfk/document-server/commit/d8f3a6ed063a9cdf6189e85ae01a5516b4295892) - 🧾New changelog file version [CI SKIP] [skip ci] [`a57e090`](https://git.odit.services/lfk/document-server/commit/a57e0909b919a1c720c9994b6baa8910b78dc569) #### [v0.5.0](https://git.odit.services/lfk/document-server/compare/v0.4.3...v0.5.0) From f78037c0f15162d5b98986edf20d263961f43e69 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 22 Apr 2021 17:32:36 +0200 Subject: [PATCH 06/21] =?UTF-8?q?Fixed=20barcode=20generation=20for=20rune?= =?UTF-8?q?nrcard=20pdfs=F0=9F=90=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/PdfCreator.ts | 2 +- src/controllers/PdfController.ts | 4 ++-- src/templates/runner_card.html | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/PdfCreator.ts b/src/PdfCreator.ts index d123721..15b534e 100644 --- a/src/PdfCreator.ts +++ b/src/PdfCreator.ts @@ -157,7 +157,7 @@ export class PdfCreator { let i, j; for (i = 0, j = cards.length; i < j; i += 10) { let chunk = cards.slice(i, i + 10); - pdf_promises.push(this.generateRunnerCards(chunk, locale)); + pdf_promises.push(this.generateRunnerCards(chunk, locale, codeformat)); } const pdfs = await Promise.all(pdf_promises); return await this.mergePdfs(pdfs); diff --git a/src/controllers/PdfController.ts b/src/controllers/PdfController.ts index 665f36f..a18bcf5 100644 --- a/src/controllers/PdfController.ts +++ b/src/controllers/PdfController.ts @@ -38,7 +38,7 @@ export class PdfController { @Post('/cards') @OpenAPI({ description: "Generate runner card pdfs from runner card objects.
You can choose your prefered locale by passing the 'locale' query-param." }) - async generateCards(@Body({ validate: true, options: { limit: "500mb" } }) cards: RunnerCard | RunnerCard[], @Res() res: any, @QueryParam("locale") locale: string, @QueryParam("download") download: boolean) { + async generateCards(@Body({ validate: true, options: { limit: "500mb" } }) cards: RunnerCard | RunnerCard[], @Res() res: any, @QueryParam("locale") locale: string, @QueryParam("codeformat") codeformat: string, @QueryParam("download") download: boolean) { if (!this.initialized) { await this.pdf.init(); this.initialized = true; @@ -47,7 +47,7 @@ export class PdfController { cards = [cards]; } cards = this.mapCardGroupNames(cards); - const contracts = await this.pdf.generateRunnerCards(cards, locale); + const contracts = await this.pdf.generateRunnerCards(cards, locale, codeformat); res.setHeader('content-type', 'application/pdf'); if (download) { res.setHeader('Content-Disposition', 'attachment; filename="cards.pdf"') diff --git a/src/templates/runner_card.html b/src/templates/runner_card.html index 76d1760..18586eb 100644 --- a/src/templates/runner_card.html +++ b/src/templates/runner_card.html @@ -36,15 +36,15 @@

lauf-fuer-kaya.de - am 01.01.2021

Mit unterstützung von:

-
+
-
+
+ src="{{--bc this.code ../codeformat}}" />

{{this.runner.lastname}}, {{this.runner.firstname}} {{this.runner.middlename}}

@@ -61,7 +61,7 @@
- +
{{/each}}
From 8f30d8933f105b4bf112c81222a72ca1931145d7 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 22 Apr 2021 17:35:02 +0200 Subject: [PATCH 07/21] Fixed typo in translation --- src/locales/de.json | 1 + src/locales/en.json | 1 + 2 files changed, 2 insertions(+) diff --git a/src/locales/de.json b/src/locales/de.json index abd0e37..e495d37 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -13,6 +13,7 @@ "id": "ID", "lastname": "Nachname", "location": "Ort", + "mit-unterstuetzung-von": "Mit Unterstützung von:", "please_use_blockletters": "Bitte in DRUCKBUCHSTABEN schreiben", "postalcode": "Postleitzahl", "signature": "Unterschrift", diff --git a/src/locales/en.json b/src/locales/en.json index b1b0691..9ca0404 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -13,6 +13,7 @@ "id": "ID", "lastname": "Last name", "location": "Location", + "mit-unterstuetzung-von": "Supported by:", "please_use_blockletters": "Please write in BLOCK LETTERS.", "postalcode": "Postal code", "signature": "Signature", From e97e2097463f4c88947e865a38ea1e5aa2be1f5d Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 22 Apr 2021 17:41:36 +0200 Subject: [PATCH 08/21] Now laoding card subtitle from env --- src/PdfCreator.ts | 2 +- src/config.ts | 1 + src/locales/de.json | 2 +- src/locales/en.json | 2 +- src/templates/runner_card.html | 4 ++-- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/PdfCreator.ts b/src/PdfCreator.ts index 15b534e..f45f62c 100644 --- a/src/PdfCreator.ts +++ b/src/PdfCreator.ts @@ -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 diff --git a/src/config.ts b/src/config.ts index aea575a..7717a30 100644 --- a/src/config.ts +++ b/src/config.ts @@ -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") { diff --git a/src/locales/de.json b/src/locales/de.json index e495d37..a2dcf3c 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -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", diff --git a/src/locales/en.json b/src/locales/en.json index 9ca0404..99fcc15 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -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", diff --git a/src/templates/runner_card.html b/src/templates/runner_card.html index 18586eb..b79ba50 100644 --- a/src/templates/runner_card.html +++ b/src/templates/runner_card.html @@ -33,8 +33,8 @@ {{#each cards}}

{{../eventname}}

-

lauf-fuer-kaya.de - am 01.01.2021

-

Mit unterstützung von:

+

{{../card_subtitle}}

+

{{__ "mit_unterstuetzung_von"}}

From cc4a2b4ab4c2cb9976797f93e8348607fb88ea7d Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 22 Apr 2021 15:44:08 +0000 Subject: [PATCH 09/21] =?UTF-8?q?=F0=9F=A7=BENew=20changelog=20file=20vers?= =?UTF-8?q?ion=20[CI=20SKIP]=20[skip=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 079359d..dce89a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,9 +5,13 @@ All notable changes to this project will be documented in this file. Dates are d #### [v0.5.0](https://git.odit.services/lfk/document-server/compare/v0.5.0...v0.5.0) - Quick callstack fix🛠 [`76418f6`](https://git.odit.services/lfk/document-server/commit/76418f65e1e111e83838f0d42c541ae6a8063a09) +- Fixed barcode generation for runenrcard pdfs🐞 [`f78037c`](https://git.odit.services/lfk/document-server/commit/f78037c0f15162d5b98986edf20d263961f43e69) +- Now laoding card subtitle from env [`e97e209`](https://git.odit.services/lfk/document-server/commit/e97e2097463f4c88947e865a38ea1e5aa2be1f5d) - 🧾New changelog file version [CI SKIP] [skip ci] [`2ee4c06`](https://git.odit.services/lfk/document-server/commit/2ee4c060557a44db1974a015412288f7942ebe72) - Dependenc bump 🔝 [`d8f3a6e`](https://git.odit.services/lfk/document-server/commit/d8f3a6ed063a9cdf6189e85ae01a5516b4295892) - 🧾New changelog file version [CI SKIP] [skip ci] [`a57e090`](https://git.odit.services/lfk/document-server/commit/a57e0909b919a1c720c9994b6baa8910b78dc569) +- Fixed typo in translation [`8f30d89`](https://git.odit.services/lfk/document-server/commit/8f30d8933f105b4bf112c81222a72ca1931145d7) +- 🧾New changelog file version [CI SKIP] [skip ci] [`3c02e13`](https://git.odit.services/lfk/document-server/commit/3c02e13997b1626fb0e6496da4c58eac2cc6fcf8) #### [v0.5.0](https://git.odit.services/lfk/document-server/compare/v0.4.3...v0.5.0) From fa26ed6012ded759d3702587dba67c2090324801 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Thu, 22 Apr 2021 17:47:19 +0200 Subject: [PATCH 10/21] typo fixes --- src/locales/en.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index 99fcc15..bd954ea 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -1,13 +1,13 @@ { "address": "Address", - "betrag-km": "Amount/KM", + "betrag-km": "Amount/ km", "city": "City", "date": "date", "firstname": "First name", - "fuer-den-guten-zweck-zurueckgelegt": "for our good cuse at the {{eventname}}", + "fuer-den-guten-zweck-zurueckgelegt": "for our good cause at the {{eventname}}", "gesamt": "Combined", "gesamtbetrag": "Total", - "group": "Team/class", + "group": "Team/ class", "hat-beim-eventname": "Ran", "house_number": "House number", "id": "ID", @@ -21,9 +21,9 @@ "sponsor-in": "Donor", "sponsoring_address_condition": "You have to provide an address if you want a donation receipt - Donation receipts can't be issued for total donation amounts under {{sponsoring_receipt_minimum_amount}}{{currency_symbol}}", "sponsoring_amount_per_distance": "with the amount of _____{{currency_symbol}} per kilometer run.", - "sponsoring_subtitle": "On the ocation of the {{eventname}} I/We want to support", + "sponsoring_subtitle": "On the occasion of the {{eventname}} I/We want to support", "sponsoring_title": "Sponsoring contract", "sponsorings": "Donations", "street": "Street", - "urkunde": "Certifcate" + "urkunde": "Certificate" } \ No newline at end of file From 754d0ca58ccf8f77570ff6218f2dec61cfb4f808 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Thu, 22 Apr 2021 15:47:59 +0000 Subject: [PATCH 11/21] =?UTF-8?q?=F0=9F=A7=BENew=20changelog=20file=20vers?= =?UTF-8?q?ion=20[CI=20SKIP]=20[skip=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dce89a4..f339089 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,9 @@ All notable changes to this project will be documented in this file. Dates are d - Quick callstack fix🛠 [`76418f6`](https://git.odit.services/lfk/document-server/commit/76418f65e1e111e83838f0d42c541ae6a8063a09) - Fixed barcode generation for runenrcard pdfs🐞 [`f78037c`](https://git.odit.services/lfk/document-server/commit/f78037c0f15162d5b98986edf20d263961f43e69) - Now laoding card subtitle from env [`e97e209`](https://git.odit.services/lfk/document-server/commit/e97e2097463f4c88947e865a38ea1e5aa2be1f5d) +- typo fixes [`fa26ed6`](https://git.odit.services/lfk/document-server/commit/fa26ed6012ded759d3702587dba67c2090324801) - 🧾New changelog file version [CI SKIP] [skip ci] [`2ee4c06`](https://git.odit.services/lfk/document-server/commit/2ee4c060557a44db1974a015412288f7942ebe72) +- 🧾New changelog file version [CI SKIP] [skip ci] [`cc4a2b4`](https://git.odit.services/lfk/document-server/commit/cc4a2b4ab4c2cb9976797f93e8348607fb88ea7d) - Dependenc bump 🔝 [`d8f3a6e`](https://git.odit.services/lfk/document-server/commit/d8f3a6ed063a9cdf6189e85ae01a5516b4295892) - 🧾New changelog file version [CI SKIP] [skip ci] [`a57e090`](https://git.odit.services/lfk/document-server/commit/a57e0909b919a1c720c9994b6baa8910b78dc569) - Fixed typo in translation [`8f30d89`](https://git.odit.services/lfk/document-server/commit/8f30d8933f105b4bf112c81222a72ca1931145d7) From 981bae4786a2fa12a1355122e8c5a1e95e29cf32 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Thu, 22 Apr 2021 17:49:31 +0200 Subject: [PATCH 12/21] more typo fixes --- src/locales/de.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/locales/de.json b/src/locales/de.json index a2dcf3c..6535de0 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -1,13 +1,13 @@ { "address": "Adresse", - "betrag-km": "Betrag/KM", + "betrag-km": "Betrag/ km", "city": "Stadt", "date": "Datum", "firstname": "Vorname", "fuer-den-guten-zweck-zurueckgelegt": "für den guten Zweck zurückgelegt", "gesamt": "Gesamt", "gesamtbetrag": "Gesamtbetrag", - "group": "Team/Klasse", + "group": "Team/ Klasse", "hat-beim-eventname": "Hat beim {{eventname}}", "house_number": "Hausnummer", "id": "ID", @@ -21,7 +21,7 @@ "sponsor-in": "Sponsor:in", "sponsoring_address_condition": "Muss ausgefüllt werden, wenn Sie eine Spendenquittung benötigen - Spendenquittungen können erst ab einem Gesamtbetrag von {{sponsoring_receipt_minimum_amount}}{{currency_symbol}} ausgestellt werden", "sponsoring_amount_per_distance": "mit einem Betrag von _____{{currency_symbol}} pro gelaufenem Kilometer zu unterstützen.", - "sponsoring_subtitle": "Ich/Wir sind bereit anlässlich des {{eventname}}", + "sponsoring_subtitle": "Ich bin/ Wir sind bereit anlässlich des {{eventname}}", "sponsoring_title": "Sponsoringerklärung", "sponsorings": "Sponsorings", "street": "Straße", From ac9be793bd598771174f5313ef8288240306ba5c Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 22 Apr 2021 17:50:42 +0200 Subject: [PATCH 13/21] You can now configure the card's code format distinct from the others --- src/PdfCreator.ts | 2 +- src/config.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/PdfCreator.ts b/src/PdfCreator.ts index f45f62c..e3446ce 100644 --- a/src/PdfCreator.ts +++ b/src/PdfCreator.ts @@ -151,7 +151,7 @@ export class PdfCreator { * @param cards The runner cars you want to generate the cards for. * @param locale The locale used for the cards (default:en) */ - public async generateRunnerCards(cards: RunnerCard[], locale: string = "en", codeformat: string = config.codeformat): Promise { + public async generateRunnerCards(cards: RunnerCard[], locale: string = "en", codeformat: string = config.codeformat_cards): Promise { if (cards.length > 10) { let pdf_promises = new Array>(); let i, j; diff --git a/src/config.ts b/src/config.ts index 7717a30..bff9c82 100644 --- a/src/config.ts +++ b/src/config.ts @@ -9,7 +9,8 @@ export const config = { eventname: process.env.EVENT_NAME || "Please set the event name", currency_symbol: process.env.CURRENCY_SYMBOL || "€", sponsoring_receipt_minimum_amount: process.env.SPONSORING_RECEIPT_MINIMUM_AMOUNT || "10", - codeformat: process.env.CODEFORMAT || "qrcode", + codeformat: process.env.CODEFORMAT || "code39", + codeformat_cards: process.env.CODEFORMAT_CARDS || process.env.CODEFORMAT || "code39", sponor_logos: getSponsorLogos(), api_key: getApiKey(), disclaimer_text: process.env.DISCLAIMER_TEXT || "", From 2e7c3e8a5b7f6a0461254b33c6f412929719c966 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Thu, 22 Apr 2021 15:50:43 +0000 Subject: [PATCH 14/21] =?UTF-8?q?=F0=9F=A7=BENew=20changelog=20file=20vers?= =?UTF-8?q?ion=20[CI=20SKIP]=20[skip=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f339089..dae50a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,9 +9,11 @@ All notable changes to this project will be documented in this file. Dates are d - Now laoding card subtitle from env [`e97e209`](https://git.odit.services/lfk/document-server/commit/e97e2097463f4c88947e865a38ea1e5aa2be1f5d) - typo fixes [`fa26ed6`](https://git.odit.services/lfk/document-server/commit/fa26ed6012ded759d3702587dba67c2090324801) - 🧾New changelog file version [CI SKIP] [skip ci] [`2ee4c06`](https://git.odit.services/lfk/document-server/commit/2ee4c060557a44db1974a015412288f7942ebe72) +- more typo fixes [`981bae4`](https://git.odit.services/lfk/document-server/commit/981bae4786a2fa12a1355122e8c5a1e95e29cf32) - 🧾New changelog file version [CI SKIP] [skip ci] [`cc4a2b4`](https://git.odit.services/lfk/document-server/commit/cc4a2b4ab4c2cb9976797f93e8348607fb88ea7d) - Dependenc bump 🔝 [`d8f3a6e`](https://git.odit.services/lfk/document-server/commit/d8f3a6ed063a9cdf6189e85ae01a5516b4295892) - 🧾New changelog file version [CI SKIP] [skip ci] [`a57e090`](https://git.odit.services/lfk/document-server/commit/a57e0909b919a1c720c9994b6baa8910b78dc569) +- 🧾New changelog file version [CI SKIP] [skip ci] [`754d0ca`](https://git.odit.services/lfk/document-server/commit/754d0ca58ccf8f77570ff6218f2dec61cfb4f808) - Fixed typo in translation [`8f30d89`](https://git.odit.services/lfk/document-server/commit/8f30d8933f105b4bf112c81222a72ca1931145d7) - 🧾New changelog file version [CI SKIP] [skip ci] [`3c02e13`](https://git.odit.services/lfk/document-server/commit/3c02e13997b1626fb0e6496da4c58eac2cc6fcf8) From 010f2046ad326898c75b6546e4d70a6f78346d8b Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 22 Apr 2021 17:54:43 +0200 Subject: [PATCH 15/21] Added new config options to reamde --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index dfc827b..2c36e57 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,9 @@ The basic generation mechanism makes the templates and routes interchangeable (i | DISCLAIMER_TEXT | String | N/A | A disclaimer that will get displayed on the bottom of each sponsoring contract. R/N You can only provide the disclaimer for one language. | DONATIONS_FOOTER_TEXT | String | N/A | A text that will get displayed on the bottom of each runner certificate's second page. R/N You can only provide the text for one language. | CONTRACTS_PER_RUNNER | Number | 1 | The amount of contracts that get created per runner (per request). +| CODEFORMAT | String | code39 | The barcode format for everything except. +| CODEFORMAT_CARDS | String | code39 | The barcode format for runnercards (overwrites CODEFORMAT). +| CARD_SUBTITLE | String | Empty | A subtitle that get's displayed on the cards under the eventname. ## Templates > The document server uses html templates to generate various pdf documents. From 60cc343adf71ed3b849d1d93af3d60cbc2820fed Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 22 Apr 2021 15:55:26 +0000 Subject: [PATCH 16/21] =?UTF-8?q?=F0=9F=A7=BENew=20changelog=20file=20vers?= =?UTF-8?q?ion=20[CI=20SKIP]=20[skip=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dae50a8..04a7471 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,9 +10,12 @@ All notable changes to this project will be documented in this file. Dates are d - typo fixes [`fa26ed6`](https://git.odit.services/lfk/document-server/commit/fa26ed6012ded759d3702587dba67c2090324801) - 🧾New changelog file version [CI SKIP] [skip ci] [`2ee4c06`](https://git.odit.services/lfk/document-server/commit/2ee4c060557a44db1974a015412288f7942ebe72) - more typo fixes [`981bae4`](https://git.odit.services/lfk/document-server/commit/981bae4786a2fa12a1355122e8c5a1e95e29cf32) +- You can now configure the card's code format distinct from the others [`ac9be79`](https://git.odit.services/lfk/document-server/commit/ac9be793bd598771174f5313ef8288240306ba5c) - 🧾New changelog file version [CI SKIP] [skip ci] [`cc4a2b4`](https://git.odit.services/lfk/document-server/commit/cc4a2b4ab4c2cb9976797f93e8348607fb88ea7d) - Dependenc bump 🔝 [`d8f3a6e`](https://git.odit.services/lfk/document-server/commit/d8f3a6ed063a9cdf6189e85ae01a5516b4295892) - 🧾New changelog file version [CI SKIP] [skip ci] [`a57e090`](https://git.odit.services/lfk/document-server/commit/a57e0909b919a1c720c9994b6baa8910b78dc569) +- Added new config options to reamde [`010f204`](https://git.odit.services/lfk/document-server/commit/010f2046ad326898c75b6546e4d70a6f78346d8b) +- 🧾New changelog file version [CI SKIP] [skip ci] [`2e7c3e8`](https://git.odit.services/lfk/document-server/commit/2e7c3e8a5b7f6a0461254b33c6f412929719c966) - 🧾New changelog file version [CI SKIP] [skip ci] [`754d0ca`](https://git.odit.services/lfk/document-server/commit/754d0ca58ccf8f77570ff6218f2dec61cfb4f808) - Fixed typo in translation [`8f30d89`](https://git.odit.services/lfk/document-server/commit/8f30d8933f105b4bf112c81222a72ca1931145d7) - 🧾New changelog file version [CI SKIP] [skip ci] [`3c02e13`](https://git.odit.services/lfk/document-server/commit/3c02e13997b1626fb0e6496da4c58eac2cc6fcf8) From b6fc069042dc9c5d7ec97f2660568e8e105780b9 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 22 Apr 2021 18:10:32 +0200 Subject: [PATCH 17/21] =?UTF-8?q?Emoji+Chinese=20fixes=F0=9F=8C=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b0c54e2..6ffe888 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,9 @@ RUN apk add --no-cache \ ca-certificates \ ttf-freefont \ nodejs \ - yarn + yarn \ + font-noto-emoji \ + && apk add wqy-zenhei --update-cache --repository https://nl.alpinelinux.org/alpine/edge/testing # Tell Puppeteer to skip installing Chrome. We'll be using the installed package. ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \ From a4c8dade23e448d4d4caefe304a6cd9195c873a4 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 22 Apr 2021 18:12:38 +0200 Subject: [PATCH 18/21] =?UTF-8?q?Updated=20docker-compose=20example?= =?UTF-8?q?=F0=9F=90=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index ff15c07..44ed35e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,9 +7,12 @@ services: environment: APP_PORT: 4010 NODE_ENV: production - EVENT_NAME: "Lauf für Kaya! 2021" + EVENT_NAME: "Testen für Kaya!" CURRENCY_SYMBOL: "€" - API_KEY: RYRccAJ4SKZnZaEci6Nyk9Z6mw3sD94fyKJ74WNzi6hLkxGNyJDrKPkxBmPwvR4f + API_KEY: NqZSYTy5AFQ7MppbLW5moqpTk7u7YrNUHKYhKYuThnnya2WpCOIU694hIZT1FzYe CONTRACTS_PER_RUNNER: 2 - SPONSORING_RECEIPT_MINIMUM_AMOUNT: 50 - DISCLAIMER_TEXT: "Rechtsgrundlage unserer Datenverarbeitung aufgrund freiwilliger Einwilligung ist Art. 6 Abs. 1 e), Abs. 3 DSGVO i.V.m. Art. 85 BayEUG. Mit Ihrer Unterschrift willigen Sie in unsere Datennutzung zum Zwecke des Lauf für Kaya! ein. Die Daten für Spendenquittungen" \ No newline at end of file + SPONSORING_RECEIPT_MINIMUM_AMOUNT: 42 + DISCLAIMER_TEXT: "Hier könnte ihre Werbung stehen" + CODEFORMAT: "code39" + CODEFORMAT_CARDS: "ean13" + CARD_SUBTITLE: "Hier könnte mehr Werbung stehen" \ No newline at end of file From ded610f11464a27429b8184a32554e99aed63f72 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 22 Apr 2021 16:13:22 +0000 Subject: [PATCH 19/21] =?UTF-8?q?=F0=9F=A7=BENew=20changelog=20file=20vers?= =?UTF-8?q?ion=20[CI=20SKIP]=20[skip=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 04a7471..0e819c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,14 +6,17 @@ All notable changes to this project will be documented in this file. Dates are d - Quick callstack fix🛠 [`76418f6`](https://git.odit.services/lfk/document-server/commit/76418f65e1e111e83838f0d42c541ae6a8063a09) - Fixed barcode generation for runenrcard pdfs🐞 [`f78037c`](https://git.odit.services/lfk/document-server/commit/f78037c0f15162d5b98986edf20d263961f43e69) +- Updated docker-compose example🐳 [`a4c8dad`](https://git.odit.services/lfk/document-server/commit/a4c8dade23e448d4d4caefe304a6cd9195c873a4) - Now laoding card subtitle from env [`e97e209`](https://git.odit.services/lfk/document-server/commit/e97e2097463f4c88947e865a38ea1e5aa2be1f5d) - typo fixes [`fa26ed6`](https://git.odit.services/lfk/document-server/commit/fa26ed6012ded759d3702587dba67c2090324801) - 🧾New changelog file version [CI SKIP] [skip ci] [`2ee4c06`](https://git.odit.services/lfk/document-server/commit/2ee4c060557a44db1974a015412288f7942ebe72) - more typo fixes [`981bae4`](https://git.odit.services/lfk/document-server/commit/981bae4786a2fa12a1355122e8c5a1e95e29cf32) - You can now configure the card's code format distinct from the others [`ac9be79`](https://git.odit.services/lfk/document-server/commit/ac9be793bd598771174f5313ef8288240306ba5c) +- Emoji+Chinese fixes🌍 [`b6fc069`](https://git.odit.services/lfk/document-server/commit/b6fc069042dc9c5d7ec97f2660568e8e105780b9) - 🧾New changelog file version [CI SKIP] [skip ci] [`cc4a2b4`](https://git.odit.services/lfk/document-server/commit/cc4a2b4ab4c2cb9976797f93e8348607fb88ea7d) - Dependenc bump 🔝 [`d8f3a6e`](https://git.odit.services/lfk/document-server/commit/d8f3a6ed063a9cdf6189e85ae01a5516b4295892) - 🧾New changelog file version [CI SKIP] [skip ci] [`a57e090`](https://git.odit.services/lfk/document-server/commit/a57e0909b919a1c720c9994b6baa8910b78dc569) +- 🧾New changelog file version [CI SKIP] [skip ci] [`60cc343`](https://git.odit.services/lfk/document-server/commit/60cc343adf71ed3b849d1d93af3d60cbc2820fed) - Added new config options to reamde [`010f204`](https://git.odit.services/lfk/document-server/commit/010f2046ad326898c75b6546e4d70a6f78346d8b) - 🧾New changelog file version [CI SKIP] [skip ci] [`2e7c3e8`](https://git.odit.services/lfk/document-server/commit/2e7c3e8a5b7f6a0461254b33c6f412929719c966) - 🧾New changelog file version [CI SKIP] [skip ci] [`754d0ca`](https://git.odit.services/lfk/document-server/commit/754d0ca58ccf8f77570ff6218f2dec61cfb4f808) From 22fb3edd7836ba4ca35e6b208ab6f6620da60f4a Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 22 Apr 2021 18:13:50 +0200 Subject: [PATCH 20/21] =?UTF-8?q?=F0=9F=9A=80Bumped=20version=20to=20v0.5.?= =?UTF-8?q?1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 23dbc73..eba1026 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@odit/lfk-document-server", - "version": "0.5.0", + "version": "0.5.1", "description": "The document generation server for the LfK! runner system. This generates certificates, sponsoring aggreements and more", "main": "src/app.ts", "scripts": { @@ -87,4 +87,4 @@ "publish": false } } -} \ No newline at end of file +} From 0f2d6f58d6a8a8888263778cf1a14c73b28e774e Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Thu, 22 Apr 2021 16:14:54 +0000 Subject: [PATCH 21/21] =?UTF-8?q?=F0=9F=A7=BENew=20changelog=20file=20vers?= =?UTF-8?q?ion=20[CI=20SKIP]=20[skip=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e819c3..d81afdc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file. Dates are displayed in UTC. -#### [v0.5.0](https://git.odit.services/lfk/document-server/compare/v0.5.0...v0.5.0) +#### [v0.5.1](https://git.odit.services/lfk/document-server/compare/v0.5.0...v0.5.1) - Quick callstack fix🛠 [`76418f6`](https://git.odit.services/lfk/document-server/commit/76418f65e1e111e83838f0d42c541ae6a8063a09) - Fixed barcode generation for runenrcard pdfs🐞 [`f78037c`](https://git.odit.services/lfk/document-server/commit/f78037c0f15162d5b98986edf20d263961f43e69) @@ -12,10 +12,12 @@ All notable changes to this project will be documented in this file. Dates are d - 🧾New changelog file version [CI SKIP] [skip ci] [`2ee4c06`](https://git.odit.services/lfk/document-server/commit/2ee4c060557a44db1974a015412288f7942ebe72) - more typo fixes [`981bae4`](https://git.odit.services/lfk/document-server/commit/981bae4786a2fa12a1355122e8c5a1e95e29cf32) - You can now configure the card's code format distinct from the others [`ac9be79`](https://git.odit.services/lfk/document-server/commit/ac9be793bd598771174f5313ef8288240306ba5c) +- 🚀Bumped version to v0.5.1 [`22fb3ed`](https://git.odit.services/lfk/document-server/commit/22fb3edd7836ba4ca35e6b208ab6f6620da60f4a) - Emoji+Chinese fixes🌍 [`b6fc069`](https://git.odit.services/lfk/document-server/commit/b6fc069042dc9c5d7ec97f2660568e8e105780b9) - 🧾New changelog file version [CI SKIP] [skip ci] [`cc4a2b4`](https://git.odit.services/lfk/document-server/commit/cc4a2b4ab4c2cb9976797f93e8348607fb88ea7d) - Dependenc bump 🔝 [`d8f3a6e`](https://git.odit.services/lfk/document-server/commit/d8f3a6ed063a9cdf6189e85ae01a5516b4295892) - 🧾New changelog file version [CI SKIP] [skip ci] [`a57e090`](https://git.odit.services/lfk/document-server/commit/a57e0909b919a1c720c9994b6baa8910b78dc569) +- 🧾New changelog file version [CI SKIP] [skip ci] [`ded610f`](https://git.odit.services/lfk/document-server/commit/ded610f11464a27429b8184a32554e99aed63f72) - 🧾New changelog file version [CI SKIP] [skip ci] [`60cc343`](https://git.odit.services/lfk/document-server/commit/60cc343adf71ed3b849d1d93af3d60cbc2820fed) - Added new config options to reamde [`010f204`](https://git.odit.services/lfk/document-server/commit/010f2046ad326898c75b6546e4d70a6f78346d8b) - 🧾New changelog file version [CI SKIP] [skip ci] [`2e7c3e8`](https://git.odit.services/lfk/document-server/commit/2e7c3e8a5b7f6a0461254b33c6f412929719c966)