From: Paul Hänsch Date: Thu, 18 Apr 2024 18:25:04 +0000 (+0200) Subject: auto complete in attendant fields X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=7658855512f84528af734a2a90f48cfed8d48d5c;p=confetti auto complete in attendant fields --- diff --git a/ledgers/index.cgi b/ledgers/index.cgi index 7cd3464..87af8b1 100755 --- a/ledgers/index.cgi +++ b/ledgers/index.cgi @@ -33,6 +33,12 @@ credit() { [input type=hidden name=session_id value="%s"] [h3 . %s] ' "${_BASE}" "$SESSION_ID" "$(l10n "IBAN Assignments")" + printf '[datalist id=lattendants .' + pdi_load "${_DATA}"/vcard/*.vcf |sed -n '/^FN\;:/!b; s;^FN\;:;;; p;' \ + | while read name; do + printf '[option value="%s"]' "$(HTML "$name")" + done + printf ']' { pdi_load "${_DATA}"/vcard/*.vcf cat "${_DATA}"/ledgers/????-??-??\ -\ ????-??-??\ -\ ????.tbl } | "${_EXEC}"/ledgers/iban_assign.awk \ @@ -52,7 +58,7 @@ credit() { printf '[h4 . %s]' "$(l10n Guesses)" for card in $cards; do uid="${card%%/*}" name="$(UNSTRING "${card#*/}")" - printf '[input .card key="cardfn" value="%s" placeholder="%s"]' "$(HTML "${name}")" "$(l10n attendent)" + printf '[input .card key="cardfn" value="%s" placeholder="%s" list=lattendants]' "$(HTML "${name}")" "$(l10n attendent)" done elif [ $state = unknown ]; then principal="${data#* * * }" principal="${principal%% *}"