diff options
author | Unknown <joe2010xtmf@163.com> | 2014-04-02 12:43:31 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-04-02 12:43:31 -0400 |
commit | db66b8da7227f7fd3ff9a8d7ccece0c3e31ea3d0 (patch) | |
tree | a48dc02ac1cb79ab18cb2837dccae10a503358f1 /routers | |
parent | 97b133bbee77740bded5b4f2e7ad9896d6804cf7 (diff) | |
download | gitea-db66b8da7227f7fd3ff9a8d7ccece0c3e31ea3d0.tar.gz gitea-db66b8da7227f7fd3ff9a8d7ccece0c3e31ea3d0.zip |
Add release tmpl
Diffstat (limited to 'routers')
-rw-r--r-- | routers/repo/issue.go | 2 | ||||
-rw-r--r-- | routers/repo/release.go | 22 |
2 files changed, 23 insertions, 1 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go index 41b2c7e9b1..be92542641 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -74,7 +74,7 @@ func Issues(ctx *middleware.Context) { ctx.Data["Issues"] = showIssues ctx.Data["IssueCount"] = ctx.Repo.Repository.NumIssues - ctx.Data["OpenCount"] = ctx.Repo.Repository.NumIssues - ctx.Repo.Repository.NumClosedIssues + ctx.Data["OpenCount"] = ctx.Repo.Repository.NumOpenIssues ctx.Data["ClosedCount"] = ctx.Repo.Repository.NumClosedIssues ctx.Data["IssueCreatedCount"] = createdByCount ctx.Data["IsShowClosed"] = ctx.Query("state") == "closed" diff --git a/routers/repo/release.go b/routers/repo/release.go new file mode 100644 index 0000000000..8e8b93c9ea --- /dev/null +++ b/routers/repo/release.go @@ -0,0 +1,22 @@ +// Copyright 2014 The Gogs Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +package repo + +import ( + "github.com/gogits/gogs/models" + "github.com/gogits/gogs/modules/middleware" +) + +func Releases(ctx *middleware.Context) { + ctx.Data["Title"] = "Releases" + ctx.Data["IsRepoToolbarReleases"] = true + tags, err := models.GetTags(ctx.Repo.Owner.Name, ctx.Repo.Repository.Name) + if err != nil { + ctx.Handle(404, "repo.Releases(GetTags)", err) + return + } + ctx.Data["Releases"] = tags + ctx.HTML(200, "release/list") +} |