Switch to using 960.gs grids for layout.
[catagits/Gitalist.git] / root / fragment / ref / tree.tt2
1 [% BLOCK tree_table_headfoot %]
2 [% SET cell = type == 'head' ? 'th' : 'td' %]
3   <tr>
4    <[% cell %]>mode</[% cell %]>
5    <[% cell %]>file</[% cell %]>
6    <[% cell %]>actions</[% cell %]>
7   </tr>
8 [% END %]
9 <table class='tree listing'>
10  <thead>[% PROCESS tree_table_headfoot type = 'head' %]</thead>
11  <tfoot>[% PROCESS tree_table_headfoot type = 'foot' %]</tfoot>
12
13  <tbody>
14   [% FOREACH item IN tree_list %]
15   <tr>
16    <td class='file-mode'>[% item.modestr %]</td>
17    [%-
18         action_type = item.type == 'tree' ? 'tree' : 'blob';
19         action_for_link = item.type == 'tree' ? '/ref/tree' : '/ref/blob';
20         blob_or_tree_link = c.uri_for_action(action_for_link, c.req.captures, c.req.args.to_path(item.file))
21    -%]
22    <td class='file-name'>
23     <a href="[% blob_or_tree_link %]">[% item.file %]</a>
24    </td>
25    <td class='action-list'>
26      <a href="[% blob_or_tree_link %]">[% theact %]</a>
27           [% IF item.type == 'blob' %]
28           <a href="[% c.uri_for_action('/ref/blob', c.req.captures, c.req.args.to_path(item.file)) %]">blob</a>
29           <a href="[% c.uri_for_action('/ref/blame', c.req.captures, c.req.args.to_path(item.file)) %]">blame</a>
30           [% END %]
31      <a href="[% c.uri_for_action('/ref/history', c.req.captures, c.req.args.to_path(item.file)) %]">history</a>
32      [% IF item.type == 'blob' %]
33      <a href="[% c.uri_for_action('/ref/raw', c.req.captures, c.req.args.to_path(item.file)) %]">raw</a>
34      [% END %]
35    </td>
36   </tr>
37   [% END %]
38  </tbody>
39 </table>