Minor changes to improve testability of helpers
[castle.git] / MonoRail / Castle.MonoRail.ActiveRecordScaffold / Templates / list.vm
blob56079c79bf0c1364bfea55f350115717aa6b96da
2 <p>
3 $PresentationHelper.LinkToNew( $model, $useModelName, "Create a new $model.Type.Name", $DictHelper.CreateDict() )
4 </p>
6 #set($cols = $properties.Count + 2)
7 <div style="border: 1px solid black;">
8 <table class="scaffoldtable" cellpadding="5" cellspacing="0" border="0" width="100%">
9   <tr>
10     <th>&nbsp;</th>
11   #foreach($prop in $properties)
12     <th>$prop.Name</th>
13   #end
14     <th>&nbsp;</th>
15   </tr>
17 #if($items.Length == 0)
18   <tr>
19     <td colspan="$cols" align="center">Empty</td>
20   </tr>
21 #end
23 #foreach($row in $items)
24 #set ($rowid = $keyprop.GetValue($row, null) )
25   $PresentationHelper.StartAlternateTR($velocityCount, "scaffoldrow", "scaffoldaltrow")
26   
27   <td width="1%" nowrap="nowrap" align="$PresentationHelper.BestAlignFor( $keyprop.PropertyType )" class="idRow">$rowid</td>
28   
29   #foreach($prop in $properties)
30   <td align="$PresentationHelper.BestAlignFor( $prop.PropertyType )">$!prop.GetValue($row, null)</td>
31   #end
32   
33   <td align="center" nowrap="nowrap" width="1%">
34 $PresentationHelper.LinkToEdit( $model, $useModelName, "edit", $rowid, "%{class='editlink'}" )
35 $PresentationHelper.LinkToConfirm( $model, $useModelName, "remove", $rowid, "%{class='deletelink'}" )
36   </td>
37   </tr>
38 #end
39 </table>
40 <div class="pagination">
41 <table width="100%" border="0">
42   <tr>
43   <td>Showing $items.FirstItem - $items.LastItem of $items.TotalItems</td>
44   <td align="right">
45 #if($items.HasFirst) $PaginationHelper.CreatePageLink( 1, "first" ) #end
46 #if(!$items.HasFirst) first #end
47 #if($items.HasPrevious) | $PaginationHelper.CreatePageLink( $items.PreviousIndex, "prev" ) #end
48 #if(!$items.HasPrevious) | prev #end
49 #if($items.HasNext) | $PaginationHelper.CreatePageLink( $items.NextIndex, "next" ) #end
50 #if(!$items.HasNext) | next #end
51 #if($items.HasLast) | $PaginationHelper.CreatePageLink( $items.LastIndex, "last" ) #end
52 #if(!$items.HasLast) | last #end
53   </td>
54   </tr>
55 </table>
56 </div>
57 </div>