summaryrefslogtreecommitdiffstats
path: root/templates/repo
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-07-26 18:37:18 -0400
committerUnknwon <joe2010xtmf@163.com>2014-07-26 18:37:18 -0400
commit5e8138341357f367868a32b631495c9d5a286477 (patch)
treefb36040422534e051ac381cde594ff1a208e4195 /templates/repo
parent02a81ddb6252d1a08900d548ddb63e41bcb0b8ef (diff)
downloadgitea-5e8138341357f367868a32b631495c9d5a286477.tar.gz
gitea-5e8138341357f367868a32b631495c9d5a286477.zip
Git installation check, show image in single file view, show short SHA1 instead of 40-length string, complete log module
Diffstat (limited to 'templates/repo')
-rw-r--r--templates/repo/home.tmpl6
-rw-r--r--templates/repo/view_file.tmpl8
2 files changed, 11 insertions, 3 deletions
diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl
index 1958c40998..5f16a7baf0 100644
--- a/templates/repo/home.tmpl
+++ b/templates/repo/home.tmpl
@@ -74,7 +74,7 @@
<a href="#">
<button class="btn btn-gray btn-small btn-radius">
<i class="octicon octicon-git-branch"></i> Branch :
- <strong id="repo-branch-current">{{.BranchName}}</strong>
+ <strong id="repo-branch-current">{{if .IsViewBranch}}{{.BranchName}}{{else}}{{ShortSha .BranchName}}{{end}}</strong>
</button>
</a>
<div class="drop-down panel">
@@ -87,7 +87,7 @@
</ul>
<ul class="menu menu-vertical switching-list" id="repo-branch-list">
{{range .Branches}}
- <li {{if eq . $.BranchName}}class="checked"{{end}}><a href="{{$.RepoLink}}/src/{{.}}"><i class="octicon octicon-check"></i>master</a></li>
+ <li {{if eq . $.BranchName}}class="checked"{{end}}><a href="{{$.RepoLink}}/src/{{.}}"><i class="octicon octicon-check"></i>{{.}}</a></li>
{{end}}
</ul>
<ul class="menu menu-vertical switching-list" id="repo-tag-list">
@@ -137,7 +137,7 @@
<a class="radius" href="{{.RepoLink}}/pulls"><i class="octicon octicon-git-pull-request"></i>Pull Requests<span class="num right label label-blue label-radius">{{.Repository.NumOpenPulls}}</span></a>
</li>
<li class="border-bottom"></li>
- <li class="head">{{.BranchName}}</li>
+ <li class="head">{{if .IsViewBranch}}{{.BranchName}}{{else}}{{ShortSha .BranchName}}{{end}}</li>
<li>
<a class="radius" href="{{.RepoLink}}/commits/{{.BranchName}}"><i class="octicon octicon-history"></i>Commits <span class="num right label label-gray label-radius">{{.CommitsCount}}</span></a>
</li>
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>