]> git.decadent.org.uk Git - maypole.git/blob - ex/fancy_example/templates/drinker/view
Drinker uses add_to_from_cgi and other stuff. Now it is a nice working
[maypole.git] / ex / fancy_example / templates / drinker / view
1 [%#
2
3 =for doc
4
5 Drinker  C<view> template displays drinker and from to drink beer. 
6
7 =cut
8
9 #%]
10 [% PROCESS macros %]
11 [% INCLUDE header %]
12 [% view_item(object); %]
13
14 [%# Form to drink a pint. We made sure to only make inputs for pint. could do it
15   # here like so. 
16   USE this = Class(classmetadata.name);
17   classmetadata.cgi = this.to_field(pints);
18
19 %]
20 <div id="search">
21 <form action="[% base _ "/" _ request.table _ "/" _ request.action _ "/" _ object.id %]" method="post">
22 <fieldset>
23 <legend> Drink a pint </legend>
24
25 [% 
26         INCLUDE display_inputs classmetadata.columns=['pints'] ;
27 %]
28
29 <input type='submit'name='submit' value='Hellyeah!'\>
30
31 </fieldset>
32 </form>
33
34 </div>
35
36 [%#
37
38 =for doc
39
40 The C<view> template also displays a list of other objects related to the first
41 one via C<has_many> style relationships; this is done by calling the
42 C<related_accessors> method - see L<Model/related_accessors> - to return
43 a list of has-many accessors. Next it calls each of those accessors, and
44 displays the results in a table.
45
46 #%]
47     <br /><a href="[%base%]/[%object.table%]/list">Back to listing</a>
48 [% view_related(object); %]
49     
50 [%
51     button(object, "edit");
52     button(object, "delete");
53 %]
54 [% INCLUDE footer %]