]> git.plutz.net Git - lobster/commitdiff
disable autosubmit, submit when using back-button
authorPaul Hänsch <paul@plutz.net>
Mon, 7 Sep 2020 10:05:30 +0000 (12:05 +0200)
committerPaul Hänsch <paul@plutz.net>
Mon, 7 Sep 2020 10:05:30 +0000 (12:05 +0200)
therapies/page.sh
therapies/therapy.css
therapies/update_therapy.sh

index a36505f5c90de5f30fdd6bd6475b1b3e17f481f6..56b58658e1510da9f8af8902347a3397b0f7c8e9 100755 (executable)
@@ -93,7 +93,7 @@ cat <<EOF
 [h1 $(l10n therapy)]
 
 [div .patient
-  [h2 . [a "/cards/#${id%.*}.vcf" &#x2b05; $(VCF FN |HTML)]]
+  [h2 . &#x2b05; $(VCF FN |HTML)]
 ]
 
 [div .therapies
@@ -154,6 +154,8 @@ cat <<EOF
 [form #report method=POST action="/therapies/update_therapy.sh"
   [hidden "id" "$id"][hidden "tid" "$(transid "$tpyfile")"]
 
+  [button #backbutton type=submit name="vcfreturn" value="true" &#x2b05; $(VCF FN |HTML)]
+
   [input .stickynote type=checkbox name=c_stickynote #show_stickynote]
   [fieldset .stickynote
     [label for="show_stickynote" $(l10n notes)]
@@ -222,5 +224,5 @@ cat <<EOF
 [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"]
+[!-- script type="text/javascript" src="/therapies/autosave.js" --]
 EOF
index 323f0483c8ef258fc58c3d8cec650a28328784a7..90eb0270d14f8d996152c9c22fac64bd4efe5f2e 100644 (file)
@@ -35,6 +35,17 @@ form > button[type=submit]:hover {
   background-color: #FEE;
 }
 
+form > button#backbutton {
+  position: absolute;
+  top: 2em;
+  left: 2%;
+  background: transparent;
+  border: none;
+  padding: 0;
+  margin: 0;
+}
+
+
 input.tab { display: none; }
 input.tab + label.tab { display: block; }
 input.tab + label.tab::before { content: '\25b8 \00a0'; float: left;}
index 0474b3b3be6d608f4db5975b93b03dc1b21c2c4a..c72d0408de3af39e0c5606a72f7f9476e460c25f 100755 (executable)
@@ -125,6 +125,8 @@ if [ "$(POST autosubmit)" = "true" ]; then
   msg="$(transid "$tpyfile")"
   printf 'HTTP/1.1 200 OK\r\nContent-Length: %i\r\n\r\n%s' \
          "${#msg}" "${msg}"
+elif [ "$(POST vcfreturn)" ]; then
+  REDIRECT "/cards/#${tpy%.*}.vcf"
 else
   REDIRECT "/therapies/${tpy%.*}/${tpy#*.}"
 fi