diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-08-10 00:14:17 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-08-10 00:14:17 +0900 |
| commit | b450648caa0d1bd5c91e67a33153bbacaf57f006 (patch) | |
| tree | 8dce01b8eb398759a3abdb97d3d333b52738c768 /backend/admin | |
| parent | a7342525e5e4052113e6d5e75b6fd50c91687514 (diff) | |
| download | phperkaigi-2025-albatross-b450648caa0d1bd5c91e67a33153bbacaf57f006.tar.gz phperkaigi-2025-albatross-b450648caa0d1bd5c91e67a33153bbacaf57f006.tar.zst phperkaigi-2025-albatross-b450648caa0d1bd5c91e67a33153bbacaf57f006.zip | |
feat: prepend base path
Diffstat (limited to 'backend/admin')
| -rw-r--r-- | backend/admin/handler.go | 4 | ||||
| -rw-r--r-- | backend/admin/templates/base.html | 6 | ||||
| -rw-r--r-- | backend/admin/templates/dashboard.html | 6 | ||||
| -rw-r--r-- | backend/admin/templates/game_edit.html | 2 | ||||
| -rw-r--r-- | backend/admin/templates/games.html | 4 | ||||
| -rw-r--r-- | backend/admin/templates/user_edit.html | 2 | ||||
| -rw-r--r-- | backend/admin/templates/users.html | 4 |
7 files changed, 14 insertions, 14 deletions
diff --git a/backend/admin/handler.go b/backend/admin/handler.go index b50b942..7239b08 100644 --- a/backend/admin/handler.go +++ b/backend/admin/handler.go @@ -37,11 +37,11 @@ func newAdminMiddleware() echo.MiddlewareFunc { return func(c echo.Context) error { jwt, err := c.Cookie("albatross_token") if err != nil { - return c.Redirect(http.StatusSeeOther, "/login") + return c.Redirect(http.StatusSeeOther, "/iosdc-japan/2024/code-battle/login") } claims, err := auth.ParseJWT(jwt.Value) if err != nil { - return c.Redirect(http.StatusSeeOther, "/login") + return c.Redirect(http.StatusSeeOther, "/iosdc-japan/2024/code-battle/login") } if !claims.IsAdmin { return echo.NewHTTPError(http.StatusForbidden) diff --git a/backend/admin/templates/base.html b/backend/admin/templates/base.html index 4bcdbdd..49e2066 100644 --- a/backend/admin/templates/base.html +++ b/backend/admin/templates/base.html @@ -2,9 +2,9 @@ <html> <head> <title>ADMIN {{ .Title }} | iOSDC Japan 2024 Albatross.swift</title> - <link rel="icon" href="/favicon.svg"> - <link rel="stylesheet" href="/admin/css/normalize.css"> - <link rel="stylesheet" href="/admin/css/sakura.css"> + <link rel="icon" href="/iosdc-japan/2024/code-battle/favicon.svg"> + <link rel="stylesheet" href="/iosdc-japan/2024/code-battle/admin/css/normalize.css"> + <link rel="stylesheet" href="/iosdc-japan/2024/code-battle/admin/css/sakura.css"> </head> <body> <section> diff --git a/backend/admin/templates/dashboard.html b/backend/admin/templates/dashboard.html index cdb8ba1..b2037cb 100644 --- a/backend/admin/templates/dashboard.html +++ b/backend/admin/templates/dashboard.html @@ -2,12 +2,12 @@ {{ define "content" }} <p> - <a href="/admin/users">Users</a> + <a href="/iosdc-japan/2024/code-battle/admin/users">Users</a> </p> <p> - <a href="/admin/games">Games</a> + <a href="/iosdc-japan/2024/code-battle/admin/games">Games</a> </p> -<form method="post" action="/logout"> +<form method="post" action="/iosdc-japan/2024/code-battle/logout"> <button type="submit">Logout</button> </form> {{ end }} diff --git a/backend/admin/templates/game_edit.html b/backend/admin/templates/game_edit.html index 108ae99..f40cc5d 100644 --- a/backend/admin/templates/game_edit.html +++ b/backend/admin/templates/game_edit.html @@ -1,7 +1,7 @@ {{ template "base.html" . }} {{ define "breadcrumb" }} -<a href="/admin/dashboard">Dashboard</a> | <a href="/admin/games">Games</a> +<a href="/iosdc-japan/2024/code-battle/admin/dashboard">Dashboard</a> | <a href="/iosdc-japan/2024/code-battle/admin/games">Games</a> {{ end }} {{ define "content" }} diff --git a/backend/admin/templates/games.html b/backend/admin/templates/games.html index 47dc4a3..0616938 100644 --- a/backend/admin/templates/games.html +++ b/backend/admin/templates/games.html @@ -1,14 +1,14 @@ {{ template "base.html" . }} {{ define "breadcrumb" }} -<a href="/admin/dashboard">Dashboard</a> +<a href="/iosdc-japan/2024/code-battle/admin/dashboard">Dashboard</a> {{ end }} {{ define "content" }} <ul> {{ range .Games }} <li> - <a href="/admin/games/{{ .GameID }}"> + <a href="/iosdc-japan/2024/code-battle/admin/games/{{ .GameID }}"> {{ .DisplayName }} (id={{ .GameID }} type={{ .GameType }} state={{ .State }}) </a> </li> diff --git a/backend/admin/templates/user_edit.html b/backend/admin/templates/user_edit.html index bde7c84..56ecbc8 100644 --- a/backend/admin/templates/user_edit.html +++ b/backend/admin/templates/user_edit.html @@ -1,7 +1,7 @@ {{ template "base.html" . }} {{ define "breadcrumb" }} -<a href="/admin/dashboard">Dashboard</a> | <a href="/admin/users">Users</a> +<a href="/iosdc-japan/2024/code-battle/admin/dashboard">Dashboard</a> | <a href="/iosdc-japan/2024/code-battle/admin/users">Users</a> {{ end }} {{ define "content" }} diff --git a/backend/admin/templates/users.html b/backend/admin/templates/users.html index 656ad53..3543457 100644 --- a/backend/admin/templates/users.html +++ b/backend/admin/templates/users.html @@ -1,14 +1,14 @@ {{ template "base.html" . }} {{ define "breadcrumb" }} -<a href="/admin/dashboard">Dashboard</a> +<a href="/iosdc-japan/2024/code-battle/admin/dashboard">Dashboard</a> {{ end }} {{ define "content" }} <ul> {{ range .Users }} <li> - <a href="/admin/users/{{ .UserID }}"> + <a href="/iosdc-japan/2024/code-battle/admin/users/{{ .UserID }}"> {{ .DisplayName }} (id={{ .UserID }} username={{ .Username }}){{ if .IsAdmin }} <em>admin</em>{{ end }} </a> </li> |
