repo branch page ui

This commit is contained in:
FuXiaoHei
2014-03-17 17:14:31 +08:00
parent 24d91ecda8
commit 3a3ac1f0f3
6 changed files with 157 additions and 28 deletions

View File

@ -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