]> git.decadent.org.uk Git - maypole.git/blob - templates/factory/edit
A little bit of refactoring and documentation.
[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 #%]
9
10 [% PROCESS macros %]
11 [% INCLUDE header %]
12
13 [% FOR item = objects; %]
14 <h2> Edit [% item.name %]</h2>
15
16 <FORM ACTION="[% base %]/[% classmetadata.moniker %]/do_edit/[% item.id %]" METHOD="post">
17 [%
18      FOR col = classmetadata.columns;
19         NEXT IF col == "id";
20         "<P>";
21         "<B>"; classmetadata.colnames.$col; "</B>";
22         ": ";
23             item.to_field(col).as_HTML;
24         "</P>";
25         IF errors.$col; 
26             "<FONT COLOR=\"#ff0000\">"; errors.$col; "</FONT>";
27         END;
28     END;
29      '<INPUT TYPE="submit" NAME="edit" VALUE="edit">';
30 END %]