summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-23 06:34:41 -0400
committerUnknown <joe2010xtmf@163.com>2014-03-23 06:34:41 -0400
commitc386bb4bd314843a532012877e148ae70ee44672 (patch)
treedc506e4a3660e4581a2bfe1376fb67bd0cb37f3d
parent1eb078d0a8c5424de9512d810ab2fbf21f59ff78 (diff)
downloadgitea-c386bb4bd314843a532012877e148ae70ee44672.tar.gz
gitea-c386bb4bd314843a532012877e148ae70ee44672.zip
Bug fix
-rw-r--r--modules/base/tool.go11
-rw-r--r--templates/repo/nav.tmpl2
2 files changed, 4 insertions, 9 deletions
diff --git a/modules/base/tool.go b/modules/base/tool.go
index edf7a953c9..b48566f542 100644
--- a/modules/base/tool.go
+++ b/modules/base/tool.go
@@ -515,16 +515,11 @@ func ActionDesc(act Actioner, avatarLink string) string {
return err.Error()
}
buf := bytes.NewBuffer([]byte("\n"))
- max := 3
- count := len(push.Commits)
- if count < max {
- max = count
- }
- for _, commit := range push.Commits[:max] {
+ for _, commit := range push.Commits {
buf.WriteString(fmt.Sprintf(TPL_COMMIT_REPO_LI, avatarLink, actUserName, repoName, commit[0], commit[0][:7], commit[1]) + "\n")
}
- if count > max {
- buf.WriteString(fmt.Sprintf(`<div><a href="/%s/%s/commits">%d other commits >></a></div>`, actUserName, repoName, count-max))
+ if push.Len > 3 {
+ buf.WriteString(fmt.Sprintf(`<div><a href="/%s/%s/commits">%d other commits >></a></div>`, actUserName, repoName, push.Len))
}
return fmt.Sprintf(TPL_COMMIT_REPO, actUserName, actUserName, actUserName, repoName, branch, branch, actUserName, repoName, actUserName, repoName,
buf.String())
diff --git a/templates/repo/nav.tmpl b/templates/repo/nav.tmpl
index b2d3500f92..a3358fd890 100644
--- a/templates/repo/nav.tmpl
+++ b/templates/repo/nav.tmpl
@@ -32,7 +32,7 @@
<p class="help-block text-center">Need help cloning? Visit <a href="#">Help</a>!</p>
</div>
</div>
- <div class="btn-group {{if .IsRepositoryWatching}}watching{{else}}no-watching{{end}}" id="gogs-repo-watching" data-watch="/{{.SignedUser.Name}}/{{.Repository.Name}}/action/watch" data-unwatch="/{{.SignedUser.Name}}/{{.Repository.Name}}/action/unwatch">
+ <div class="btn-group {{if .IsRepositoryWatching}}watching{{else}}no-watching{{end}}" id="gogs-repo-watching" data-watch="/{{.Owner.Name}}/{{.Repository.Name}}/action/watch" data-unwatch="/{{.Owner.Name}}/{{.Repository.Name}}/action/unwatch">
{{if .IsRepositoryWatching}}
<button type="button" class="btn btn-default"><i class="fa fa-eye fa-lg fa-m"></i></button>
{{else}}