]> git.plutz.net Git - lobster/blobdiff - therapies/page.sh
auto submit therapy form data
[lobster] / therapies / page.sh
index 4c236c4c161f54f71c76eafeee201cb251bdb9eb..c3d8078567331ca783385b8db8462e38e030c148 100755 (executable)
@@ -93,7 +93,7 @@ cat <<EOF
 [h1 $(l10n therapy)]
 
 [div .patient
-  [h2 . [a "/cards/#{id%.*}.vcf" &#x2b05; $(VCF FN |HTML)]]
+  [h2 . [a "/cards/#${id%.*}.vcf" &#x2b05; $(VCF FN |HTML)]]
 ]
 
 [div .therapies
@@ -108,14 +108,15 @@ cat <<EOF
                 | sed -E ':X;N;$!bX; s;^[\n ]+;;; s;[\n ]+$;;; s;(\n.*\n|\n); - ;;'
                )"
     if [ "${tpy%.*}.${tpy#*.}" = "${id}" ]; then
-      printf '[a .item .therapy .current href="/therapies/%s" . %s]' \
+      printf '[a .item .therapy .current href="/therapies/%s" . %s] ' \
              "${tpy%.*}/${tpy#*.}" "$(HTML "${tpydates:--}")"
     else
-      printf '[a .item .therapy href="/therapies/%s" . %s]' \
+      printf '[a .item .therapy href="/therapies/%s" . %s] ' \
              "${tpy%.*}/${tpy#*.}" "$(HTML "${tpydates:--}")"
     fi
-  done |sort -r
+  done |sort -n
   )
+  [a .item .therapy href="/therapies/${id%%.*}/new" . +]
 ]
 EOF
 
@@ -210,10 +211,11 @@ cat <<EOF
   [canvas #canvas .dotmark .ov width="${bg_dim%x*}" height="${bg_dim#*x}" ]
   [input type=hidden #image_serialize name=imagedata value=""]
 
-  [button type=submit $(l10n save)]
+  [button #savebutton type=submit $(l10n save)]
 ]
 
 [span #jsdebug style="display: none; position: fixed; right:0; bottom:0" Debug]
 
 [script type="text/javascript" src="/therapies/therapy_draw.js"]
+[script type="text/javascript" src="/therapies/autosave.js"]
 EOF