aboutsummaryrefslogtreecommitdiff
path: root/routers/repo
diff options
context:
space:
mode:
authorFuXiaoHei <fuxiaohei@hexiaz.com>2014-03-17 17:14:31 +0800
committerFuXiaoHei <fuxiaohei@hexiaz.com>2014-03-17 17:14:31 +0800
commit3a3ac1f0f32d44330d513cfea9ca3560bc41671e (patch)
treeac2fde773dbe1fdd96ab801a93402295756ae987 /routers/repo
parent24d91ecda8c819a33f326ff724559456bcae6d71 (diff)
repo branch page ui
Diffstat (limited to 'routers/repo')
-rw-r--r--routers/repo/single.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/routers/repo/single.go b/routers/repo/single.go
index fdc4e6e7..625fe9f1 100644
--- a/routers/repo/single.go
+++ b/routers/repo/single.go
@@ -13,6 +13,26 @@ import (
"github.com/gogits/gogs/modules/middleware"
)
+func Branches(ctx *middleware.Context, params martini.Params) {
+ if !ctx.Repo.IsValid {
+ return
+ }
+
+ ctx.Data["Username"] = params["username"]
+ ctx.Data["Reponame"] = params["reponame"]
+
+ brs, err := models.GetBranches(params["username"], params["reponame"])
+ if err != nil {
+ ctx.Handle(200, "repo.Branches", err)
+ return
+ }
+
+ ctx.Data["Branches"] = brs
+ ctx.Data["IsRepoToolbarBranches"] = true
+
+ ctx.Render.HTML(200, "repo/branches", ctx.Data)
+}
+
func Single(ctx *middleware.Context, params martini.Params) {
if !ctx.Repo.IsValid {
return