From e4db58a70afe725652e2e6175b1abed588c8868f Mon Sep 17 00:00:00 2001 From: chenyifan01 Date: Tue, 11 Oct 2022 14:14:49 +0800 Subject: [PATCH] #2910 update --- routers/badge/badge.go | 9 +++++++++ routers/badge/category.go | 9 +++++++++ routers/routes/routes.go | 2 ++ 3 files changed, 20 insertions(+) diff --git a/routers/badge/badge.go b/routers/badge/badge.go index 5e4efcdbf..4367f1841 100644 --- a/routers/badge/badge.go +++ b/routers/badge/badge.go @@ -2,6 +2,7 @@ package badge import ( "code.gitea.io/gitea/models" + "code.gitea.io/gitea/modules/base" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/setting" @@ -13,6 +14,14 @@ import ( "strings" ) +const ( + tplBadgeCustomize base.TplName = "admin/badges/customize" +) + +func GetBadgeCustomizePage(ctx *context.Context) { + ctx.HTML(200, tplBadgeCustomize) +} + func GetCustomizeBadgeList(ctx *context.Context) { page := ctx.QueryInt("page") pageSize := 50 diff --git a/routers/badge/category.go b/routers/badge/category.go index 4ac85df4a..b5457c857 100644 --- a/routers/badge/category.go +++ b/routers/badge/category.go @@ -2,6 +2,7 @@ package badge import ( "code.gitea.io/gitea/models" + "code.gitea.io/gitea/modules/base" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/routers/response" @@ -10,6 +11,14 @@ import ( "net/http" ) +const ( + tplBadgeCategory base.TplName = "admin/badges/category" +) + +func GetBadgeCategoryPage(ctx *context.Context) { + ctx.HTML(200, tplBadgeCategory) +} + func GetBadgeCategoryList(ctx *context.Context) { page := ctx.QueryInt("page") pageSize := 50 diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 91b5690ad..648164fbe 100755 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -676,10 +676,12 @@ func RegisterRoutes(m *macaron.Macaron) { m.Group("/badge", func() { m.Group("/category", func() { + m.Get("", badge.GetBadgeCategoryPage) m.Get("/list", badge.GetBadgeCategoryList) m.Post("/^:action(new|edit|del)$", bindIgnErr(models.BadgeCategory4Show{}), badge.OperateBadgeCategory) }) m.Group("/customize", func() { + m.Get("", badge.GetBadgeCustomizePage) m.Get("/list", badge.GetCustomizeBadgeList) }) m.Group("/users", func() {