From 4da0dade0e8331bf2c5e7813bd30bd8a7e7947a0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Thu, 5 Sep 2024 14:53:19 +0200 Subject: [PATCH] merge pdf export template from master --- courses/export_pdf.sh | 13 +++++++++---- l10n.sh | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/courses/export_pdf.sh b/courses/export_pdf.sh index 92e10c5..10230b8 100755 --- a/courses/export_pdf.sh +++ b/courses/export_pdf.sh @@ -90,9 +90,10 @@ style_td='style="border: 1pt solid; padding: 1mm 2mm; vertical-align: top;"' ] ][body lang="de_DE" [table width="100%" style="page-break-after: always;" - [col width=10*] [col width=5*] [col width=10*] [col width=15*] + [col width=2*] [col width=10*] [col width=5*] [col width=10*] [col width=15*] [thead - [tr [th $style_td . $(l10n N)] [th $style_td . $(l10n BDAY)] [th $style_td . $(l10n TEL)] [th $style_td . $(l10n NOTE)]] + [tr [th $style_td . $(l10n No.)] [th $style_td . $(l10n N)] [th $style_td . $(l10n BDAY)] + [th $style_td . $(l10n TEL)] [th $style_td . $(l10n NOTE)]] ][tbody $(grep -F "${coursefile##*/} " "$_DATA/mappings/attendance" |while read discard each; do vcf="$(pdi_load "$_DATA/vcard/$each")" @@ -101,12 +102,16 @@ style_td='style="border: 1pt solid; padding: 1mm 2mm; vertical-align: top;"' [ "$type" ] && type="$(l10n "TYPE=$type"):" printf '%s %s
' "$type" "$(pdi_value "$vcf" TEL $n)" done )" - printf '[tr valign=top [td %s .N . %s] [td %s .BDAY . %s] [td %s .TEL . %s] [td %s .NOTE . %s]]\n' \ + printf '[tr valign=top [td %s .No @@No@@] [td %s .N . %s] [td %s .BDAY . %s] [td %s .TEL . %s] [td %s .NOTE . %s]]\n' \ + "${style_td%\"} text-align: right;\"" \ "$style_td" "$(pdi_value "$vcf" FN |unescape |HTML)" \ "$style_td" "$(pdi_value "$vcf" BDAY |unescape |HTML)" \ "$style_td" "$tel" \ "$style_td" "$(pdi_value "$vcf" NOTE |unescape |HTML)" - done |sort)] + done |sort |while read -r line; do + attno=$((${attno-0} + 1)) + printf '%s%2i%s\n' "${line%%@@No@@*}" $attno "${line#*@@No@@}" + done)] ] [table width="100%" [col width=30*] [col width=10*] [col width=10*] [col width=10*] [col width=10*] [col width=10*] [col width=10*] [col width=10*] [col width=10*] [col width=10*] [col width=10*] diff --git a/l10n.sh b/l10n.sh index bddc7b7..5231fad 100755 --- a/l10n.sh +++ b/l10n.sh @@ -78,6 +78,7 @@ l10n_global() { sYEARLY) printf "Jährlich";; # UI labels + No.) printf %s "Nr.";; year) printf %s "Jahr";; month) printf %s "Monat";; day) printf %s "Tag";; -- 2.39.2