Commit | Line | Data |
1f9a47c2 |
1 | [% BLOCK tree_table_headfoot %] |
0da7966e |
2 | <tr> |
3 | <th>mode</th> |
4 | <th>file</th> |
5 | <th>actions</th> |
6 | </tr> |
1f9a47c2 |
7 | [% END %] |
8 | <table class='tree listing'> |
9 | <thead> |
10 | [% PROCESS tree_table_headfoot %] |
0da7966e |
11 | </thead> |
12 | <tfoot> |
1f9a47c2 |
13 | [% PROCESS tree_table_headfoot %] |
0da7966e |
14 | </tfoot> |
15 | |
16 | <tbody> |
17 | [% FOREACH item IN tree_list %] |
18 | <tr> |
19 | <td class='file-mode'>[% item.modestr %]</td> |
1f9a47c2 |
20 | [%- |
21 | action_type = item.type == 'tree' ? 'tree' : 'blob'; |
22 | action_for_link = item.type == 'tree' ? c.action : c.controller.action_for('blob'); |
23 | blob_or_tree_link = c.uri_for(action_for_link, c.req.captures, c.req.args.to_path(item.file)) |
24 | -%] |
0da7966e |
25 | <td class='file-name'> |
1f9a47c2 |
26 | <a href="[% blob_or_tree_link %]">[% item.file %]</a> |
0da7966e |
27 | </td> |
28 | <td class='action-list'> |
1f9a47c2 |
29 | <a href="[% blob_or_tree_link %]">[% theact %]</a> |
0da7966e |
30 | [% IF item.type == 'blob' %] |
1f9a47c2 |
31 | <a href="[% c.uri_for(c.controller.action_for('blame'), c.req.captures, c.req.args.to_path(item.file)) %]">blame</a> |
0da7966e |
32 | [% END %] |
1f9a47c2 |
33 | <a href="[% c.uri_for(c.controller.action_for('history'), c.req.captures, c.req.args.to_path(item.file)) %]">history</a> |
0da7966e |
34 | [% IF item.type == 'blob' %] |
1f9a47c2 |
35 | <a href="[% c.uri_for(c.controller.action_for('raw'), c.req.captures, c.req.args.to_path(item.file)) %]">raw</a> |
0da7966e |
36 | [% END %] |
37 | </td> |
38 | </tr> |
39 | [% END %] |
40 | </tbody> |
41 | </table> |