]> git.plutz.net Git - confetti/blobdiff - templates/edit_prescription.sh
support for maniupulating vcard categories
[confetti] / templates / edit_prescription.sh
index 8ac9bb7e5c6cef68d9f1d530cbb96370f2a7e34b..b7a9af46341ab513e43430925fefe011d2bed85b 100755 (executable)
@@ -113,16 +113,27 @@ cat <<END_HTML
 <label for="quantity">$(l10n quantity)</label>
 <label for="remidy">$(l10n remidy)</label>
 <label for="quantity_weekly">$(l10n quantity_weekly)</label>
+<p>
 <input id="quantity" name="quantity" value="${mpx[quantity]}" placeholder="$(l10n quantity)">
 <textarea id="remidy" name="remidy" placeholder="$(l10n remidy)">${mpx[remidy]}</textarea>
 <input id="quantity_weekly" name="quantity_weekly" value="${mpx[quantity_weekly]}" placeholder="$(l10n quantity_weekly)">
+</p>
 
-<label for="quantity1">$(l10n quantity)</label>
-<label for="remidy1">$(l10n remidy)</label>
-<label for="quantity_weekly1">$(l10n quantity_weekly)</label>
-<input id="quantity1" name="quantity1" value="${mpx[quantity1]}" placeholder="$(l10n quantity)">
-<textarea id="remidy1" name="remidy1" placeholder="$(l10n remidy)">${mpx[remidy1]}</textarea>
-<input id="quantity_weekly1" name="quantity_weekly1" value="${mpx[quantity_weekly1]}" placeholder="$(l10n quantity_weekly)">
+$( for n in {0..10}; do
+  if [ "$n" -eq 0 -o -n "${mpx[quantity$n]}" -o -n "${mpx[remidy$n]}" -o -n "${mpx[quantity_weekly$n]}" ]; then
+    printf '<input class="trailbtn" type="checkbox" checked="checked" />'
+  else
+    printf '<input class="trailbtn" type="checkbox" />'
+  fi
+  printf '<p class="trailbox">
+    <input class="quantity" name="quantity" placeholder="%s" value="%s">
+    <textarea class="remidy" name="remidy" placeholder="%s">%s</textarea>
+    <input class="quantity_weekly" name="quantity_weekly" placeholder="%s" value="%s">
+    </p>
+  ' "$(l10n quantity)" "${mpx[quantity$n]}" \
+    "$(l10n remidy)" "${mpx[remidy$n]}" \
+    "$(l10n quantity_weekly)" "${mpx[quantity_weekly$n]}"
+done )
 
 <br>
 <p class="indicator_codes">
@@ -137,6 +148,21 @@ cat <<END_HTML
 <label for="indicator_reading">$(l10n indicator_reading)</label>
 <textarea id="indicator_reading" name="indicator_reading" placeholder="$(l10n indicator_reading)">${mpx[indicator_reading]}</textarea>
 </p>
+<br>
+<p class="issuer">
+  <label>$(l10n issuer)</label>
+  <input type="radio" name="issuer_select" value="list" id="issuer_select_list" checked /><label for="issuer_select_list">$(l10n issuer_from_list)</label><!--
+  --><input type="radio" name="issuer_select" value="other" id="issuer_other"><label for="issuer_other">$(l10n issuer_other)</label>
+  <select class="item" name="issuer">
+    <option value="" disabled="disabled" $([ -z "${mpx[issuer]}" ] && printf 'selected' )>$(l10n issuer)...</option>
+    $(list_prescription_issuers |while read f; do
+      [ "$f" = "$mpx[issuer]" ] \
+      && printf '<option value="%s" selected>%s</option>' "$f" "$f" \
+      || printf '<option value="%s">%s</option>' "$f" "$f"
+    done)
+  </select>
+  <input type="text" name="issuer_other" value="" placeholder="$(l10n issuer)..." />
+</p>
 </fieldset>
 
 <fieldset class="controls">