]> git.plutz.net Git - confetti/commitdiff
limit note trail to used + 3 fields
authorpaul <paul@plutz.net>
Tue, 19 Jul 2016 16:34:00 +0000 (16:34 +0000)
committerpaul <paul@plutz.net>
Tue, 19 Jul 2016 16:34:00 +0000 (16:34 +0000)
svn path=/trunk/; revision=126

static/therapy.css
templates/text_therapy.sh
templates/therapy.html.sh

index f7dc3beae7f45e1d85a52f4c50e5091cd01d40c5..16528a4c5209e3ae2bd825dedd059f1ca303a70e 100644 (file)
@@ -1,5 +1,16 @@
 .trailbtn:checked + fieldset.trailbox { display: block;}
 
+.trailbtn:checked + .trailbox + .trailbtn {
+  display: block;
+  height: 2.25em; padding: 0 3ex;
+  font-size: 1em; font-weight: normal;
+  color: #000; background-color: #FDD;
+  border: 1px solid #000;
+  border-radius: 4px;
+}
+.trailbtn:checked + .trailbox + .trailbtn[type=submit]:before {content: none;}
+
+
 * { box-sizing: border-box; }
 body {
   overflow: scroll;
index bda1231de5b12d9a80d508a443b4fb90fd088498..a2735b2a4745b1f5a5b2196be76dd1ef7d314c4d 100755 (executable)
@@ -24,3 +24,4 @@ item_name[number]="Nr."
 item_name[signature]="Un&shy;ter&shy;schrift"
 item_name[weekly]="p. Woche"
 item_name[notes]="Notizen"
+item_name[trailsave]="Speichern für weitere Felder"
index 6addbed8e60ea1a57e2cd9e108b7ca10b2995764..84f9cbe81595654dbee001f38898a5649841b737 100755 (executable)
@@ -64,24 +64,32 @@ t_session(){
     unset sigcheck
   fi
 
-cat <<EOF
-  <input type=hidden name=$sid value=exists>
-  <input class="tab" type="checkbox" id=${sid}_open name="${sid}_open" value="checked" ${tpy[${sid}_open]}>
-  <label class="tab" for="${sid}_open">
-    <span class=no>${session_n}.</span><!--
- --><span class=date>${tpy[${sid}_date]}</span><!--
- --><input class="date" name="${sid}_date" value="${tpy[${sid}_date]}" placeholder="$(l10n date)"><!--
- --><span class=therapist>${tpy[${sid}_therapist]}</span><!--
- --><input class="therapist" name="${sid}_therapist" value="${tpy[${sid}_therapist]}" placeholder="$(l10n therapist)"><!--
- --><span class=signature><input type="checkbox" name="${sid}_sigset" value="pos" $sigcheck></span>
-  </label>
-  <div class=tab>
-    <img class="dotmark ov" src="/therapies/${id%.tpy}_${sid}.png" alt="">
-    $( for n in {1..10}; do t_session_note $session_n $n; done )
-
-    <button class=delete type=submit name=delete_session value=${session_n}>$(l10n delete_session)</button>
-  </div>
-EOF
+       cat <<-EOF
+         <input type=hidden name=$sid value=exists>
+         <input class="tab" type="checkbox" id=${sid}_open name="${sid}_open" value="checked" ${tpy[${sid}_open]}>
+         <label class="tab" for="${sid}_open">
+           <span class=no>${session_n}.</span><!--
+        --><span class=date>${tpy[${sid}_date]}</span><!--
+        --><input class="date" name="${sid}_date" value="${tpy[${sid}_date]}" placeholder="$(l10n date)"><!--
+        --><span class=therapist>${tpy[${sid}_therapist]}</span><!--
+        --><input class="therapist" name="${sid}_therapist" value="${tpy[${sid}_therapist]}" placeholder="$(l10n therapist)"><!--
+        --><span class=signature><input type="checkbox" name="${sid}_sigset" value="pos" $sigcheck></span>
+         </label>
+         <div class=tab>
+           <img class="dotmark ov" src="/therapies/${id%.tpy}_${sid}.png" alt="">
+           $(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
+             )
+           <button class="trailbtn" type="submit">$(l10n trailsave)</button>
+           <button class=delete type=submit name=delete_session value=${session_n}>$(l10n delete_session)</button>
+         </div>
+       EOF
 }
 
 therapy_sessions(){
@@ -92,15 +100,15 @@ therapy_sessions(){
 
   sid=session$n
 
-cat <<EOF
-  <fieldset class="tab">
-    <button class=no type=submit name=new_session value=$sid>+</button><!--
- --><input class=date name=${sid}_date value="" placeholder="$(l10n date)" /><!--
- --><input class=therapist name=${sid}_therapist value="" placeholder="$(l10n therapist)" /><!--
- --><span class=signature><span></span>
-    <input type=hidden name="${sid}_note1" value="">
-  </fieldset>
-EOF
+       cat <<-EOF
+         <fieldset class="tab">
+           <button class=no type=submit name=new_session value=$sid>+</button><!--
       --><input class=date name=${sid}_date value="" placeholder="$(l10n date)" /><!--
       --><input class=therapist name=${sid}_therapist value="" placeholder="$(l10n therapist)" /><!--
       --><span class=signature><span></span>
+           <input type=hidden name="${sid}_note1" value="">
+         </fieldset>
+       EOF
 }
 
 unset c0 c1 c2 c3 c4 c5 c6 c7