Browse Source

#2477

add kanban index route
pull/2568/head
chenyifan01 2 years ago
parent
commit
1cc7f47767
2 changed files with 26 additions and 0 deletions
  1. +24
    -0
      routers/kanban/kanban.go
  2. +2
    -0
      routers/routes/routes.go

+ 24
- 0
routers/kanban/kanban.go View File

@@ -0,0 +1,24 @@
package kanban

import (
"code.gitea.io/gitea/modules/base"
"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/setting"
"net/http"
"os"
"path"
"time"
)

func Index(ctx *context.Context) {
file := path.Join(setting.StaticRootPath, "public/kanban/index.html")
name := "index.html"
f, err := os.Open(file)
if err != nil {
ctx.HTML(http.StatusNotFound, base.TplName("status/404"))
return
}
defer f.Close()
ctx.Resp.Header().Set("Content-Type", "text/html")
http.ServeContent(ctx.Resp, ctx.Req.Request, name, time.Now(), f)
}

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

@@ -6,6 +6,7 @@ package routes


import ( import (
"bytes" "bytes"
"code.gitea.io/gitea/routers/kanban"
"encoding/gob" "encoding/gob"
"net/http" "net/http"
"path" "path"
@@ -327,6 +328,7 @@ func RegisterRoutes(m *macaron.Macaron) {
}) })
m.Get("/", routers.Home) m.Get("/", routers.Home)
m.Get("/dashboard", routers.Dashboard) m.Get("/dashboard", routers.Dashboard)
m.Get("/kanban/index", kanban.Index)
go routers.SocketManager.Run() go routers.SocketManager.Run()
m.Get("/action/notification", routers.ActionNotification) m.Get("/action/notification", routers.ActionNotification)
m.Get("/recommend/home", routers.RecommendHomeInfo) m.Get("/recommend/home", routers.RecommendHomeInfo)


Loading…
Cancel
Save