Have linenumbers in blob displays
[catagits/Gitalist.git] / root / fragment / ref / blob.tt2
index 592f8c5..f527abb 100644 (file)
@@ -1 +1,16 @@
-[% blob %]
+[%- IF is_image -%]
+<div class='blob'><img src="[% c.uri_for_action('/ref/raw', c.req.captures, filename) %]" title="[% filename %]"></div>
+[%- 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 -%]
+[%- USE UTF8Decode -%]
+[%- 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 -%]