Adding image blob support. Fixes #13

This commit is contained in:
Klaus Silveira
2012-05-23 21:52:37 -03:00
parent 8401688386
commit c7ed3ee0d8
4 changed files with 19 additions and 0 deletions

View File

@@ -199,6 +199,16 @@ class Utils
return 'yaml'; return 'yaml';
case 'yaml': case 'yaml':
return 'yaml'; return 'yaml';
case 'png':
return 'image';
case 'jpg':
return 'image';
case 'gif':
return 'image';
case 'jpeg':
return 'image';
case 'bmp':
return 'image';
default: default:
return 'text'; return 'text';
} }

View File

@@ -33,7 +33,11 @@
<a href="{{ baseurl }}/{{ repo }}/commits/{{ branch }}/{{ file }}" class="btn btn-small"><i class="icon-list-alt"></i> History</a> <a href="{{ baseurl }}/{{ repo }}/commits/{{ branch }}/{{ file }}" class="btn btn-small"><i class="icon-list-alt"></i> History</a>
</div> </div>
</div> </div>
{% if fileType == 'image' %}
<center><img src="{{ baseurl }}/{{ repo }}/raw/{{ branch }}/{{ file }}" alt="{{ file }}" class="image-blob" /></center>
{% else %}
<textarea id="sourcecode" language="{{ fileType }}" readonly="readonly">{{ blob }}</textarea> <textarea id="sourcecode" language="{{ fileType }}" readonly="readonly">{{ blob }}</textarea>
{% endif %}
</div> </div>
<hr> <hr>

View File

@@ -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 .new{background-color:#DFD;}
.source-view .source-diff .old{background-color:#FDD;} .source-view .source-diff .old{background-color:#FDD;}
.source-view .source-diff .chunk{background-color:#e8e8e8;color:#999999;} .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{width:100%;background-color:#f5f5f5;}.blame-view td{vertical-align:top;padding:8px;}
.blame-view tr{border-bottom:1px solid #cccccc;} .blame-view tr{border-bottom:1px solid #cccccc;}
.blame-view tr:last-child{border-bottom:0;} .blame-view tr:last-child{border-bottom:0;}

View File

@@ -52,6 +52,10 @@
color:@grayLight; color:@grayLight;
} }
} }
.image-blob {
padding:10px;
max-width: 600px;
}
} }
.blame-view { .blame-view {