--- /dev/null
+[% BLOCK tree_table_headfoot %]
+ <tr>
+ <th>mode</th>
+ <th>file</th>
+ <th>actions</th>
+ </tr>
+[% END %]
+<table class='tree listing'>
+ <thead>
+ [% PROCESS tree_table_headfoot %]
+ </thead>
+ <tfoot>
+ [% PROCESS tree_table_headfoot %]
+ </tfoot>
+
+ <tbody>
+ [% FOREACH item IN tree_list %]
+ <tr>
+ <td class='file-mode'>[% item.modestr %]</td>
+ [%-
+ action_type = item.type == 'tree' ? 'tree' : 'blob';
+ action_for_link = item.type == 'tree' ? '/ref/tree' : '/ref/blob';
+ blob_or_tree_link = c.uri_for_action(action_for_link, c.req.captures, c.req.args.to_path(item.file))
+ -%]
+ <td class='file-name'>
+ <a href="[% blob_or_tree_link %]">[% item.file %]</a>
+ </td>
+ <td class='action-list'>
+ <a href="[% blob_or_tree_link %]">[% theact %]</a>
+ [% IF item.type == 'blob' %]
+ <a href="[% c.uri_for_action('/ref/blob', c.req.captures, c.req.args.to_path(item.file)) %]">blob</a>
+ <a href="[% c.uri_for_action('/ref/blame', c.req.captures, c.req.args.to_path(item.file)) %]">blame</a>
+ [% END %]
+ <a href="[% c.uri_for_action('/ref/history', c.req.captures, c.req.args.to_path(item.file)) %]">history</a>
+ [% IF item.type == 'blob' %]
+ <a href="[% c.uri_for_action('/ref/raw', c.req.captures, c.req.args.to_path(item.file)) %]">raw</a>
+ [% END %]
+ </td>
+ </tr>
+ [% END %]
+ </tbody>
+</table>