]> git.decadent.org.uk Git - maypole.git/blob - templates/factory/view
Split the meat of the view template off to a view_item macro.
[maypole.git] / templates / factory / view
1 [%#
2
3 =for doc
4
5 The C<view> template takes some objects (usually just one) from
6 C<objects> and displays the object's properties in a table. 
7
8 =cut
9
10 #%]
11 [% PROCESS macros %]
12 [% INCLUDE header %]
13 [% FOR item = objects %]
14 [% view_item(item); %]
15 [%#
16
17 =for doc
18
19 The C<view> template also displays a list of other objects related to the first
20 one via C<has_many> style relationships; this is done by calling the
21 C<related_accessors> method - see L<Model/related_accessors> - to return
22 a list of has-many accessors. Next it calls each of those accessors, and
23 displays the results in a table.
24
25 #%]
26     <br /><a href="[%base%]/[%item.table%]/list">Back to listing</a>
27 [% view_related(item); %]
28     
29 [%
30     button(item, "edit");
31     button(item, "delete");
32 %]
33 [% END; %]
34 [% INCLUDE footer %]