]> git.plutz.net Git - confetti/blob - templates/prescriptions.html.sh
slightly improved touchscreen buttons
[confetti] / templates / prescriptions.html.sh
1 # Copyright 2016 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 client="${_GET[client]}"
19 edit="${_GET[edit]}"
20 [ -n "$edit" ] && client="${edit%.*.mpx}.vcf"
21
22 cat <<EOF
23
24 <div id="${card}" class="card">$(view_card "$client")</div>
25
26 <!--h1>$(l10n prescriptions_current)</h1-->
27
28 <div class="newprescription">
29   <form action="?action=new_prescription" method="POST">
30     <input type="hidden" name="client" value="$client">
31     <button type="submit">$(l10n newprescription)</button>
32   </form>
33 </div>
34 EOF
35
36 list_prescriptions "$client" |grep -q "$edit" || edit_prescription "$edit"
37
38 list_prescriptions "$client" \
39 |while read pre; do 
40   [ "$pre" = "$edit" ] \
41   && edit_prescription "$pre" \
42   || view_prescription "$pre"
43 done
44
45 #<!--h1>$(l10n prescriptions_past)</h1-->
46
47 # vi:set filetype=html: