pdflatex based generator for course lists
[confetti] / templates / attendees.html.sh
1 check_type(){
2   [ "$_GET[\"filtertype\"]" = "$1" ] && echo 'checked="checked"'
3 }
4 check_order(){
5   [ "$_GET[\"order\"]" = "$1" ] && echo 'checked="checked"'
6 }
7
8 edit="$_GET[\"edit\"]"
9 [ -z "$_GET[\"filtertype\"]" ] && _GET["filtertype"]="any"
10 [ -z "$_GET[\"order\"]" ] && _GET["order"]="firstname"
11
12 cat <<EOF
13 <div class="filter">
14   <span class="label">$(l10n filter_label)</span>
15   <form class="search" action="/?action=filter_attendee" method="POST">
16     <input type="hidden" name="page" value="attendees"/>
17     <input type="text" name="filter" value="$_GET["filter"]" placeholder="$(l10n filter_placeholder)"/>
18     <br />
19     <span class="label">$(l10n filter_type):</span>
20     <input type="radio" name="filtertype" value="any" $(check_type any)>$(l10n filter_all)</input>
21     <input type="radio" name="filtertype" value="name" $(check_type name)>$(l10n filter_name)</input>
22     <input type="radio" name="filtertype" value="street" $(check_type street)>$(l10n filter_street)</input>
23     <input type="radio" name="filtertype" value="zip" $(check_type zip)>$(l10n filter_zip)</input>
24     <input type="radio" name="filtertype" value="telephone" $(check_type telephone)>$(l10n filter_phone)</input>
25     <input type="radio" name="filtertype" value="birth" $(check_type birth)>$(l10n filter_birthyear)</input>
26     <input type="radio" name="filtertype" value="course" $(check_type course)>$(l10n filter_course)</input>
27     <br />
28     <span class="label">$(l10n filter_order):</span>
29     <input type="radio" name="order" value="firstname" $(check_order firstname)>$(l10n filter_firstname)</input>
30     <input type="radio" name="order" value="lastname" $(check_order lastname)>$(l10n filter_lastname)</input>
31     <input type="radio" name="order" value="bdate" $(check_order bdate)>$(l10n filter_bdate)</input>
32     <br>
33     <button type="submit" name="choice" value="new_filter">$(l10n filter_apply)</button>
34     <button type="submit" name="choice" value="del_filter">$(l10n filter_cancel)</button>
35   </form>
36 </div>
37
38 <div class="newcard">
39 <form action="?action=new_attendee" method="POST">
40   <button type="submit">$(l10n newcard)</button>
41 </form>
42 </div>
43
44 <div class="cardlist">
45 $(
46 [ -f "vcard/$edit" -o -f "temp/$edit" ] &&  edit_attendee "$edit"
47 if [ "$?" = 0 ]; then
48   listcards |grep -v "$edit"
49 else
50   listcards
51 fi |while read card; do
52   view_attendee "$card"
53 done
54 )
55 </div>
56 EOF
57
58 # vi:set filetype=html: