more design changes
[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="listing">
10  <thead>[% PROCESS tree_table_headfoot type = 'head' %]</thead>
11  <tbody>
12   [% FOREACH item IN tree_list %]
13  <tr [% "class='invert'" IF loop.count % 2 %]>
14    <td class='file-mode'>[% item.modestr %]</td>
15    [%-
16         action_type = item.type == 'tree' ? 'tree' : 'blob';
17         action_for_link = item.type == 'tree' ? '/ref/tree' : '/ref/blob';
18         blob_or_tree_link = c.uri_for_action(action_for_link, c.req.captures, c.req.args.to_path(item.file))
19    -%]
20    <td class='file-name'>
21     <a href="[% blob_or_tree_link %]">[% item.file %]</a>
22    </td>
23    <td class='action-list'>
24         <a href="[% blob_or_tree_link %]">[% theact %]</a>
25           [% IF item.type == 'blob' %]
26         <a href="[% c.uri_for_action('/ref/blob', c.req.captures, c.req.args.to_path(item.file)) %]" title="Blob" class="button blob">Blob</a>
27         <a href="[% c.uri_for_action('/ref/raw', c.req.captures, c.req.args.to_path(item.file)) %]" title="Raw" class="button raw">raw</a>
28         <a href="[% c.uri_for_action('/ref/blame', c.req.captures, c.req.args.to_path(item.file)) %]" title="Blame" class="button blame">blame</a>
29           [% END %]
30      <a href="[% c.uri_for_action('/ref/history', c.req.captures, c.req.args.to_path(item.file)) %]" title="Short log" class="button shortlog">Short log</a>
31    </td>
32   </tr>
33   [% END %]
34  </tbody>
35 </table>