]> git.plutz.net Git - confetti/blobdiff - cards/list.sh
styling for iban assignment
[confetti] / cards / list.sh
index 0ed8af46297cc72abe6ae1202869e21db1501c3c..9511fc1d015001a1dbdb2cf9a92dde6e84ed8be1 100755 (executable)
@@ -13,7 +13,7 @@ edit_card(){
   else
     card="$(pdi_load "$tempfile")"
     cat <<-EOF
-       [form .card #${cardfile##*/} action="/cards/update_card.sh" method="POST"
+       [form .card #${cardfile##*/} action="${_BASE}/cards/update_card.sh" method="POST"
          [input type="hidden" name="tid" value="$(transid ${tempfile})"]
          [div .section .basic $(
            edit_item "$card" N GENDER
@@ -31,7 +31,10 @@ edit_card(){
            [ $(pdi_count "$card" IMPP) -gt 0 ] && edit_item "$card" IMPP
            [ $(pdi_count "$card" URL ) -gt 0 ] && edit_item "$card" URL
          )]
-         [div .section .address $(edit_item "$card" ADR)]
+         [div .section .address $(
+           edit_item "$card" ADR
+           [ $(pdi_count "$card" X-IBAN) -gt 0 ] && edit_item "$card" X-IBAN
+         )]
          [div .section .note    $(edit_item "$card" NOTE)]
          [div .section .attendance
            [h3 $(l10n course_attendance) ] [div .attendance $(
@@ -65,7 +68,7 @@ edit_card(){
             [div .item .newfield
               [select name="newfield"
                [option value="" disabled="disabled" selected="selected" $(l10n edit_addfieldtext)]
-               $(for f in NICKNAME EMAIL TEL IMPP ADR URL NOTE; do
+               $(for f in NICKNAME EMAIL TEL IMPP ADR URL NOTE X-ZACK-LEAVEDATE X-IBAN; do
                  printf '[option value="%s" %s] ' "$f" "$(l10n "$f")"
                done)
              ][button type="submit" name="action" value="addfield" $(l10n edit_addfield)]
@@ -90,19 +93,19 @@ print_card(){
       )]
       [div .section .phone   . $(card_item "$card" TEL)]
       [div .section .message . $(card_item "$card" EMAIL IMPP URL)]
-      [div .section .address . $(card_item "$card" ADR)]
+      [div .section .address . $(card_item "$card" ADR X-IBAN)]
       [div .section .note    . $(card_item "$card" NOTE)]
       [div .section .attendance [h3 $(l10n course_attendance) ] [ul
         $(grep -F "    ${cardfile##*/}" "$_DATA/mappings/attendance" |while read each discard; do
-          printf '[li [a .item .attendance href="/courses#%s" . %s]]' \
-                 "$each" \
+          printf '[li [a .item .attendance href="%s/courses#%s" . %s]]' \
+                 "${_BASE}" "$each" \
                  "$(pdi_value "$(pdi_load "$_DATA/ical/$each")" SUMMARY || l10n "(unnamed course)" |unescape |HTML)"
         done |sort -k7)]
         $(card_item "$card" CATEGORIES)
       ]
       [div .control
-        [a .button .item href="/cards/edit_card.sh?card=${cardfile##*/}" $(l10n edit)]
-        [a .button .item href="/cards/export_card.sh?card=${cardfile##*/}" $(l10n vcf_export)]
+        [a .button .item href="${_BASE}/cards/edit_card.sh?card=${cardfile##*/}" $(l10n edit)]
+        [a .button .item href="${_BASE}/cards/export_card.sh?card=${cardfile##*/}" $(l10n vcf_export)]
       ]
     ]
        EOF
@@ -113,11 +116,9 @@ print_cards(){
 
   while read cardfile; do
     cachefile="${_DATA}/cache/${cardfile##*/}.cache"
-    # if [ -s "$cachefile" -a "$cachefile" -nt "$cardfile" \
-    #                      -a "$cachefile" -nt "${_EXEC}/cards" ]; then
     if [ -s "$cachefile" -a "$cachefile" -nt "$cardfile" ]; then
       cat "$cachefile"
-    else
+    elif [ -s "$cardfile" ]; then
       print_card "$cardfile" |tee "$cachefile"
     fi
   done
@@ -150,6 +151,7 @@ filter_attendance(){
 
 filter_cards(){
   local filter f fex='x;p;'
+  local upcase=' y;abcdefghijklmnopqrstuvwxyzäöüé;ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜÉ;; '
 
   filter="$(printf %s "${filter}" \
             | sed -E 's;[]\/\(\)\\\$\?\.\+\*\;\[\{\}];\\&;g;