basic editing functions for new view
[confetti] / templates / attendees.html.sh
1 . ${_EXEC}/templates/text_attendee.sh
2 . ${_EXEC}/templates/view_attendee.sh
3 . ${_EXEC}/templates/edit_attendee.sh
4
5 check(){
6   [ "$_GET[\"filtertype\"]" = "$1" ] && echo 'checked="checked"'
7 }
8
9 cat <<EOF
10 <div class="filter">
11 <form action="/" method="GET">
12   <div class="search">
13     <span class="label">Filter:</span>
14     <input type="hidden" name="page" value="attendees"/>
15     <input type="text" name="filter" value="$_GET["filter"]"/><br/>
16     <input type="radio" name="filtertype" value="any" $(check any)>$(l10n filter_all)</input>
17     <input type="radio" name="filtertype" value="name" $(check name)>$(l10n filter_name)</input>
18     <input type="radio" name="filtertype" value="street" $(check street)>$(l10n filter_street)</input>
19     <input type="radio" name="filtertype" value="zip" $(check zip)>$(l10n filter_zip)</input>
20     <input type="radio" name="filtertype" value="telephone" $(check telephone)>$(l10n filter_phone)</input>
21     <input type="radio" name="filtertype" value="birth" $(check birth)>$(l10n filter_birthyear)</input>
22     <input type="radio" name="filtertype" value="course" $(check course)>$(l10n filter_course)</input><br/>
23     <button type="submit" name="action" value="new_filter">$(l10n filter_apply)</button>
24     <button type="submit" name="action" value="del_filter">$(l10n filter_cancel)</button>
25   </div>
26 </form>
27 </div>
28
29 <div class="newcard">
30 <h2>Neuer Eintrag</h2>
31 <form action="actions/newcard.cgi" method="POST">
32   <span class="label">Name:</span>
33   <input type="text" name="name"/>
34   <button type="submit">Anlegen</button>
35 </form>
36 </div>
37
38 <div class="cardlist">
39 $(listcards |while read card; do
40   id="$(basename "$card")"
41   if [ "$_GET[\"edit\"]" = "$id" ]; then cat <<x_EOF
42   <div id="${id}" class="card">
43     <form action="/?action=update_attendee" method="POST">
44       <input type="hidden" name="card" value="${id}"/>
45       $(edit_attendee "$id")
46     </form>
47   </div>
48 x_EOF
49   else cat <<x_EOF
50   <div id="${id}" class="card">
51     $(view_attendee "$id")
52   </div>
53 x_EOF
54   fi
55 done)
56 </div>
57
58 EOF
59
60 # vi:set filetype=html: