Removed untyped contructor from ComponentRegistration and add a protected setter.
[castle.git] / Experiments / Generator / Generators / Scaffold / Templates / views / list.vm
blob0ef90203524c301bc727d51f382586899c9acf90
1 #set ($title = "List <%= PluralHumanName %>")\r
2 \r
3 <div class="actions">\r
4         $HtmlHelper.LinkTo("Add a new <%= SingularHumanName %>", "<%= ControllerLink %>", "new")\r
5 </div>\r
6 \r
7 #if (!$ScaffoldHelper.HasItems($<%= PluralVarName %>))\r
8         <p>No <%= SingularHumanName %></p>\r
9 #else\r
10         <table class="list">\r
11                 <tr>\r
12                         ## Show each column\r
13                         #foreach ($prop in $ScaffoldHelper.GetProperties($<%= PluralVarName %>))\r
14                                 <th>$ScaffoldHelper.ToColumnName($prop)</th>\r
15                         #end\r
16                         <th></th>\r
17                 </tr>\r
18         \r
19                 #set ($alt = 0)\r
20                 #foreach ($<%= SingularVarName %> in $<%= PluralVarName %>)\r
21                         <tr id="<%= SingularVarName %>$<%= SingularVarName %>.Id" class="item$alt#if ($edited == $<%= SingularVarName %>.Id) fade#end">\r
22                                 \r
23                                 ## Show each <%= SingularVarName %>\r
24                                 #foreach ($prop in $ScaffoldHelper.GetProperties($<%= SingularVarName %>.GetType()))\r
25                                         <td>$!ScaffoldHelper.GetPropertyValue($<%= SingularVarName %>, $prop)</td>\r
26                                 #end\r
27                                 \r
28                                 ## <%= SingularVarName %> specific actions\r
29                                 <td class="actions">\r
30                                         $HtmlHelper.LinkTo("View", "<%= ControllerLink %>", "view", $<%= SingularVarName %>.Id)\r
31                                         $HtmlHelper.LinkTo("Edit", "<%= ControllerLink %>", "edit", $<%= SingularVarName %>.Id)\r
32                                         $AjaxHelper.LinkToRemote("Delete", "delete.<%= ActionExtension %>", $DictHelper.CreateDict("with='id=$<%= SingularVarName %>.Id'", "condition=confirm('Delete?')", "onsuccess=new Effect.Fade('<%= SingularVarName %>$<%= SingularVarName %>.Id')"))\r
33                                 </td>\r
34                         \r
35                         </tr>\r
36                         #set ($alt = 1 - $alt)\r
37                 #end\r
38         \r
39                 ## Pages browser\r
40                 <tr class="pages">\r
41                         <th class="currentpage" colspan="$ScaffoldHelper.GetProperties($<%= PluralVarName %>).Length">\r
42                                 <%= PluralHumanName %> $<%= PluralVarName %>.FirstItem - $<%= PluralVarName %>.LastItem of $<%= PluralVarName %>.TotalItems\r
43                         </th>\r
44                         <th class="pagebrowser" align="right">\r
45                                 $ScaffoldHelper.PageBrowser($<%= PluralVarName %>)\r
46                         </th>\r
47                 </tr>\r
48         </table>\r
49 #end\r