diff options
author | slene <vslene@gmail.com> | 2014-03-28 01:17:09 +0800 |
---|---|---|
committer | slene <vslene@gmail.com> | 2014-03-28 01:17:09 +0800 |
commit | 6b43067e1be051e8cd353d332d61613e18ad11f4 (patch) | |
tree | c63a036f3ec401f51143c602b2ab824eb55617d3 /templates/repo | |
parent | 06d3c87b23383899c476fd6e0330e4169b33a76d (diff) | |
download | gitea-6b43067e1be051e8cd353d332d61613e18ad11f4.tar.gz gitea-6b43067e1be051e8cd353d332d61613e18ad11f4.zip |
image display in diff page
Diffstat (limited to 'templates/repo')
-rw-r--r-- | templates/repo/diff.tmpl | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/templates/repo/diff.tmpl b/templates/repo/diff.tmpl index 809a4873c3..e58f2d664e 100644 --- a/templates/repo/diff.tmpl +++ b/templates/repo/diff.tmpl @@ -60,7 +60,13 @@ <a class="btn btn-default btn-sm pull-right" href="{{$.SourcePath}}/{{.Name}}">View File</a> <span class="file">{{.Name}}</span> </div> + {{$isImage := (call $.IsImageFile .Name)}} <div class="panel-body file-body file-code code-view code-diff"> + {{if $isImage}} + <div class="text-center"> + <img src="{{$.RawPath}}/{{.Name}}"> + </div> + {{else}} <table> <tbody> {{range .Sections}} @@ -201,6 +207,7 @@ </tr> --> </tbody> </table> + {{end}} </div> </div> {{end}} |