summaryrefslogtreecommitdiffstats
path: root/templates/repo/view_file.tmpl
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-08-30 02:08:38 -0700
committerUnknwon <u@gogs.io>2016-08-30 02:08:38 -0700
commit780cc2d11093e048e41f2d6da9d76f6c6ac4a5e2 (patch)
tree1657d9fecdcf70d4e0067724344f531d608efb71 /templates/repo/view_file.tmpl
parent2a13f682e0fa039a610e7817495d87685f9632f2 (diff)
downloadgitea-780cc2d11093e048e41f2d6da9d76f6c6ac4a5e2.tar.gz
gitea-780cc2d11093e048e41f2d6da9d76f6c6ac4a5e2.zip
router/repo: code refactoring
Diffstat (limited to 'templates/repo/view_file.tmpl')
-rw-r--r--templates/repo/view_file.tmpl12
1 files changed, 6 insertions, 6 deletions
diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl
index d0b793b0e7..68e8444768 100644
--- a/templates/repo/view_file.tmpl
+++ b/templates/repo/view_file.tmpl
@@ -18,7 +18,7 @@
<a class="ui button" href="{{.RepoLink}}/src/{{.CommitID}}/{{EscapePound .TreePath}}">{{.i18n.Tr "repo.file_permalink"}}</a>
{{end}}
<a class="ui button" href="{{.RepoLink}}/commits/{{EscapePound .BranchName}}/{{EscapePound .TreePath}}">{{.i18n.Tr "repo.file_history"}}</a>
- <a class="ui button" href="{{EscapePound .FileLink}}">{{.i18n.Tr "repo.file_raw"}}</a>
+ <a class="ui button" href="{{EscapePound $.RawFileLink}}">{{.i18n.Tr "repo.file_raw"}}</a>
</div>
{{if .Repository.CanEnableEditor}}
{{if .CanEditFile}}
@@ -36,17 +36,17 @@
{{end}}
</h4>
<div class="ui attached table segment">
- <div class="file-view {{if .IsMarkdown}}markdown{{else if .IsFileText}}code-view{{end}} has-emoji">
+ <div class="file-view {{if .IsMarkdown}}markdown{{else if .IsTextFile}}code-view{{end}} has-emoji">
{{if .IsMarkdown}}
{{if .FileContent}}{{.FileContent | Str2html}}{{end}}
- {{else if not .IsFileText}}
+ {{else if not .IsTextFile}}
<div class="view-raw ui center">
{{if .IsImageFile}}
- <img src="{{EscapePound .FileLink}}">
+ <img src="{{EscapePound $.RawFileLink}}">
{{else if .IsPDFFile}}
- <iframe width="100%" height="600px" src="{{AppSubUrl}}/plugins/pdfjs-1.4.20/web/viewer.html?file={{EscapePound .FileLink}}"></iframe>
+ <iframe width="100%" height="600px" src="{{AppSubUrl}}/plugins/pdfjs-1.4.20/web/viewer.html?file={{EscapePound $.RawFileLink}}"></iframe>
{{else}}
- <a href="{{EscapePound $.FileLink}}" rel="nofollow" class="btn btn-gray btn-radius">{{.i18n.Tr "repo.file_view_raw"}}</a>
+ <a href="{{EscapePound $.RawFileLink}}" rel="nofollow" class="btn btn-gray btn-radius">{{.i18n.Tr "repo.file_view_raw"}}</a>
{{end}}
</div>
{{else if .FileSize}}