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 %]> |
97bdf7bc |
5 | <[% cell %]>Folder / File</[% cell %]> |
eab82ed1 |
6 | <[% cell %]>Actions</[% cell %]> |
5dc23a14 |
7 | <[% cell %]>Message</[% cell %]> |
0da7966e |
8 | </tr> |
1f9a47c2 |
9 | [% END %] |
97bdf7bc |
10 | [%- |
11 | SET counter = 1; |
12 | |
13 | # sort files and folders |
14 | SET tree_files = []; |
15 | SET tree_folders = []; |
16 | FOREACH item IN tree_list; |
17 | IF item.type == "blob"; |
18 | tree_files.push(item); |
19 | ELSE; |
20 | tree_folders.push(item); |
21 | END; |
22 | END; |
23 | %] |
24 | |
25 | [% BLOCK output_tree %] |
26 | [% FOREACH item IN tree_type.sort('file') %] |
27 | <tr [% "class='invert'" IF counter % 2 %]> |
28 | <td class='file-mode'>[% item.modestr %]</td> |
29 | [%- |
feb6e881 |
30 | action_type = item.type == 'tree' ? 'tree' : 'blob'; |
97bdf7bc |
31 | action_for_link = item.type == 'tree' ? '/ref/tree' : '/ref/blob'; |
32 | blob_or_tree_link = c.uri_for_action(action_for_link, c.req.captures, c.req.args.to_path(item.file)) |
33 | -%] |
34 | <td class="file-name"><a href="[% blob_or_tree_link %]" class="[% item.type == 'blob' ? 'file' : 'folder' %]">[% item.file %]</a></td> |
35 | <td class='action-list'> |
eab82ed1 |
36 | <a href="[% blob_or_tree_link %]">[% theact %]</a> |
0da7966e |
37 | [% IF item.type == 'blob' %] |
eab82ed1 |
38 | <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> |
39 | <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> |
40 | <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 |
41 | [% END %] |
97bdf7bc |
42 | <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> |
43 | </td> |
feb6e881 |
44 | <td class="message"><span class='js-data'>[% c.req.args.to_path(item.file) %]</span>Loading commit info ...</td> |
97bdf7bc |
45 | </tr> |
46 | [% counter = counter + 1 %] |
47 | [% END %] |
48 | [% END %] |
49 | |
5dc23a14 |
50 | <table class="listing" id="commit-tree"> |
97bdf7bc |
51 | <thead>[% PROCESS tree_table_headfoot type = 'head' %]</thead> |
52 | <tbody> |
53 | [% INCLUDE output_tree tree_type => tree_folders %] |
54 | [% PROCESS output_tree tree_type => tree_files %] |
55 | </tbody> |
0da7966e |
56 | </table> |
feb6e881 |
57 | |
4a0a2afa |
58 | <span id='file_commit_info-uri' class='js-data'>[% c.uri_for_action('/fragment/ref/file_commit_info', [ Repository.name, Commit.sha1 ]) %]</span> |
59 | <span id='commit-uri' class='js-data'>[% c.uri_for_action('/ref/commit', [Repository.name, 'HEAD']) %]</span> |