@@ -2,6 +2,7 @@ package badge | |||||
import ( | import ( | ||||
"code.gitea.io/gitea/models" | "code.gitea.io/gitea/models" | ||||
"code.gitea.io/gitea/modules/base" | |||||
"code.gitea.io/gitea/modules/context" | "code.gitea.io/gitea/modules/context" | ||||
"code.gitea.io/gitea/modules/log" | "code.gitea.io/gitea/modules/log" | ||||
"code.gitea.io/gitea/modules/setting" | "code.gitea.io/gitea/modules/setting" | ||||
@@ -13,6 +14,14 @@ import ( | |||||
"strings" | "strings" | ||||
) | ) | ||||
const ( | |||||
tplBadgeCustomize base.TplName = "admin/badges/customize" | |||||
) | |||||
func GetBadgeCustomizePage(ctx *context.Context) { | |||||
ctx.HTML(200, tplBadgeCustomize) | |||||
} | |||||
func GetCustomizeBadgeList(ctx *context.Context) { | func GetCustomizeBadgeList(ctx *context.Context) { | ||||
page := ctx.QueryInt("page") | page := ctx.QueryInt("page") | ||||
pageSize := 50 | pageSize := 50 | ||||
@@ -2,6 +2,7 @@ package badge | |||||
import ( | import ( | ||||
"code.gitea.io/gitea/models" | "code.gitea.io/gitea/models" | ||||
"code.gitea.io/gitea/modules/base" | |||||
"code.gitea.io/gitea/modules/context" | "code.gitea.io/gitea/modules/context" | ||||
"code.gitea.io/gitea/modules/log" | "code.gitea.io/gitea/modules/log" | ||||
"code.gitea.io/gitea/routers/response" | "code.gitea.io/gitea/routers/response" | ||||
@@ -10,6 +11,14 @@ import ( | |||||
"net/http" | "net/http" | ||||
) | ) | ||||
const ( | |||||
tplBadgeCategory base.TplName = "admin/badges/category" | |||||
) | |||||
func GetBadgeCategoryPage(ctx *context.Context) { | |||||
ctx.HTML(200, tplBadgeCategory) | |||||
} | |||||
func GetBadgeCategoryList(ctx *context.Context) { | func GetBadgeCategoryList(ctx *context.Context) { | ||||
page := ctx.QueryInt("page") | page := ctx.QueryInt("page") | ||||
pageSize := 50 | pageSize := 50 | ||||
@@ -676,10 +676,12 @@ func RegisterRoutes(m *macaron.Macaron) { | |||||
m.Group("/badge", func() { | m.Group("/badge", func() { | ||||
m.Group("/category", func() { | m.Group("/category", func() { | ||||
m.Get("", badge.GetBadgeCategoryPage) | |||||
m.Get("/list", badge.GetBadgeCategoryList) | m.Get("/list", badge.GetBadgeCategoryList) | ||||
m.Post("/^:action(new|edit|del)$", bindIgnErr(models.BadgeCategory4Show{}), badge.OperateBadgeCategory) | m.Post("/^:action(new|edit|del)$", bindIgnErr(models.BadgeCategory4Show{}), badge.OperateBadgeCategory) | ||||
}) | }) | ||||
m.Group("/customize", func() { | m.Group("/customize", func() { | ||||
m.Get("", badge.GetBadgeCustomizePage) | |||||
m.Get("/list", badge.GetCustomizeBadgeList) | m.Get("/list", badge.GetCustomizeBadgeList) | ||||
}) | }) | ||||
m.Group("/users", func() { | m.Group("/users", func() { | ||||