]> git.plutz.net Git - confetti/blobdiff - templates/prescriptions.html.sh
improved styling for prescription sheets
[confetti] / templates / prescriptions.html.sh
index a3db3a7d879157a24982c309ca357f5f2d58a76e..a662c74b229346376b8155acd737a66739762e0e 100755 (executable)
@@ -25,7 +25,6 @@ cat <<EOF
 
 <!--h1>$(l10n prescriptions_current)</h1-->
 
-${edit:+$(edit_prescription "$edit")}
 <div class="newprescription">
   <form action="?action=new_prescription" method="POST">
     <input type="hidden" name="client" value="$client">
@@ -33,9 +32,13 @@ ${edit:+$(edit_prescription "$edit")}
   </form>
 </div>
 
+$(list_prescriptions "$client" |grep -q "$edit" || edit_prescription "$edit")
+
 $(list_prescriptions "$client" \
   |while read pre; do 
-    [ "$pre" = "$edit" ] || view_prescription "$pre"
+    [ "$pre" = "$edit" ] \
+    && edit_prescription "$pre" \
+    || view_prescription "$pre"
   done
 )