]> git.decadent.org.uk Git - maypole.git/blob - templates/factory/edit
5feb34eb0d128153daff76b41158495ca0497162
[maypole.git] / templates / factory / edit
1 [%#
2
3 =head1 edit
4
5 This is the edit page. It edits the passed-in object, by displaying a
6 form similar to L<add_new> but with the current values filled in.
7
8 =cut
9
10 #%]
11 [% PROCESS macros %]
12 [% INCLUDE header %]
13 [% INCLUDE title %]
14 <div id="title">Edit a [% classmetadata.moniker %]</div>
15 [% FOR item = objects; %]
16 <form action="[% base %]/[% item.table %]/do_edit/[% item.id %]" method="post">
17 <fieldset>
18 <legend>Edit [% item.name %]</legend>
19 [% FOR col = classmetadata.columns;
20     NEXT IF col == "id";
21     '<label><span class="field">';
22     classmetadata.colnames.$col; ":</span>";
23     item.to_field(col).as_XML;
24     "</label>";
25     IF errors.$col; 
26        '<span class="error">'; errors.$col;'</span>';
27     END;
28     END;
29     '<input type="submit" name="edit" value="edit"/>';
30     "</fieldset></form>";
31     
32     END %]
33
34 [% INCLUDE footer %]