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 entries;
17 IF item.mode != "40000";
18 tree_files.push(item);
20 tree_folders.push(item);
25 [% BLOCK output_tree %]
26 [% FOREACH item IN tree_type.sort('filename') %]
27 <tr [% "class='invert'" IF counter % 2 %]>
28 <td class='file-mode'>[% c.stash.mode_string(item.mode) %]</td>
30 action_type = item.mode == '40000' ? 'tree' : 'blob';
31 action_for_link = item.mode == '40000' ? '/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.filename))
34 <td class="file-name"><a href="[% blob_or_tree_link %]" class="[% item.mode == '40000' ? 'folder' : 'file' %]">[% item.filename %]</a></td>
35 <td class='action-list'>
36 <a href="[% blob_or_tree_link %]">[% theact %]</a>
37 [% IF item.mode != '40000' %]
38 <a href="[% c.uri_for_action('/ref/blob', c.req.captures, c.req.args.to_path(item.filename)) %]" 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.filename)) %]" 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.filename)) %]" 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.filename)) %]" title="History (Short log)" class="button shortlog">Short log</a>
44 <td class="message"><span class='js-data'>[% c.req.args.to_path(item.filename) %]</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 <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>