X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=templates%2Ftherapy.html.sh;h=e8af01505d69162934a44936732e8d177f7b0253;hp=70d9c3fe704139cf2c19388e0a205364a634dacf;hb=0e0e7e6828d5bb00ed610134d8a31dc0b40ae791;hpb=31e822c91021f8848238337a67fcf364f9135aad diff --git a/templates/therapy.html.sh b/templates/therapy.html.sh index 70d9c3f..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 -if [ "$note_n" -eq 1 -o -n "${tpy[session${session_n}_note${note_n}]}" ]; then - printf '' -else - printf '' -fi -cat < - - - - - - - - - - -EOF + _checked="$(validate "$tpy[$color]" '#(888|00A|0A0|0AA|A00|A0A|AA0)' '#FFF')" + cat <<-EOF +
+ + + + + + + + + +
+ EOF } t_session(){ @@ -64,24 +55,32 @@ t_session(){ unset sigcheck fi -cat < - - -
- - $( for n in {1..50}; do t_session_note $session_n $n; done ) - - -
-EOF + cat <<-EOF + + + +
+ + $(n=1; + while [ -n "${tpy[session${session_n}_note${n}]+x}" ]; do + if [ -n "${tpy[session${session_n}_note${n}]}" ]; then + x=$n + fi + n=$(($n + 1)) + done + for n in $(seq 1 $((${x:-0} + 3)) ); do t_session_note $session_n $n; done + ) + + +
+ EOF } therapy_sessions(){ @@ -92,29 +91,17 @@ therapy_sessions(){ sid=session$n -cat < - - - -EOF + cat <<-EOF +
+ + +
+ 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) @@ -154,9 +141,13 @@ cat < } + + + +
${mpx[indicator_reading]}
-
+ @@ -166,6 +157,10 @@ cat <$(l10n save) + +