[% INCLUDE navbar %]
[% END %]
-[% IF objects.size %]
+[% IF object %]
<div id="title">Edit a [% classmetadata.moniker %]</div>
-[% FOR item = objects; %]
-<form action="[% base %]/[% item.table %]/do_edit/[% item.id %]" method="post">
+<form action="[% base %]/[% object.table %]/do_edit/[% object.id %]" method="post">
<fieldset>
-<legend>Edit [% item.name %]</legend>
-[% FOR col = classmetadata.columns;
+<legend>Edit [% object.name %]</legend>
+ [% FOR col = classmetadata.columns;
NEXT IF col == "id" OR col == classmetadata.table _ "_id";
- '<label><span class="field">';
- classmetadata.colnames.$col; ":</span>";
- item.to_field(col).as_XML;
- "</label>";
- IF errors.$col;
+ SET col_label = classmetadata.colnames.$col; %]
+ <label><span class="field"> [% col_label %] </span> [% object.to_field(col).as_XML %]</label>
+ [% IF errors.$col;
'<span class="error">'; errors.$col;'</span>';
+ ELSIF errors.$col_label;
+ '<span class="error">'; errors.$col_label;'</span>';
END;
END %]
<input type="submit" name="edit" value="edit"/>
<input type="hidden" name="__form_id" value="[% request.make_random_id %]">
</fieldset></form>
- [% END %]
[% ELSE %]
<div id="addnew">