<%doc> =head1 edit This is the edit page. It edits the passed-in object, by displaying a form similar to L but with the current values filled in. =cut
Edit a <% $classmetadata->{moniker} %>
% foreach my $item ( @$objects ) { % $item ||= $classmetadata->{name}; # after a create error, $item == undef <& .formtag, item => $item &>
<& .legend, item => $item &> % foreach my $col ( @{ $classmetadata->{columns} } ) { % next if $col eq "id"; <% $item->to_field( $col )->as_XML %> % if ( $errors->{ $col } ) { <% $errors->{ $col } %> % } % }
% } <%init> # this gets exported via template_args if there was an error in do_edit our $errors; <%def .formtag> <%args> $item % if ( ref $item ) {
% } else { % } <%def .legend> <%args> $item % if ( ref $item ) { Edit <% $item->get( $item->stringify_column ) %> % } else { Add a new <% $classmetadata->{moniker} %> % }