]> git.decadent.org.uk Git - maypole.git/blobdiff - templates/factory/edit
Maypole::Application supports Maypole::HTTPD (which needs a patch).
[maypole.git] / templates / factory / edit
index 714cb8716c1edcde2100261a48cc7585cdc04097..6bdad79347cef088c484d66ec30a546387772fb9 100644 (file)
@@ -3,13 +3,16 @@
 =head1 edit
 
 This is the edit page. It edits the passed-in object, by displaying a
-form similar to L<add_new> but with the current values filled in.
+form similar to L<addnew> but with the current values filled in.
 
 =cut
 
 #%]
 [% PROCESS macros %]
 [% INCLUDE header %]
+[% INCLUDE title %]
+[% IF objects.size %]
+<div id="title">Edit a [% classmetadata.moniker %]</div>
 [% FOR item = objects; %]
 <form action="[% base %]/[% item.table %]/do_edit/[% item.id %]" method="post">
 <fieldset>
@@ -23,10 +26,13 @@ form similar to L<add_new> but with the current values filled in.
     IF errors.$col; 
        '<span class="error">'; errors.$col;'</span>';
     END;
-    END;
-    '<input type="submit" name="edit" value="edit"/>';
-    "</fieldset></form>";
-    
     END %]
-
+    <input type="submit" name="edit" value="edit"/>
+    <input type="hidden" name="__form_id" value="[% request.make_random_id %]">
+    </fieldset></form>
+    
+    [% END %]
+[% ELSE %]
+[% INCLUDE addnew %]
+[% END %]
 [% INCLUDE footer %]