Compare commits

...

3 Commits

Author SHA1 Message Date
010f2046ad Added new config options to reamde
All checks were successful
continuous-integration/drone/push Build is passing
2021-04-22 17:54:43 +02:00
c18cb7f135 Merge branch 'dev' of git.odit.services:lfk/document-server into dev 2021-04-22 17:50:46 +02:00
ac9be793bd You can now configure the card's code format distinct from the others 2021-04-22 17:50:42 +02:00
3 changed files with 6 additions and 2 deletions

View File

@ -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.

View File

@ -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<Buffer> {
public async generateRunnerCards(cards: RunnerCard[], locale: string = "en", codeformat: string = config.codeformat_cards): Promise<Buffer> {
if (cards.length > 10) {
let pdf_promises = new Array<Promise<Buffer>>();
let i, j;

View File

@ -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 || "",