<%args>
$request
$classmetadata
$objects
$base
$errors=>undef
</%args>

<%doc>

=head1 edit

This is the edit page. It edits the passed-in object, by displaying a
form similar to L<add_new> but with the current values filled in.

</%doc>

<& header, %ARGS &>

%foreach my $item (@$objects) {
<h2> Edit <% $item->name %></h2>

<FORM ACTION="<% $base %>/<% $item->table %>/do_edit/<% $item->id %>" METHOD="post">
%foreach my $col (@{$classmetadata->{columns}}) {
%   next if $col eq "id";
        <P>
        <B><% $classmetadata->{colnames}->{$col}%></B>
        : 
           <%$item->to_field($col)->as_HTML%>
        </P>
%        if ($errors->{$col}) {
            <FONT COLOR="#ff0000"> <%$errors->{$col}%> </FONT>
%        }
%}
     <INPUT TYPE="submit" NAME="edit" VALUE="edit">
%}

<& footer, %ARGS &>
