Hacked in syntax highlighting to the blame view.
[catagits/Gitalist.git] / root / blame.tt2
1 <link rel="stylesheet" type="text/css" href="/static/css/syntax/[% language %].css"/>
2 [% PROCESS 'nav/actions.tt2' object = head %]
3 [% IF object.type == 'commit' %]
4 <div class='commit-message'>[% short_cmt(head.comment) %]</div>
5 [% END %]
6
7 [% INCLUDE 'nav/path.tt2' %]
8
9 <div id='blame'>
10 <table>
11  <thead>
12   <tr>
13    <th>author</th>
14    <th>date</th>
15    <th>sha1</th>
16    <th></th>
17    <th class='data'>data</th>
18   </tr>
19  </thead>
20
21  <tfoot>
22   <tr>
23    <td>author</td>
24    <td>date</td>
25    <td>sha1</td>
26    <td></td>
27    <td class='data'>data</td>
28   </tr>
29  </tfoot>
30
31  <tbody>
32  [% blame_lines = blob.split("\n") %]
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>[% blame_lines.${loop.index} %]</pre></td>
49    [% lastsha1 = info.commit.sha1 %]
50  </tr>
51  [% END %]
52  </tbody>
53 </table>
54 </div>