diff --git a/.air.toml b/.air.toml index 1809a35..90e83bf 100644 --- a/.air.toml +++ b/.air.toml @@ -21,7 +21,7 @@ tmp_dir = "tmp" poll = false poll_interval = 0 post_cmd = [] - pre_cmd = ["swag init"] + pre_cmd = [] rerun = false rerun_delay = 500 send_interrupt = false diff --git a/templates/card/de.html b/templates/card/de.html new file mode 100644 index 0000000..051316b --- /dev/null +++ b/templates/card/de.html @@ -0,0 +1,71 @@ + + + + + Sponsoring contract + + + + + +
+
+ {{#each cards}} +
+

{{../eventname}}

+

{{../card_subtitle}}

+

Mit Unterstützung von:

+
+
+ + +
+
+ + +
+
+

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

+

{{this.runner.group.fullName}}

+
+ {{/each}} +
+
+
+
+ {{#each cards_swapped}} +
+ +
+ +
+ +
+ {{/each}} +
+
+ + + \ No newline at end of file diff --git a/templates/card/en.html b/templates/card/en.html new file mode 100644 index 0000000..25987ff --- /dev/null +++ b/templates/card/en.html @@ -0,0 +1,71 @@ + + + + + Sponsoring contract + + + + + +
+
+ {{#each cards}} +
+

{{../eventname}}

+

{{../card_subtitle}}

+

Supported by:

+
+
+ + +
+
+ + +
+
+

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

+

{{this.runner.group.fullName}}

+
+ {{/each}} +
+
+
+
+ {{#each cards_swapped}} +
+ +
+ +
+ +
+ {{/each}} +
+
+ + + \ No newline at end of file diff --git a/templates/contract/de.html b/templates/contract/de.html new file mode 100644 index 0000000..5d1dcaf --- /dev/null +++ b/templates/contract/de.html @@ -0,0 +1,120 @@ + + + + + Sponsoring contract + + + + + + {{#each runners}} +
+ +
+
+
+
+
+

Sponsoringerklärung

+
+
+

Bitte in DRUCKBUCHSTABEN schreiben +

+
+
+

ch bin/ Wir sind bereit anlässlich des {{eventname}}

+
+
+ {{this.firstname}} + {{this.middlename}} +

Vorname

+
+
+ {{this.id}} +

ID

+
+
+
+
+ +
+
+
+
+ {{this.lastname}} +

Nachname

+
+
+ {{this.group.fullName}} +

Team/ Klasse

+
+
+

mit einem Betrag von _____{{currency_symbol}} pro gelaufenem Kilometer zu unterstützen.

+
+
+ +

Nachname

+
+
+ +

Vorname

+
+
+

Adresse (Sponsor)

+

(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)

+
+
+ +

Straße

+
+
+ +

Hausnummer

+
+
+
+
+ +

Postleitzahl

+
+
+ +

Stadt

+
+
+
+
+ +

Ort, Datum

+
+
+ +

Unterschrift

+
+
+

{{../disclaimer}}

+
+
+ {{/each}} + + + \ No newline at end of file diff --git a/templates/contract/en.html b/templates/contract/en.html new file mode 100644 index 0000000..d7bd125 --- /dev/null +++ b/templates/contract/en.html @@ -0,0 +1,120 @@ + + + + + Sponsoring contract + + + + + + {{#each runners}} +
+ +
+
+
+
+
+

Sponsoring contract

+
+
+

Please write in BLOCK LETTERS. +

+
+
+

On the occasion of the {{eventname}} I/We want to support

+
+
+ {{this.firstname}} + {{this.middlename}} +

First name

+
+
+ {{this.id}} +

ID

+
+
+
+
+ +
+
+
+
+ {{this.lastname}} +

Last Name

+
+
+ {{this.group.fullName}} +

Team/class

+
+
+

with the amount of _____{{currency_symbol}} per kilometer run.

+
+
+ +

Last name

+
+
+ +

First name

+
+
+

Address (Sponsor)

+

(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}})

+
+
+ +

Street

+
+
+ +

House number

+
+
+
+
+ +

Postal code

+
+
+ +

City

+
+
+
+
+ +

Location, Date

+
+
+ +

Signature

+
+
+

{{../disclaimer}}

+
+
+ {{/each}} + + + \ No newline at end of file diff --git a/templates/templates.go b/templates/templates.go new file mode 100644 index 0000000..4246670 --- /dev/null +++ b/templates/templates.go @@ -0,0 +1,37 @@ +package templates + +import ( + _ "embed" +) + +//go:embed card/en.html +var CardTemplateEn string + +//go:embed card/de.html +var CardTemplateDe string + +//go:embed contract/en.html +var ContractTemplateEn string + +//go:embed contract/de.html +var ContractTemplateDe string + +func GetTemplate(locale, template string) string { + switch template { + case "card": + switch locale { + case "en": + return CardTemplateEn + case "de": + return CardTemplateDe + } + case "contract": + switch locale { + case "en": + return ContractTemplateEn + case "de": + return ContractTemplateDe + } + } + return "" +}