From 561e7151c6a8b16738f698730b80b4b2a61a12fb Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Mon, 9 Dec 2024 16:44:46 +0100 Subject: [PATCH] feat(certificate): German template --- models/certificate.go | 8 ++- templates/certificate/de.html | 102 ++++++++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+), 2 deletions(-) create mode 100644 templates/certificate/de.html diff --git a/models/certificate.go b/models/certificate.go index 903bfdf..b17004e 100644 --- a/models/certificate.go +++ b/models/certificate.go @@ -13,6 +13,8 @@ type RunnerWithDonations struct { Group Group `json:"group"` Distance int `json:"distance"` DistanceDonations []DistanceDonation `json:"distance_donations"` + TotalPerDistance int `json:"total_per_distance"` + TotalDonations int `json:"total_donations"` } type DistanceDonation struct { @@ -31,6 +33,8 @@ type Donor struct { } type CertificateTemplateOptions struct { - Runners []RunnerWithDonations `json:"runners"` - EventName string `json:"event_name"` + Runners []RunnerWithDonations `json:"runners"` + EventName string `json:"event_name"` + Footer string `json:"footer"` + CurrencySymbol string `json:"currency_symbol"` } diff --git a/templates/certificate/de.html b/templates/certificate/de.html new file mode 100644 index 0000000..6a59f80 --- /dev/null +++ b/templates/certificate/de.html @@ -0,0 +1,102 @@ + + + + + Sponsoring contract + + + + + + {{ range .Runners }} +
+
+

Urkunde

+
+
+

{{ .FirstName }} + {{ .MiddleName }} {{ .LastName }} +

+

hat beim {{ $.EventName }}

+

{{unitFormat "kilometer" .Distance}}km

+

für den guten Zweck zurückgelegt

+
+
+ +
+
+
+
+

Sponsorings

+
+
+ + + + + + + + {{ range .DistanceDonations}} + + + + + + {{ end }} + + + + + + +
Sponsor:inBetrag/kmGesamtbetrag
{{ .Donor.FirstName }} {{ .Donor.MiddleName }} {{ .Donor.LastName }}{{ unitFormat "euro" .AmountPerDistance }} {{ $.CurrencySymbol }}{{ unitFormat "euro" .Amount }} {{ $.CurrencySymbol }}
Gesamt{{ unitFormat .TotalPerDistance }} {{ $.CurrencySymbol }}{{ unitFormat .TotalDonations }} {{ $.CurrencySymbol }}
+
+ +
+ {{ end }} + + + \ No newline at end of file