Implemented necessary functionality so binary files no longer render literally.
[catagits/Gitalist.git] / root / fragment / ref / blob.tt2
index 592f8c5..aaaa65d 100644 (file)
@@ -1 +1,7 @@
-[% 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 -%]
+<pre class='blob'>[% blob | html %]</pre>
+[%- END -%]