added season edits

This commit is contained in:
2026-02-09 20:35:04 +11:00
parent e133b3f0b9
commit 292ec93de7
11 changed files with 561 additions and 56 deletions

View File

@@ -13,6 +13,7 @@ import (
"git.haelnorr.com/h/oslstats/internal/db"
"git.haelnorr.com/h/oslstats/internal/discord"
"git.haelnorr.com/h/oslstats/internal/handlers"
"git.haelnorr.com/h/oslstats/internal/permissions"
"git.haelnorr.com/h/oslstats/internal/rbac"
"git.haelnorr.com/h/oslstats/internal/store"
)
@@ -83,18 +84,28 @@ func addRoutes(
{
Path: "/seasons/new",
Method: hws.MethodGET,
Handler: handlers.NewSeason(s, conn),
Handler: perms.RequirePermission(s, permissions.SeasonsCreate)(handlers.NewSeason(s, conn)),
},
{
Path: "/seasons/new",
Method: hws.MethodPOST,
Handler: handlers.NewSeasonSubmit(s, conn),
Handler: perms.RequirePermission(s, permissions.SeasonsCreate)(handlers.NewSeasonSubmit(s, conn, audit)),
},
{
Path: "/seasons/{season_short_name}",
Method: hws.MethodGET,
Handler: handlers.SeasonPage(s, conn),
},
{
Path: "/seasons/{season_short_name}/edit",
Method: hws.MethodGET,
Handler: perms.RequirePermission(s, permissions.SeasonsUpdate)(handlers.SeasonEditPage(s, conn)),
},
{
Path: "/seasons/{season_short_name}/edit",
Method: hws.MethodPOST,
Handler: perms.RequirePermission(s, permissions.SeasonsUpdate)(handlers.SeasonEditSubmit(s, conn, audit)),
},
}
htmxRoutes := []hws.Route{