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