major design changes - almost there
[catagits/Gitalist.git] / root / _tree.tt2
index 6aa70a1..6a96cda 100644 (file)
@@ -1,4 +1,4 @@
-<table>
+<table class='tree listing'>
  <thead>
   <tr>
    <th>mode</th>
  <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.sha1, 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 %]