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 %]>
15 # sort files and folders
17 SET tree_folders = [];
18 FOREACH item IN tree_list;
19 IF item.type == "blob";
20 tree_files.push(item);
22 tree_folders.push(item);
27 [% BLOCK output_tree %]
28 [% FOREACH item IN tree_type.sort('file') %]
29 <tr [% "class='invert'" IF counter % 2 %]>
30 <td class='file-mode'>[% item.modestr %]</td>
32 action_type = item.type == 'tree' ? 'tree' : 'blob';
33 action_for_link = item.type == 'tree' ? '/ref/tree' : '/ref/blob';
34 blob_or_tree_link = c.uri_for_action(action_for_link, c.req.captures, c.req.args.to_path(item.file))
36 <td class="file-name"><a href="[% blob_or_tree_link %]" class="[% item.type == 'blob' ? 'file' : 'folder' %]">[% item.file %]</a></td>
37 <td class='action-list'>
38 <a href="[% blob_or_tree_link %]">[% theact %]</a>
39 [% IF item.type == 'blob' %]
40 <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>
41 <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>
42 <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>
44 <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>
47 [% counter = counter + 1 %]
54 <table class="listing">
55 <thead>[% PROCESS tree_table_headfoot type = 'head' %]</thead>
57 [% INCLUDE output_tree tree_type => tree_folders %]
58 [% PROCESS output_tree tree_type => tree_files %]