]> source.dussan.org Git - gitea.git/commitdiff
Bug fix
authorUnknown <joe2010xtmf@163.com>
Wed, 19 Mar 2014 17:24:46 +0000 (13:24 -0400)
committerUnknown <joe2010xtmf@163.com>
Wed, 19 Mar 2014 17:24:46 +0000 (13:24 -0400)
modules/base/conf.go
routers/repo/single.go
templates/repo/commits.tmpl
web.go

index 41226459d9990c62642f0a11e583e5eeacb8c7fa..b003dea50cc81b46f7f868afda895793b29b6c28 100644 (file)
@@ -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()
index 285c5277af88810bd260f604b5a0e89d23b9a4e7..1c9b35945d72d698427a7298adc82021e70f75d3 100644 (file)
@@ -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)
 }
index 04ca19afc88e949cd8608bea1c7ad8f301dc5ca9..8b4e41f7485872183af37dcce7dfe9a5c86c7d81 100644 (file)
@@ -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>
diff --git a/web.go b/web.go
index 2cf3ba09321429c48703a2c203f2cd08c21e6d79..2a9df17c8d1da1a3930fd7f5e44bd18ae3ac2374 100644 (file)
--- a/web.go
+++ b/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)