X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=cards%2Flist.sh;h=2f2e767a9dad082aed283da405e01c1eda6bf8fb;hp=9f1e1d8ec800eddbf05c952840769de4583c616e;hb=07454834f9d0291be5e652eef5f62c889331d695;hpb=0419aadded163a6d4e00b700cab7794e3bd81ee4 diff --git a/cards/list.sh b/cards/list.sh index 9f1e1d8..2f2e767 100755 --- a/cards/list.sh +++ b/cards/list.sh @@ -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 @@ -34,25 +34,27 @@ edit_card(){ [div .section .address $(edit_item "$card" ADR)] [div .section .note $(edit_item "$card" NOTE)] [div .section .attendance - [h3 $(l10n course_attendance) ] $( + [h3 $(l10n course_attendance) ] [div .attendance $( list_courses |while IFS=/ read course coursename; do - printf '[label [input type="checkbox" name="attendance" value="%s" %s] %s]' \ - "$(HTML "$course")" \ + courseH="$(HTML "$course")" + printf '[input type="checkbox" id="cour%s" name="attendance" value="%s" %s][label for="cour%s" . %s]' \ + "$courseH" "$courseH" \ "$(grep -qF "${course} ${cardfile##*/}" "$_DATA/mappings/attendance" \ && printf 'checked="checked"' )" \ - "$coursename" - done) - [h3 $(l10n CATEGORIES) ] $( + "$courseH" "$coursename" + done)] + [h3 $(l10n CATEGORIES) ] [div .categories $( grep -xE '[^ ]+' "$_DATA"/mappings/categories |while read -r cat; do - printf '[label [input type="checkbox" name="CATEGORIES" value="%s" %s] %s]' \ - "$(HTML "$cat")" \ + catH="$(HTML "$cat")" + printf '[input type="checkbox" id="cat%s" name="CATEGORIES" value="%s" %s][label for="cat%s" . %s]' \ + "$catH" "$catH" \ "$(seq 1 $(pdi_count "$card" CATEGORIES) |while read c; do pdi_value "$card" CATEGORIES $c |grep -qxF "$cat" \ && printf 'checked="checked"' && break done)" \ - "$(HTML "$cat")" - done) + "$catH" "$catH" + done)] ] [div .control [div .item .delete label="$(l10n edit_delete)" @@ -92,15 +94,15 @@ print_card(){ [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 .item href="/cards/edit_card.sh?card=${cardfile##*/}" $(l10n edit)] - [a .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