added file and folder icons to tree view and updated favicon
[catagits/Gitalist.git] / root / fragment / ref / tree.tt2
1 [% BLOCK tree_table_headfoot %]
2 [% SET cell = type == 'head' ? 'th' : 'td' %]
3   <tr>
4    <[% cell %]>Mode</[% cell %]>
5    <[% cell %]>Folder / File</[% cell %]>
6    <[% cell %]>Actions</[% cell %]>
7   </tr>
8 [% END %]
9
10
11
12 [%-
13         SET counter         = 1;
14         
15         # sort files and folders
16         SET tree_files          = [];
17         SET tree_folders        = [];
18         FOREACH item IN tree_list;
19                 IF item.type == "blob";
20                         tree_files.push(item);
21                 ELSE;
22                         tree_folders.push(item);
23                 END;
24         END;
25 %]
26
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>
31           [%-
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))
35           -%]
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>
43           [% END %]
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>
45                 </td>
46         </tr>
47                 [% counter = counter + 1 %]
48         [% END %]
49 [% END %]
50
51
52
53
54 <table class="listing">
55 <thead>[% PROCESS tree_table_headfoot type = 'head' %]</thead>
56 <tbody>
57         [% INCLUDE output_tree tree_type => tree_folders %]
58         [% PROCESS output_tree tree_type => tree_files   %]
59 </tbody>
60 </table>