]> git.plutz.net Git - confetti/blob - courses/index.cgi
7ff426f2d2a80b2bbed50ca1e32ee1f895a542f8
[confetti] / courses / index.cgi
1 #!/bin/sh
2
3 . $_EXEC/pdiread.sh
4 . $_EXEC/courses/l10n.sh
5 . $_EXEC/courses/widgets.sh
6 . $_EXEC/courses/list.sh
7
8 upcase=' y;abcdefghijklmnopqrstuvwxyzäöüé;ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜÉ;; '
9
10 order="$(GET o |grep -m1 -xE 'DOW|TOD')"
11 edit="$(GET e |PATH)"
12
13 [ "$order" ] || order=DOW
14 edit="${edit##*/}"
15
16 { w_sort_courses
17   printf '
18   [form .newcourses action="/courses/new_course.sh" method="POST"
19     [button type="submit" %s]
20   ]' "$(l10n newcourse)"
21
22   [ "$edit" ] && edit_course "$edit"
23   printf '[div .courselist\n'
24     list_courses
25   printf ']'
26 } | yield_page courses #/courses/courses.css