<%doc> =head2 view Takes some objects (usually just one) from C and displays the object's properties in a table. It gets the displayable form of a column's name from the hash returned from the C method. The C template also displays a list of other objects related to the first one via C style relationships; this is done by calling the C method - see L - to return a list of has-many accessors. Next it calls each of those accessors, and displays the results in a table. =cut <%args> $objects $classmetadata % foreach my $item ( @$objects ) { % my $string = $item->stringify_column || die "No stringify column for $item"; % #

<% $item->get( $string ) %>

<% $classmetadata->{ moniker } %>: <& maybe_link_view, %ARGS, item => $item->get( $string ) &>

% foreach my $col ( @ { $classmetadata->{ columns } } ) { % next if $col eq 'id' or $col eq $string; % }
<% $classmetadata->{ colnames }->{ $string } %> <% $item->{ $string } %>
<% $classmetadata->{ colnames }->{ $col } %> <& maybe_link_view, %ARGS, item => $item->get( $col ) &>
<& view_related, %ARGS, object => $item &>
<& button, %ARGS, item => $item, action=> 'edit' &> <& button, %ARGS, item => $item, action=> 'delete' &>
% }