Relaxed the need for Types that represent database boundaries to extend from ActiveRe...
[castle.git] / Samples / Castle / PetStore.Web / views / ProductManagement / List.vm
blob8eee1ef7039b394c061b72e8203ca14d93a8875d
1 <h2>Products</h2>\r
2 \r
3 <p>$HtmlHelper.LinkTo("Create new product", "new")</p>\r
4 \r
5 <div style="border: 1px solid black;">\r
6 <table class="scaffoldtable" cellpadding="5" cellspacing="0" border="0" width="100%">\r
7   <tr>\r
8     <th>&nbsp;</th>\r
9     <th>Name</th>\r
10     <th>Description</th>\r
11     <th>Price</th>\r
12     <th>Category</th>\r
13     <th>&nbsp;</th>\r
14   </tr>\r
15 #if ($list.TotalItems == 0)\r
16   <tr class="scaffoldrow">\r
17     <td colspan="6" align="center">No products in the database.</td>\r
18   </tr>\r
19 #end\r
20 #foreach($product in $list)\r
21   <tr class="scaffoldrow">\r
22     <td align="center">$product.Id</td>\r
23     <td>$product.Name</td>\r
24     <td>$product.Description</td>\r
25     <td align="center">$product.Price.ToString("C")</td>\r
26     <td align="center">$product.Category.Name</td>\r
27     <td width="1%" nowrap><a href="">edit</a> <a href="">delete</a></td>\r
28   </tr>\r
29 #end\r
30 </table>\r
32 <div class="pagination">\r
33 <table width="100%" border="0">\r
34   <tr>\r
35   <td>Showing $list.FirstItem - $list.LastItem of $list.TotalItems</td>\r
36   <td align="right">\r
37 #if($list.HasFirst) $pagination.CreatePageLink( 1, "first" ) #end\r
38 #if(!$list.HasFirst) first #end\r
39 #if($list.HasPrevious) | $pagination.CreatePageLink( $list.PreviousIndex, "prev" ) #end\r
40 #if(!$list.HasPrevious) | prev #end\r
41 #if($list.HasNext) | $pagination.CreatePageLink( $list.NextIndex, "next" ) #end\r
42 #if(!$list.HasNext) | next #end\r
43 #if($list.HasLast) | $pagination.CreatePageLink( $list.LastIndex, "last" ) #end\r
44 #if(!$list.HasLast) | last #end\r
45   </td>\r
46   </tr>\r
47 </table>\r
48 </div>\r
50 </div>