Further tweaks to the blame view.
[catagits/Gitalist.git] / root / blame.tt2
1 [% PROCESS 'nav/actions.tt2' object = head %]
2 [% IF object.type == 'commit' %]
3 <div class='commit-message'>
4 [% head.comment.substr(0, 85) %] ...
5 </div>
6 [% END %]
7
8 [% INCLUDE 'nav/path.tt2' %]
9
10 <div id='blame'>
11 <table>
12  <thead>
13   <tr>
14    <th>author</th>
15    <th>date</th>
16    <th>sha1</th>
17    <th></th>
18    <th class='data'>data</th>
19   </tr>
20  </thead>
21
22  <tfoot>
23   <tr>
24    <td>author</td>
25    <td>date</td>
26    <td>sha1</td>
27    <td></td>
28    <td class='data'>data</td>
29   </tr>
30  </tfoot>
31
32  <tbody>
33  [% FOR info IN blame %]
34  <tr class=''>
35    [%-
36      linecolour = info.commit.sha1.substr(0,6);
37      IF info.commit.sha1 != lastsha1;
38        styleinfo = " style='border-top: solid 3px #" _ linecolour _ ";'"; -%]
39    <td class='author'[% styleinfo %]>[% info.commit.author %]</td>
40    <td class='date'[% styleinfo %]>[% info.commit.author_dt.ymd %]</td>
41    <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>
42      [%- ELSE -%]
43      <td class='author'></td>
44      <td class='date'></td>
45      <td class='commit-info'></td>
46      [%- END -%]
47    <td class='lineno' style='border-right: solid 3px #[% linecolour %]; border-left: solid 3px #[% linecolour %];'><tt>[% info.meta.lineno %]</tt></td>
48    <td class='data'><pre>[% info.line | html %]</pre></td>
49    [% lastsha1 = info.commit.sha1 %]
50  </tr>
51  [% END %]
52  </tbody>
53 </table>
54 </div>