Further tweaks to the blame view.
Dan Brook [Wed, 25 Nov 2009 13:55:41 +0000 (13:55 +0000)]
root/blame.tt2
root/static/css/site.css

index 8085162..685867d 100644 (file)
@@ -11,9 +11,9 @@
 <table>
  <thead>
   <tr>
-   <th>sha1</th>
    <th>author</th>
    <th>date</th>
+   <th>sha1</th>
    <th></th>
    <th class='data'>data</th>
   </tr>
@@ -21,9 +21,9 @@
 
  <tfoot>
   <tr>
-   <td>sha1</td>
    <td>author</td>
    <td>date</td>
+   <td>sha1</td>
    <td></td>
    <td class='data'>data</td>
   </tr>
  <tbody>
  [% FOR info IN blame %]
  <tr class=''>
-   <td class='commit-info'><a title="[% info.commit.author %] on [% info.commit.author_dt %]" href='[% c.uri_for('commit', {h=info.commit.sha1}) %]'>[% INCLUDE '_chroma_hash.tt2' sha1 = info.commit.sha1.substr(0,7) -%]</a></td>
-   <td class='author'>[% info.commit.author %]</td>
-   <td class='date'>[% info.commit.author_dt.ymd %]</td>
-   <td class='lineno'><tt>[% info.meta.lineno %]</tt></td>
+   [%-
+     linecolour = info.commit.sha1.substr(0,6);
+     IF info.commit.sha1 != lastsha1;
+       styleinfo = " style='border-top: solid 3px #" _ linecolour _ ";'"; -%]
+   <td class='author'[% styleinfo %]>[% info.commit.author %]</td>
+   <td class='date'[% styleinfo %]>[% info.commit.author_dt.ymd %]</td>
+   <td class='commit-info chroma-hash'[% styleinfo %]><a title="[% info.commit.author %] on [% info.commit.author_dt %]" href='[% c.uri_for('commit', {h=info.commit.sha1}) %]'>[% linecolour %]</td>
+     [%- ELSE -%]
+     <td class='author'></td>
+     <td class='date'></td>
+     <td class='commit-info'></td>
+     [%- END -%]
+   <td class='lineno' style='border-right: solid 3px #[% linecolour %]; border-left: solid 3px #[% linecolour %];'><tt>[% info.meta.lineno %]</tt></td>
    <td class='data'><pre>[% info.line | html %]</pre></td>
+   [% lastsha1 = info.commit.sha1 %]
  </tr>
  [% END %]
  </tbody>
index c53694a..a4ed860 100644 (file)
@@ -26,7 +26,7 @@ tfoot td {
   background-color: #fefeaa;
 }
 
-span.chroma-hash {
+.chroma-hash {
   font-family: monospace;
   font-size:   1em;
   font-style: normal;
@@ -167,7 +167,7 @@ table.heads {
 /*#blame td { border: solid 1px black; }*/
 #blame td.lineno {
   width: 2%;
-  background-color: #ddd;
+  background-color: #eee;
 }
 #blame td.date {
   width: 7%;
@@ -176,7 +176,7 @@ table.heads {
   width: 10%;
 }
 #blame td.commit-info {
-  width: 5%;
+  width: 4%;
 }
 #blame .data {
   padding-left: 5px;