Unknown 11 years ago
parent
commit
601c10309d
4 changed files with 5 additions and 2 deletions
  1. 2 1
      modules/base/conf.go
  2. 1 0
      routers/repo/single.go
  3. 1 1
      templates/repo/commits.tmpl
  4. 1 0
      web.go

+ 2 - 1
modules/base/conf.go

@@ -172,8 +172,9 @@ func init() {
 	AppUrl = Cfg.MustValue("server", "ROOT_URL")
 	Domain = Cfg.MustValue("server", "DOMAIN")
 	SecretKey = Cfg.MustValue("security", "SECRET_KEY")
+}
 
-	// Extensions.
+func NewServices() {
 	newService()
 	newLogService()
 	newMailService()

+ 1 - 0
routers/repo/single.go

@@ -188,6 +188,7 @@ func Commits(ctx *middleware.Context, params martini.Params) {
 	}
 	ctx.Data["Username"] = params["username"]
 	ctx.Data["Reponame"] = params["reponame"]
+	ctx.Data["CommitCount"] = commits.Len()
 	ctx.Data["Commits"] = commits
 	ctx.HTML(200, "repo/commits", ctx.Data)
 }

+ 1 - 1
templates/repo/commits.tmpl

@@ -9,7 +9,7 @@
                 <div class="search pull-right form">
                     <input class="form-control search" type="search" placeholder="search commit"/>
                 </div>
-                <h4>Commits</h4>
+                <h4>{{.CommitCount}} Commits</h4>
             </div>
             <table class="panel-footer table commit-list table table-striped">
                 <thead>

+ 1 - 0
web.go

@@ -58,6 +58,7 @@ func newMartini() *martini.ClassicMartini {
 }
 
 func runWeb(*cli.Context) {
+	base.NewServices()
 	checkRunMode()
 	log.Info("%s %s", base.AppName, base.AppVer)