- Improved factory templates
- added the status() attribute, although it's not used in many places
yet
+ - Changed factory edit/view to use object instead of objects
Maypole::Model::CDBI
- improved error messages in do_edit action
$r->{config} ||= {};
}
if ($tt->process(\$error_template,
- { err_type => $type, error => $error,
+ { err_type => $type, error => $error,
config => $r->{config},
request => $r,
eval{$self->vars($r)} }, \$output )) {
[% 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">
<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;
+ object.to_field(col).as_XML;
"</label>";
IF errors.$col;
'<span class="error">'; errors.$col;'</span>';
<input type="hidden" name="__form_id" value="[% request.make_random_id %]">
</fieldset></form>
- [% END %]
[% ELSE %]
<div id="addnew">
#%]
[% PROCESS macros %]
[% INCLUDE header %]
-[% FOR item = objects %]
-[% view_item(item); %]
+[% view_item(object); %]
[%#
=for doc
displays the results in a table.
#%]
- <br /><a href="[%base%]/[%item.table%]/list">Back to listing</a>
-[% view_related(item); %]
+ <br /><a href="[%base%]/[%object.table%]/list">Back to listing</a>
+[% view_related(object); %]
[%
- button(item, "edit");
- button(item, "delete");
+ button(object, "edit");
+ button(object, "delete");
%]
-[% END; %]
[% INCLUDE footer %]