Have linenumbers in blob displays
[catagits/Gitalist.git] / root / fragment / ref / blob.tt2
index cb6097a..f527abb 100644 (file)
@@ -3,7 +3,14 @@
 [%- ELSIF is_binary -%]
 <div class='blob'>This is a binary file which won't render natively on the web, but you can get it here all the same: <a href="[% c.uri_for_action('/ref/raw', c.req.captures, filename) %]" title="[% filename %]">[% filename %]</a></div>
 [%- ELSE -%]
-[%- INCLUDE inc/syntax_highlight_css.tt2 -%]
 [%- USE UTF8Decode -%]
-<pre class='blob'>[% IF mangled; blob; ELSE; blob | utf8_decode | html; END; %]</pre>
+[%- IF mangled; INCLUDE inc/syntax_highlight_css.tt2; END -%]
+[% FOR line IN blob.split("\n") %]
+ <tr class=''>
+   <td nowrap class='lineno' id='l[% loop.index+1 %]'><tt><a href='[% c.uri_for_action('/ref/blame', [Repository.name, info.commit.sha1], filename.to_path ) %]#l[% lopo.index %]'>[% loop.index+1 %]</a></tt></td>
+   <td nowrap class='data'><pre>[%-
+     IF mangled; line; ELSE; line | utf8_decode | html; END
+   -%]</pre></td>
+ </tr>
+[% END %]
 [%- END -%]