]> gitweb.factorcode.org Git - factor.git/blob - extra/furnace/scaffold/crud-templates/list.furnace
Initial import
[factor.git] / extra / furnace / scaffold / crud-templates / list.furnace
1 <% USING: namespaces kernel io sequences generic words
2 prettyprint furnace parser ; %>
3
4 <% "model" get dup sequence? not [ unparse %>
5 <p><a href="<% write %>-new">New</a></p><% ] [ %>
6
7 <p><a href="<% first class unparse write %>-new">New</a></p>
8
9 <table>
10 <% "model" get dup first class dup
11     word-vocabulary use+ "slot-names" word-prop %>
12 <tr><% [ %><th><% write %></th><% ] each %></tr>
13
14 <% [ %>
15     
16 <tr><% dup tuple-slots [ %><td><% write %></td><% ] each %>
17     
18     <% dup crud-index swap class dup "crud-index" word-prop swap unparse %>
19     <td><a href="<% 3dup write %>-show?<% write %>=<% write %>">Show</a></td>
20     <td><a href="<% 3dup write %>-edit?<% write %>=<% write %>">Edit</a></td>
21     <td><a href="<% write %>-delete?<% write %>=<% write %>">Delete</a></td></tr>
22
23 <% ] each %>
24
25 </table>
26
27 <% ] if %>