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