]> git.plutz.net Git - confetti/blob - templates/attendees.html.sh
Added AGPL License notice to every file
[confetti] / templates / attendees.html.sh
1 # Copyright 2014 Paul Hänsch
2 #
3 # This file is part of Confetti.
4
5 # Confetti is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Affero General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
9
10 # Confetti is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU Affero General Public License for more details.
14
15 # You should have received a copy of the GNU Affero General Public License
16 # along with Confetti.  If not, see <http://www.gnu.org/licenses/>. 
17
18 check_type(){
19   [ "$_GET[\"filtertype\"]" = "$1" ] && echo 'checked="checked"'
20 }
21 check_order(){
22   [ "$_GET[\"order\"]" = "$1" ] && echo 'checked="checked"'
23 }
24
25 edit="$_GET[\"edit\"]"
26 [ -z "$_GET[\"filtertype\"]" ] && _GET["filtertype"]="any"
27 [ -z "$_GET[\"order\"]" ] && _GET["order"]="firstname"
28
29 cat <<EOF
30 <div class="filter">
31   <span class="label">$(l10n filter_label)</span>
32   <form class="search" action="/?action=filter_attendee" method="POST">
33     <input type="hidden" name="page" value="attendees"/>
34     <input type="text" name="filter" value="$_GET["filter"]" placeholder="$(l10n filter_placeholder)"/>
35     <br />
36     <span class="label">$(l10n filter_type):</span>
37     <input type="radio" name="filtertype" value="any" $(check_type any)>$(l10n filter_all)</input>
38     <input type="radio" name="filtertype" value="name" $(check_type name)>$(l10n filter_name)</input>
39     <input type="radio" name="filtertype" value="street" $(check_type street)>$(l10n filter_street)</input>
40     <input type="radio" name="filtertype" value="zip" $(check_type zip)>$(l10n filter_zip)</input>
41     <input type="radio" name="filtertype" value="telephone" $(check_type telephone)>$(l10n filter_phone)</input>
42     <input type="radio" name="filtertype" value="birth" $(check_type birth)>$(l10n filter_birthyear)</input>
43     <input type="radio" name="filtertype" value="course" $(check_type course)>$(l10n filter_course)</input>
44     <br />
45     <span class="label">$(l10n filter_order):</span>
46     <input type="radio" name="order" value="firstname" $(check_order firstname)>$(l10n filter_firstname)</input>
47     <input type="radio" name="order" value="lastname" $(check_order lastname)>$(l10n filter_lastname)</input>
48     <input type="radio" name="order" value="bdate" $(check_order bdate)>$(l10n filter_bdate)</input>
49     <br>
50     <button type="submit" name="choice" value="new_filter">$(l10n filter_apply)</button>
51     <button type="submit" name="choice" value="del_filter">$(l10n filter_cancel)</button>
52   </form>
53 </div>
54
55 <div class="newcard">
56 <form action="?action=new_attendee" method="POST">
57   <button type="submit">$(l10n newcard)</button>
58 </form>
59 </div>
60
61 <div class="cardlist">
62 $(
63 [ -f "vcard/$edit" -o -f "temp/$edit" ] &&  edit_attendee "$edit"
64 if [ "$?" = 0 ]; then
65   listcards |grep -v "$edit"
66 else
67   listcards
68 fi |while read card; do
69   view_attendee "$card"
70 done
71 )
72 </div>
73 EOF
74
75 # vi:set filetype=html: