]> source.dussan.org Git - gitea.git/commitdiff
Bug fix
authorUnknown <joe2010xtmf@163.com>
Sun, 23 Mar 2014 10:34:41 +0000 (06:34 -0400)
committerUnknown <joe2010xtmf@163.com>
Sun, 23 Mar 2014 10:34:41 +0000 (06:34 -0400)
modules/base/tool.go
templates/repo/nav.tmpl

index edf7a953c9f85f39f14260e9a0b13bbd208e475c..b48566f542ce725a7db15b8b3cec4aed32ab8204 100644 (file)
@@ -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())
index b2d3500f92230821de4b5f8a1740e8ca582ec8a3..a3358fd890759239e36fac83cca7d4ebac7c4eee 100644 (file)
@@ -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}}