<%args>
$config
$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) {
%   my $string = $item->stringify_column;
<h2> Edit <% $item->get($string) %></h2>


<form action="<% $base %>/<% $item->table %>/<% 
	$config->{request_reverse} ?
	$item->id ."/do_edit" :
	"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="save">
%}

<& footer, %ARGS &>
