From a143994177224cf461faf8cdf2152cbfd10d4c62 Mon Sep 17 00:00:00 2001 From: chenshihai Date: Wed, 20 Jul 2022 11:09:12 +0800 Subject: [PATCH 1/8] add kanban file --- public/kanban/index.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 public/kanban/index.html diff --git a/public/kanban/index.html b/public/kanban/index.html new file mode 100644 index 000000000..0e44d84a3 --- /dev/null +++ b/public/kanban/index.html @@ -0,0 +1,12 @@ + + + + + + + + + +
kanban
+ + From 1cc7f47767e7611374faa926699719df87a373b4 Mon Sep 17 00:00:00 2001 From: chenyifan01 Date: Wed, 20 Jul 2022 14:21:56 +0800 Subject: [PATCH 2/8] #2477 add kanban index route --- routers/kanban/kanban.go | 24 ++++++++++++++++++++++++ routers/routes/routes.go | 2 ++ 2 files changed, 26 insertions(+) create mode 100644 routers/kanban/kanban.go diff --git a/routers/kanban/kanban.go b/routers/kanban/kanban.go new file mode 100644 index 000000000..d6bb743bb --- /dev/null +++ b/routers/kanban/kanban.go @@ -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) +} diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 35a26f585..bdad93572 100755 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -6,6 +6,7 @@ package routes import ( "bytes" + "code.gitea.io/gitea/routers/kanban" "encoding/gob" "net/http" "path" @@ -327,6 +328,7 @@ func RegisterRoutes(m *macaron.Macaron) { }) m.Get("/", routers.Home) m.Get("/dashboard", routers.Dashboard) + m.Get("/kanban/index", kanban.Index) go routers.SocketManager.Run() m.Get("/action/notification", routers.ActionNotification) m.Get("/recommend/home", routers.RecommendHomeInfo) From 3bbe2b5de6b21baf00e7fa8dc03c04d738fb438f Mon Sep 17 00:00:00 2001 From: chenyifan01 Date: Wed, 20 Jul 2022 14:29:13 +0800 Subject: [PATCH 3/8] #2477 update kanban index route --- routers/routes/routes.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/routes/routes.go b/routers/routes/routes.go index bdad93572..e4481d3c1 100755 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -328,7 +328,7 @@ func RegisterRoutes(m *macaron.Macaron) { }) m.Get("/", routers.Home) m.Get("/dashboard", routers.Dashboard) - m.Get("/kanban/index", kanban.Index) + m.Get("/panel", kanban.Index) go routers.SocketManager.Run() m.Get("/action/notification", routers.ActionNotification) m.Get("/recommend/home", routers.RecommendHomeInfo) From 1ab81931330fb830da3ca542a577bb99a5d95a7d Mon Sep 17 00:00:00 2001 From: chenshihai Date: Thu, 21 Jul 2022 09:26:18 +0800 Subject: [PATCH 4/8] kanban --- .gitignore | 1 + public/kanban/index.html | 12 ------------ templates/base/head.tmpl | 5 +++++ templates/base/head_course.tmpl | 5 +++++ templates/base/head_fluid.tmpl | 5 +++++ templates/base/head_home.tmpl | 5 +++++ templates/base/head_pro.tmpl | 5 +++++ 7 files changed, 26 insertions(+), 12 deletions(-) delete mode 100644 public/kanban/index.html diff --git a/.gitignore b/.gitignore index 9f34fea2a..02f379b0b 100644 --- a/.gitignore +++ b/.gitignore @@ -80,6 +80,7 @@ coverage.all /public/css /public/fonts /public/fomantic +/public/kanban /public/img/svg /VERSION diff --git a/public/kanban/index.html b/public/kanban/index.html deleted file mode 100644 index 0e44d84a3..000000000 --- a/public/kanban/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - -
kanban
- - diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl index 937abd588..4ab9da231 100755 --- a/templates/base/head.tmpl +++ b/templates/base/head.tmpl @@ -109,6 +109,11 @@ ], {{end}} }; + {{if .IsSigned}} + window.sessionStorage.setItem('_csrf', '{{.CsrfToken}}'); + {{else}} + window.sessionStorage.removeItem('_csrf'); + {{end}} diff --git a/templates/base/head_course.tmpl b/templates/base/head_course.tmpl index 3fff0b8d2..fe21a0e05 100644 --- a/templates/base/head_course.tmpl +++ b/templates/base/head_course.tmpl @@ -109,6 +109,11 @@ ], {{end}} }; + {{if .IsSigned}} + window.sessionStorage.setItem('_csrf', '{{.CsrfToken}}'); + {{else}} + window.sessionStorage.removeItem('_csrf'); + {{end}} diff --git a/templates/base/head_fluid.tmpl b/templates/base/head_fluid.tmpl index 5340c7cb8..1c16e7140 100644 --- a/templates/base/head_fluid.tmpl +++ b/templates/base/head_fluid.tmpl @@ -109,6 +109,11 @@ ], {{end}} }; + {{if .IsSigned}} + window.sessionStorage.setItem('_csrf', '{{.CsrfToken}}'); + {{else}} + window.sessionStorage.removeItem('_csrf'); + {{end}} diff --git a/templates/base/head_home.tmpl b/templates/base/head_home.tmpl index 2def358f8..a77d7b00a 100644 --- a/templates/base/head_home.tmpl +++ b/templates/base/head_home.tmpl @@ -109,6 +109,11 @@ ], {{end}} }; + {{if .IsSigned}} + window.sessionStorage.setItem('_csrf', '{{.CsrfToken}}'); + {{else}} + window.sessionStorage.removeItem('_csrf'); + {{end}} diff --git a/templates/base/head_pro.tmpl b/templates/base/head_pro.tmpl index 75292b6fc..c643ea873 100644 --- a/templates/base/head_pro.tmpl +++ b/templates/base/head_pro.tmpl @@ -109,6 +109,11 @@ ], {{end}} }; + {{if .IsSigned}} + window.sessionStorage.setItem('_csrf', '{{.CsrfToken}}'); + {{else}} + window.sessionStorage.removeItem('_csrf'); + {{end}} From bf813e8c6be531e2b53fc5f9e8117faf26467294 Mon Sep 17 00:00:00 2001 From: chenshihai Date: Fri, 22 Jul 2022 09:13:56 +0800 Subject: [PATCH 5/8] update kanban entry menu --- templates/base/head_navbar.tmpl | 6 ++++-- templates/base/head_navbar_fluid.tmpl | 6 ++++-- templates/base/head_navbar_home.tmpl | 6 ++++-- templates/base/head_navbar_pro.tmpl | 6 ++++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/templates/base/head_navbar.tmpl b/templates/base/head_navbar.tmpl index 51761a7e5..8dcca349c 100755 --- a/templates/base/head_navbar.tmpl +++ b/templates/base/head_navbar.tmpl @@ -42,7 +42,8 @@ {{.i18n.Tr "explore.organizations"}} {{.i18n.Tr "explore.images"}} {{if .IsOperator}} - {{.i18n.Tr "explore.data_analysis"}} + {{/* {{.i18n.Tr "explore.data_analysis"}} */}} + {{.i18n.Tr "explore.data_analysis"}} {{end}} {{.i18n.Tr "custom.head.openi.repo"}} @@ -73,7 +74,8 @@ {{.i18n.Tr "explore.organizations"}} {{.i18n.Tr "explore.images"}} {{if .IsOperator}} - {{.i18n.Tr "explore.data_analysis"}} + {{/* {{.i18n.Tr "explore.data_analysis"}} */}} + {{.i18n.Tr "explore.data_analysis"}} {{end}} {{.i18n.Tr "custom.head.openi.repo"}} diff --git a/templates/base/head_navbar_fluid.tmpl b/templates/base/head_navbar_fluid.tmpl index 6baeced54..263e5333a 100644 --- a/templates/base/head_navbar_fluid.tmpl +++ b/templates/base/head_navbar_fluid.tmpl @@ -41,7 +41,8 @@ {{.i18n.Tr "explore.organizations"}} {{.i18n.Tr "explore.images"}} {{if .IsOperator}} - {{.i18n.Tr "explore.data_analysis"}} + {{/* {{.i18n.Tr "explore.data_analysis"}} */}} + {{.i18n.Tr "explore.data_analysis"}} {{end}} {{.i18n.Tr "custom.head.openi.repo"}} @@ -71,7 +72,8 @@ {{.i18n.Tr "explore.organizations"}} {{.i18n.Tr "explore.images"}} {{if .IsOperator}} - {{.i18n.Tr "explore.data_analysis"}} + {{/* {{.i18n.Tr "explore.data_analysis"}} */}} + {{.i18n.Tr "explore.data_analysis"}} {{end}} {{.i18n.Tr "custom.head.openi.repo"}} diff --git a/templates/base/head_navbar_home.tmpl b/templates/base/head_navbar_home.tmpl index c9ea13b8a..fb5868dce 100644 --- a/templates/base/head_navbar_home.tmpl +++ b/templates/base/head_navbar_home.tmpl @@ -33,7 +33,8 @@ {{.i18n.Tr "explore.organizations"}} {{.i18n.Tr "explore.images"}} {{if .IsOperator}} - {{.i18n.Tr "explore.data_analysis"}} + {{/* {{.i18n.Tr "explore.data_analysis"}} */}} + {{.i18n.Tr "explore.data_analysis"}} {{end}} {{.i18n.Tr "custom.head.openi.repo"}} @@ -64,7 +65,8 @@ {{.i18n.Tr "explore.organizations"}} {{.i18n.Tr "explore.images"}} {{if .IsOperator}} - {{.i18n.Tr "explore.data_analysis"}} + {{/* {{.i18n.Tr "explore.data_analysis"}} */}} + {{.i18n.Tr "explore.data_analysis"}} {{end}} {{.i18n.Tr "custom.head.openi.repo"}} diff --git a/templates/base/head_navbar_pro.tmpl b/templates/base/head_navbar_pro.tmpl index e744508f0..340f50f6b 100644 --- a/templates/base/head_navbar_pro.tmpl +++ b/templates/base/head_navbar_pro.tmpl @@ -43,7 +43,8 @@ {{.i18n.Tr "explore.organizations"}} {{.i18n.Tr "explore.images"}} {{if .IsOperator}} - {{.i18n.Tr "explore.data_analysis"}} + {{/* {{.i18n.Tr "explore.data_analysis"}} */}} + {{.i18n.Tr "explore.data_analysis"}} {{end}} {{.i18n.Tr "custom.head.openi.repo"}} @@ -74,7 +75,8 @@ {{.i18n.Tr "explore.organizations"}} {{.i18n.Tr "explore.images"}} {{if .IsOperator}} - {{.i18n.Tr "explore.data_analysis"}} + {{/* {{.i18n.Tr "explore.data_analysis"}} */}} + {{.i18n.Tr "explore.data_analysis"}} {{end}} {{.i18n.Tr "custom.head.openi.repo"}} From fc1164df88b5c2d90956c30673163715b3bfba83 Mon Sep 17 00:00:00 2001 From: chenyifan01 Date: Fri, 22 Jul 2022 09:30:54 +0800 Subject: [PATCH 6/8] #2477 remove /panel path --- routers/kanban/kanban.go | 24 ------------------------ routers/routes/routes.go | 2 -- 2 files changed, 26 deletions(-) delete mode 100644 routers/kanban/kanban.go diff --git a/routers/kanban/kanban.go b/routers/kanban/kanban.go deleted file mode 100644 index d6bb743bb..000000000 --- a/routers/kanban/kanban.go +++ /dev/null @@ -1,24 +0,0 @@ -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) -} diff --git a/routers/routes/routes.go b/routers/routes/routes.go index e4481d3c1..35a26f585 100755 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -6,7 +6,6 @@ package routes import ( "bytes" - "code.gitea.io/gitea/routers/kanban" "encoding/gob" "net/http" "path" @@ -328,7 +327,6 @@ func RegisterRoutes(m *macaron.Macaron) { }) m.Get("/", routers.Home) m.Get("/dashboard", routers.Dashboard) - m.Get("/panel", kanban.Index) go routers.SocketManager.Run() m.Get("/action/notification", routers.ActionNotification) m.Get("/recommend/home", routers.RecommendHomeInfo) From ae3b50ad2ce597cfa156fd53f913158a32a86ca0 Mon Sep 17 00:00:00 2001 From: chenshihai Date: Fri, 22 Jul 2022 10:17:32 +0800 Subject: [PATCH 7/8] update kanban entry menu --- templates/base/head_navbar.tmpl | 4 ++-- templates/base/head_navbar_fluid.tmpl | 4 ++-- templates/base/head_navbar_home.tmpl | 4 ++-- templates/base/head_navbar_pro.tmpl | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/templates/base/head_navbar.tmpl b/templates/base/head_navbar.tmpl index 8dcca349c..a5a898ad0 100755 --- a/templates/base/head_navbar.tmpl +++ b/templates/base/head_navbar.tmpl @@ -43,7 +43,7 @@ {{.i18n.Tr "explore.images"}} {{if .IsOperator}} {{/* {{.i18n.Tr "explore.data_analysis"}} */}} - {{.i18n.Tr "explore.data_analysis"}} + {{.i18n.Tr "explore.data_analysis"}} {{end}} {{.i18n.Tr "custom.head.openi.repo"}} @@ -75,7 +75,7 @@ {{.i18n.Tr "explore.images"}} {{if .IsOperator}} {{/* {{.i18n.Tr "explore.data_analysis"}} */}} - {{.i18n.Tr "explore.data_analysis"}} + {{.i18n.Tr "explore.data_analysis"}} {{end}} {{.i18n.Tr "custom.head.openi.repo"}} diff --git a/templates/base/head_navbar_fluid.tmpl b/templates/base/head_navbar_fluid.tmpl index 263e5333a..84781db11 100644 --- a/templates/base/head_navbar_fluid.tmpl +++ b/templates/base/head_navbar_fluid.tmpl @@ -42,7 +42,7 @@ {{.i18n.Tr "explore.images"}} {{if .IsOperator}} {{/* {{.i18n.Tr "explore.data_analysis"}} */}} - {{.i18n.Tr "explore.data_analysis"}} + {{.i18n.Tr "explore.data_analysis"}} {{end}} {{.i18n.Tr "custom.head.openi.repo"}} @@ -73,7 +73,7 @@ {{.i18n.Tr "explore.images"}} {{if .IsOperator}} {{/* {{.i18n.Tr "explore.data_analysis"}} */}} - {{.i18n.Tr "explore.data_analysis"}} + {{.i18n.Tr "explore.data_analysis"}} {{end}} {{.i18n.Tr "custom.head.openi.repo"}} diff --git a/templates/base/head_navbar_home.tmpl b/templates/base/head_navbar_home.tmpl index fb5868dce..64e04b4c3 100644 --- a/templates/base/head_navbar_home.tmpl +++ b/templates/base/head_navbar_home.tmpl @@ -34,7 +34,7 @@ {{.i18n.Tr "explore.images"}} {{if .IsOperator}} {{/* {{.i18n.Tr "explore.data_analysis"}} */}} - {{.i18n.Tr "explore.data_analysis"}} + {{.i18n.Tr "explore.data_analysis"}} {{end}} {{.i18n.Tr "custom.head.openi.repo"}} @@ -66,7 +66,7 @@ {{.i18n.Tr "explore.images"}} {{if .IsOperator}} {{/* {{.i18n.Tr "explore.data_analysis"}} */}} - {{.i18n.Tr "explore.data_analysis"}} + {{.i18n.Tr "explore.data_analysis"}} {{end}} {{.i18n.Tr "custom.head.openi.repo"}} diff --git a/templates/base/head_navbar_pro.tmpl b/templates/base/head_navbar_pro.tmpl index 340f50f6b..e9f662bbe 100644 --- a/templates/base/head_navbar_pro.tmpl +++ b/templates/base/head_navbar_pro.tmpl @@ -44,7 +44,7 @@ {{.i18n.Tr "explore.images"}} {{if .IsOperator}} {{/* {{.i18n.Tr "explore.data_analysis"}} */}} - {{.i18n.Tr "explore.data_analysis"}} + {{.i18n.Tr "explore.data_analysis"}} {{end}} {{.i18n.Tr "custom.head.openi.repo"}} @@ -76,7 +76,7 @@ {{.i18n.Tr "explore.images"}} {{if .IsOperator}} {{/* {{.i18n.Tr "explore.data_analysis"}} */}} - {{.i18n.Tr "explore.data_analysis"}} + {{.i18n.Tr "explore.data_analysis"}} {{end}} {{.i18n.Tr "custom.head.openi.repo"}} From 43b88aa12f3afecec8036e520bda893fa3fe205c Mon Sep 17 00:00:00 2001 From: chenshihai Date: Fri, 22 Jul 2022 10:49:41 +0800 Subject: [PATCH 8/8] update .gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 02f379b0b..ceeeaa92c 100644 --- a/.gitignore +++ b/.gitignore @@ -55,6 +55,7 @@ coverage.all !/custom/conf/templates /custom/conf/app.ini !/custom/conf/app.ini.sample +/custom/public/kanban /data /indexers /log @@ -80,7 +81,6 @@ coverage.all /public/css /public/fonts /public/fomantic -/public/kanban /public/img/svg /VERSION