X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=cards%2Flist.sh;h=5bfffbf8f840d4713b0b255bfd00828b2a180424;hp=cd0d21f1e320aa958839b8fdbe75dec051286da9;hb=f1346d6ad684e8e843afd51bfe38e474f7d48508;hpb=5b8d1b752ede7a6dc4250620ca58971447570a76 diff --git a/cards/list.sh b/cards/list.sh index cd0d21f..5bfffbf 100755 --- a/cards/list.sh +++ b/cards/list.sh @@ -35,13 +35,13 @@ edit_card(){ [div .section .note $(edit_item "$card" NOTE)] [div .section .attendance [h3 $(l10n course_attendance) ] $( - for course in "$_DATA"/ical/*.ics; do + list_courses |while IFS=/ read course coursename; do printf '[label [input type="checkbox" name="attendance" value="%s" %s] %s]' \ - "${course##*/}" \ - "$(grep -qF "${course##*/} ${cardfile##*/}" "$_DATA/mappings/attendance" \ + "$(HTML "$course")" \ + "$(grep -qF "${course} ${cardfile##*/}" "$_DATA/mappings/attendance" \ && printf 'checked="checked"' )" \ - "$(pdi_value "$(pdi_load "$course")" SUMMARY || l10n "(unnamed course)" |unescape |HTML)" + "$coursename" done) [h3 $(l10n CATEGORIES) ] $( grep -xE '[^ ]+' "$_DATA"/mappings/categories |while read -r cat; do @@ -95,12 +95,12 @@ print_card(){ printf '[li [a .item .attendance href="/courses#%s" . %s]]' \ "$each" \ "$(pdi_value "$(pdi_load "$_DATA/ical/$each")" SUMMARY || l10n "(unnamed course)" |unescape |HTML)" - done)] + 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="/cards/edit_card.sh?card=${cardfile##*/}" $(l10n edit)] + [a .button .item href="/cards/export_card.sh?card=${cardfile##*/}" $(l10n vcf_export)] ] ] EOF