more design changes
[catagits/Gitalist.git] / root / _tree.tt2
index 78c9b01..6a96cda 100644 (file)
@@ -1,34 +1,39 @@
-<table>
+<table class='tree listing'>
  <thead>
   <tr>
+   <th>mode</th>
+   <th>file</th>
+   <th>actions</th>
+  </tr>
+ </thead>
+ <tfoot>
+  <tr>
    <td>mode</td>
    <td>file</td>
    <td>actions</td>
   </tr>
- </thead>
+ </tfoot>
 
  <tbody>
   [% FOREACH item IN tree_list %]
   <tr>
-   <td>[% item.modestr %]</td>
+   <td class='file-mode'>[% item.modestr %]</td>
    [% theact = item.type == 'tree' ? 'tree' : 'blob' -%]
-   <td class='filename'>
-    <a href="[% c.uri_for(theact, {h=item.object, hb=commit.sha1, f=(path ? path _ '/' _ item.file : item.file)}) %]">[% item.file %]</a>
+   [% fullpath = path ? path _ '/' _ item.file : item.file %]
+   <td class='file-name'>
+    <a href="[% c.uri_for(theact, {h=item.sha1, hb=commit.sha1, f=fullpath}) %]">[% item.file %]</a>
    </td>
    <td class='action-list'>
-     <a href="[% c.uri_for(theact, {h=item.object, hb=commit.sha1, f=item.file}) %]">[% theact %]</a>
-     <a href="[% c.uri_for('history', {h=item.object}) %]">history</a>
-     <a href="[% c.uri_for('raw', {h=item.object}) %]">raw</a>
+     <a href="[% c.uri_for(theact, {h=item.sha1, hb=commit.sha1, f=fullpath}) %]">[% theact %]</a>
+         [% IF item.type == 'blob' %]
+         <a href="[% c.uri_for('blame', {h=commit.sha1, hb=commit.sha1, f=fullpath}) %]">blame</a>
+         [% END %]
+     <a href="[% c.uri_for('history', {h=item.sha1, hb=commit.sha1, f=fullpath}) %]">history</a>
+     [% IF item.type == 'blob' %]
+     <a href="[% c.uri_for('raw', {hb=commit.sha1, f=fullpath}) %]">raw</a>
+     [% END %]
    </td>
   </tr>
   [% END %]
  </tbody>
-
- <tfoot>
-  <tr>
-   <td>mode</td>
-   <td>file</td>
-   <td>actions</td>
-  </tr>
- </tfoot>
 </table>