5 This is the edit page. It edits the passed-in object, by displaying a
6 form similar to L<addnew> but with the current values filled in.
15 [% IF request.action == 'edit' %]
20 <div id="title">Edit a [% classmetadata.moniker %]</div>
21 [% FOR item = objects; %]
22 <form action="[% base %]/[% item.table %]/do_edit/[% item.id %]" method="post">
24 <legend>Edit [% item.name %]</legend>
25 [% FOR col = classmetadata.columns;
26 NEXT IF col == "id" OR col == classmetadata.table _ "_id";
27 '<label><span class="field">';
28 classmetadata.colnames.$col; ":</span>";
29 item.to_field(col).as_XML;
32 '<span class="error">'; errors.$col;'</span>';
35 <input type="submit" name="edit" value="edit"/>
36 <input type="hidden" name="__form_id" value="[% request.make_random_id %]">
43 <form method="post" action="[% base %]/[% classmetadata.table %]/do_edit/">
45 <legend>Add a new [% classmetadata.moniker %]</legend>
46 [% FOR col = classmetadata.columns %]
47 [% NEXT IF col == "id" %]
48 <label><span class="field">[% classmetadata.colnames.$col %]</span>
50 SET elem = classmetadata.cgi.$col.clone;
51 IF request.action == 'do_edit';
52 IF elem.tag == "textarea";
53 elem = elem.push_content(request.param(col));
55 elem.attr("value", request.param(col));
61 <span class="error">[% errors.$col | html %]</span>
65 <input type="submit" name="create" value="create" />
66 <input type="hidden" name="__form_id" value="[% request.make_random_id %]" />