From c7ed3ee0d8e12ba03c337c277be0a15f830fdde7 Mon Sep 17 00:00:00 2001 From: Klaus Silveira Date: Wed, 23 May 2012 21:52:37 -0300 Subject: [PATCH] Adding image blob support. Fixes #13 --- lib/Application/Utils.php | 10 ++++++++++ views/file.twig | 4 ++++ web/css/style.css | 1 + web/less/files.less | 4 ++++ 4 files changed, 19 insertions(+) diff --git a/lib/Application/Utils.php b/lib/Application/Utils.php index 25e9c4b..f844e6d 100644 --- a/lib/Application/Utils.php +++ b/lib/Application/Utils.php @@ -199,6 +199,16 @@ class Utils return 'yaml'; case 'yaml': return 'yaml'; + case 'png': + return 'image'; + case 'jpg': + return 'image'; + case 'gif': + return 'image'; + case 'jpeg': + return 'image'; + case 'bmp': + return 'image'; default: return 'text'; } diff --git a/views/file.twig b/views/file.twig index 752e008..dd3ecbc 100644 --- a/views/file.twig +++ b/views/file.twig @@ -33,7 +33,11 @@ History + {% if fileType == 'image' %} +
{{ file }}
+ {% else %} + {% endif %}
diff --git a/web/css/style.css b/web/css/style.css index 3d2cb08..47dea85 100644 --- a/web/css/style.css +++ b/web/css/style.css @@ -258,6 +258,7 @@ table .span24{float:none;width:1884px;margin-left:0;} .source-view .source-diff .new{background-color:#DFD;} .source-view .source-diff .old{background-color:#FDD;} .source-view .source-diff .chunk{background-color:#e8e8e8;color:#999999;} +.source-view .image-blob{padding:10px;max-width:600px;} .blame-view{width:100%;background-color:#f5f5f5;}.blame-view td{vertical-align:top;padding:8px;} .blame-view tr{border-bottom:1px solid #cccccc;} .blame-view tr:last-child{border-bottom:0;} diff --git a/web/less/files.less b/web/less/files.less index 1335516..20d45b9 100644 --- a/web/less/files.less +++ b/web/less/files.less @@ -52,6 +52,10 @@ color:@grayLight; } } + .image-blob { + padding:10px; + max-width: 600px; + } } .blame-view {