X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=therapies%2Fpage.sh;h=a38372f9e3443ebc5caec497cc391369d8aaa432;hb=1e1cb695a2a413f310c4538c0d3b951f4d4fe72f;hp=2f0136ba25f9cfa8f8641fbe7a009965e5d2a049;hpb=6a48f4094cf2b0757c9fb5913739dc43e3f589b9;p=lobster diff --git a/therapies/page.sh b/therapies/page.sh index 2f0136b..a38372f 100755 --- a/therapies/page.sh +++ b/therapies/page.sh @@ -44,7 +44,20 @@ t_session_note(){ } therapy_sessions(){ - n=1; while [ "$(TPY session$n)" ]; do + n=1; while [ "$(TPY session$n)" ]; do n=$((n + 1)); done + + sid=session$n + cat <<-EOF + [fieldset .tab + [submit "new_session" "$sid" .no . +] + [input .date name="${sid}_date" value="" placeholder=$(l10n date)] + [input .therapist name="${sid}_therapist" value="" placeholder=$(l10n therapist)] + [span .signature] + [hidden "${sid}_note1" ""] + ] + EOF + + seq $((n - 1)) -1 1 | while read n; do session_n="$n" sid=session${session_n} @@ -60,7 +73,7 @@ therapy_sessions(){ [span .signature [checkbox "${sid}_sigset" "pos" $(checked "$(TPY "${sid}_sigset")" "pos")]] ] [div .tab - [img .dotmark .ov src="/therapies/${id}_${sid}.png" alt=""] + [img .dotmark .ov src="/therapies/${id}_${sid}.png?${_DATE}" alt=""] $(n=1; while TPY "session${session_n}_note${n}" >/dev/null; do [ "$(TPY "session${session_n}_note${n}")" ] && x=$n n=$(($n + 1)) @@ -73,20 +86,7 @@ therapy_sessions(){ [button type="submit" name=delete_session value="$session_n" .delete $(l10n delete_session)] ] EOF - n=$(($n+1)) done - - sid=session$n - - cat <<-EOF - [fieldset .tab - [submit "new_session" "$sid" .no . +] - [input .date name="${sid}_date" value="" placeholder=$(l10n date)] - [input .therapist name="${sid}_therapist" value="" placeholder=$(l10n therapist)] - [span .signature] - [hidden "${sid}_note1" ""] - ] - EOF } cat <