X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=templates%2Ftherapy.html.sh;h=e8af01505d69162934a44936732e8d177f7b0253;hb=15013eb0790a7935dc28b8ace6d5001122e400f1;hp=84f9cbe81595654dbee001f38898a5649841b737;hpb=ef6500444e74092cf8ec5dda12b7ce20e3f4234f;p=lobster
diff --git a/templates/therapy.html.sh b/templates/therapy.html.sh
index 84f9cbe..e8af015 100755
--- a/templates/therapy.html.sh
+++ b/templates/therapy.html.sh
@@ -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)
@@ -192,16 +171,26 @@ EOF
therapy_sessions
+_checked="$(validate "$tpy[penwidth]" '(4|12|36)' '4')"
+cat <
+
+
+
+
+EOF
+
+_checked="$(validate "$tpy[color]" '#(0[0A]{2}|A00|A0A|AA0|FFF)' '#000')"
cat <
-
-
-
-
-
-
-
-
+