[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
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
cat "$cachefile"
else
for file in "$_DATA/ical"/*.ics; do
- name="$(pdi_value "$(pdi_load "$file")" SUMMARY |HTML)"
- printf '%s %s\n' "$file" "$name"
+ name="$(pdi_value "$(pdi_load "$file")" SUMMARY || l10n "(unnamed course)" |unescape |HTML)"
+ printf '%s/%s\n' "${file##*/}" "$name"
done \
- | sort -k2 |tee "$cachefile"
+ | sort -t/ -k2 |tee "$cachefile"
fi
}
[a href="/categories/" $(l10n edit_categories)]
]
[fieldset .courses
- $(list_courses | while read course coursename; do
+ $(list_courses | while IFS=/ read course coursename; do
printf '[label [checkbox "filter_course%i" "|%s" %s] %s ] ' \
"$n" "$(HTML "${course##*/}")" \
"$(printf %s "${course##*/}" |grep -qxEe "$2" && printf checked )" \