Commit | Line | Data |
1f9a47c2 |
1 | [% BLOCK tree_table_headfoot %] |
10938267 |
2 | [% SET cell = type == 'head' ? 'th' : 'td' %] |
0da7966e |
3 | <tr> |
eab82ed1 |
4 | <[% cell %]>Mode</[% cell %]> |
5 | <[% cell %]>File</[% cell %]> |
6 | <[% cell %]>Actions</[% cell %]> |
0da7966e |
7 | </tr> |
1f9a47c2 |
8 | [% END %] |
eab82ed1 |
9 | <table class="listing"> |
10938267 |
10 | <thead>[% PROCESS tree_table_headfoot type = 'head' %]</thead> |
0da7966e |
11 | <tbody> |
12 | [% FOREACH item IN tree_list %] |
eab82ed1 |
13 | <tr [% "class='invert'" IF loop.count % 2 %]> |
0da7966e |
14 | <td class='file-mode'>[% item.modestr %]</td> |
1f9a47c2 |
15 | [%- |
16 | action_type = item.type == 'tree' ? 'tree' : 'blob'; |
2980657b |
17 | action_for_link = item.type == 'tree' ? '/ref/tree' : '/ref/blob'; |
ca06a177 |
18 | blob_or_tree_link = c.uri_for_action(action_for_link, c.req.captures, c.req.args.to_path(item.file)) |
1f9a47c2 |
19 | -%] |
0da7966e |
20 | <td class='file-name'> |
1f9a47c2 |
21 | <a href="[% blob_or_tree_link %]">[% item.file %]</a> |
0da7966e |
22 | </td> |
23 | <td class='action-list'> |
eab82ed1 |
24 | <a href="[% blob_or_tree_link %]">[% theact %]</a> |
0da7966e |
25 | [% IF item.type == 'blob' %] |
eab82ed1 |
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> |
0da7966e |
29 | [% END %] |
08d8bb08 |
30 | <a href="[% c.uri_for_action('/ref/history', c.req.captures, c.req.args.to_path(item.file)) %]" title="History (Short log)" class="button shortlog">Short log</a> |
0da7966e |
31 | </td> |
32 | </tr> |
33 | [% END %] |
34 | </tbody> |
35 | </table> |