summaryrefslogtreecommitdiffstats
path: root/templates/repo/view_file.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'templates/repo/view_file.tmpl')
-rw-r--r--templates/repo/view_file.tmpl8
1 files changed, 8 insertions, 0 deletions
diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl
index be54419404..fb05945b9f 100644
--- a/templates/repo/view_file.tmpl
+++ b/templates/repo/view_file.tmpl
@@ -15,6 +15,14 @@
<div class="{{if .ReadmeExist}}panel-content markdown{{end}} code-view">
{{if .ReadmeExist}}
{{.FileContent | Str2html}}
+ {{else if not .IsFileText}}
+ <div class="view-raw">
+ {{if .IsImageFile}}
+ <img src="{{.FileLink}}">
+ {{else}}
+ <a href="{{.FileLink}}" rel="nofollow" class="btn btn-gray btn-radius">View Raw</a>
+ {{end}}
+ </div>
{{else if .FileSize}}
<table>
<tbody>