Browse Source

#2910

update
medal-v1
chenyifan01 2 years ago
parent
commit
e4db58a70a
3 changed files with 20 additions and 0 deletions
  1. +9
    -0
      routers/badge/badge.go
  2. +9
    -0
      routers/badge/category.go
  3. +2
    -0
      routers/routes/routes.go

+ 9
- 0
routers/badge/badge.go View File

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


+ 9
- 0
routers/badge/category.go View File

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


+ 2
- 0
routers/routes/routes.go View File

@@ -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() {


Loading…
Cancel
Save