X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=templates%2Ftherapy.html.sh;h=1821c24530c97b980d31fbad9ba50c87a116ac45;hb=40c7aefbdb52aae1b46745a0979d40499f04e2b8;hp=84f9cbe81595654dbee001f38898a5649841b737;hpb=ef6500444e74092cf8ec5dda12b7ce20e3f4234f;p=lobster
diff --git a/templates/therapy.html.sh b/templates/therapy.html.sh
index 84f9cbe..1821c24 100755
--- a/templates/therapy.html.sh
+++ b/templates/therapy.html.sh
@@ -1,4 +1,4 @@
-# Copyright 2016 Paul Hänsch
+# Copyright 2016, 2017 Paul Hänsch
#
# This file is part of Confetti.
#
@@ -22,35 +22,26 @@ t_session_note(){
color=session${session_n}_note${note_n}_color
unset c0 c1 c2 c3 c4 c5 c6 c7
- case "$tpy[$color]" in
- \#888) c0=checked;;
- \#00A) c1=checked;;
- \#0A0) c2=checked;;
- \#0AA) c3=checked;;
- \#A00) c4=checked;;
- \#A0A) c5=checked;;
- \#AA0) c6=checked;;
- *) c7=checked;;
- esac
-
-if [ "$note_n" -eq 1 -o -n "${tpy[session${session_n}_note${note_n}]}" ]; then
- printf ''
-else
- printf ''
-fi
-cat <
-
-
-
-
-
-
-
-
-
-
-EOF
+ if [ "$note_n" -eq 1 -o -n "${tpy[session${session_n}_note${note_n}]}" ]; then
+ printf ''
+ else
+ printf ''
+ fi
+
+ _checked="$(validate "$tpy[$color]" '#(888|00A|0A0|0AA|A00|A0A|AA0)' '#FFF')"
+ cat <<-EOF
+
+ EOF
}
t_session(){
@@ -111,18 +102,6 @@ therapy_sessions(){
EOF
}
-unset c0 c1 c2 c3 c4 c5 c6 c7
-case "$tpy[color]" in
- \#00A) c1="checked";;
- \#0A0) c2="checked";;
- \#0AA) c3="checked";;
- \#A00) c4="checked";;
- \#A0A) c5="checked";;
- \#AA0) c6="checked";;
- \#FFF) c7="checked";;
- *) c0="checked";;
-esac
-
cat <$(l10n therapy)
@@ -174,8 +153,27 @@ cat <
+
+
+