1 [% BLOCK tree_table_headfoot %]
2 [% SET cell = type == 'head' ? 'th' : 'td' %]
4 <[% cell %]>Mode</[% cell %]>
5 <[% cell %]>Folder / File</[% cell %]>
6 <[% cell %]>Actions</[% cell %]>
7 <[% cell %]>Message</[% cell %]>
13 # sort files and folders
15 SET tree_folders = [];
16 FOREACH item IN tree_list;
17 IF item.type == "blob";
18 tree_files.push(item);
20 tree_folders.push(item);
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>
30 action_type = item.type == 'tree' ? 'tree' : 'blob';
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))
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'>
36 <a href="[% blob_or_tree_link %]">[% theact %]</a>
37 [% IF item.type == 'blob' %]
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>
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>
44 <td class="message"><span class='js-data'>[% c.req.args.to_path(item.file) %]</span>Loading commit info ...</td>
46 [% counter = counter + 1 %]
50 <table class="listing" id="commit-tree">
51 <thead>[% PROCESS tree_table_headfoot type = 'head' %]</thead>
53 [% INCLUDE output_tree tree_type => tree_folders %]
54 [% PROCESS output_tree tree_type => tree_files %]
58 [%- # We use uri_for instead of uri_for_action as we *want* a /fragment URI in this case %]
59 <span id='file_commit_info-uri' class='js-data'>[% c.uri_for('/fragment/' _ Repository.name _ '/' _ Commit.sha1 _ '/file_commit_info') %]</span>
60 <span id='commit-uri' class='js-data'>[% c.uri_for_action('/ref/commit', [Repository.name, 'HEAD']) %]</span>