X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=therapies%2Fpage.sh;h=a53bb923f7c689888873fac2de87e86a6335c8df;hb=be67cb59512145a0fa5b8c6686996f3876618570;hp=571f9bb360054d8c9c3c05498ed11387ab5f9762;hpb=32d26dfa0db7e8d08e4ec5028ec4fe1f58038a6f;p=lobster diff --git a/therapies/page.sh b/therapies/page.sh index 571f9bb..a53bb92 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 + + for n in $(seq $((n - 1)) -1 1); do session_n="$n" sid=session${session_n} @@ -73,27 +86,14 @@ 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 <