]> git.plutz.net Git - confetti/blobdiff - ledgers/index.cgi
simplified pipeline protocol
[confetti] / ledgers / index.cgi
index dbf8ee892a2b3c99454ce4a8632bf93feb131a17..f55850d0a3c794e22dcb250820c3f1dbe5da5804 100755 (executable)
@@ -41,6 +41,7 @@ credit() {
   printf ']'
   l10n_attendant="$(l10n attendant)"
   { pdi_load "${_DATA}"/vcard/*.vcf
+    printf 'BEGIN:LEDGERS\n'
     cat "${_DATA}"/ledgers/????-??-??\ -\ ????-??-??\ -\ ????.tbl
   } | "${_EXEC}"/ledgers/iban_assign.awk \
   | while read -r state iban data; do
@@ -61,21 +62,24 @@ credit() {
       amount="${record#*       *       *       *       *       }" amount="${amount%%   *}"
       printf '[p .principal . %s][p .date %s][p .amount %s][p .subject . %s]' \
              "$(UNSTRING "$principal" |HTML)" "$date" "$(credit "$amount")" "$(UNSTRING "$subject" |HTML)"
+      printf '[input type=checkbox id="use_%s" name="use_%s" value=true]' "$iban" "$iban"
       n=0; for card in $cards; do
         n=$((n+1)); uid="${card%%/*}" name="$(UNSTRING "${card#*/}")"
         cat <<-EOF
          [input type=checkbox id="check_${iban}_$n" name="check_${iban}_$n" value=true checked=checked]
-         [input .card name="fn_${iban}_$n" value="$(HTML "$name")" disabled=disabled]
+         [input .card name="fn_${iban}_$n" value="$(HTML "$name")" .disabled tabindex="-1"]
          [label .del for="check_${iban}_$n" . -]
        EOF
       done
       for m in 1 2 3 4 5 6 7 8; do
         cat <<-EOF
-         [input type=checkbox id="check_${iban}_$((n+m))" name="check_${iban}_$((n+m))" value=false]
+         [input type=checkbox id="check_${iban}_$((n+m))" name="check_${iban}_$((n+m))" value=true]
          [input .card name="fn_${iban}_$((n+m))" value="" placeholder="${l10n_attendant}" list="lattendants"]
          [label .add for="check_${iban}_$((n+m))" . +]
        EOF
       done
+      printf '[label for="use_%s" . %s]' "$iban" "$(l10n Accept Suggestions)"
+      printf '[label for="use_%s" . %s]' "$iban" "$(l10n Ignore Suggestions)"
     elif [ $state = unknown ]; then
       date="${data%%   *}"
       principal="${data#*      *       *       }" principal="${principal%%     *}"
@@ -94,5 +98,6 @@ credit() {
     fi
   printf ']'
   done
+  printf '[button type=submit . %s]' "$(l10n Submit Changes)"
   printf '  ]'
 } | yield_page ledgers