mirror of
https://github.com/klaussilveira/gitlist.git
synced 2025-11-17 19:20:56 +01:00
Adding image blob support. Fixes #13
This commit is contained in:
@@ -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';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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;}
|
||||||
|
|||||||
@@ -52,6 +52,10 @@
|
|||||||
color:@grayLight;
|
color:@grayLight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.image-blob {
|
||||||
|
padding:10px;
|
||||||
|
max-width: 600px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.blame-view {
|
.blame-view {
|
||||||
|
|||||||
Reference in New Issue
Block a user