improved styling for prescription sheets
[confetti] / templates / prescriptions.html.sh
index a3db3a7..a662c74 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
 )