diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-03-12 03:10:22 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-03-12 03:10:22 +0900 |
| commit | 4848d10be595cbc257b1d43be1c924fdcf81284e (patch) | |
| tree | 09e5afce1d2c99d64d4cebd2c580aeff11545752 | |
| parent | b21e4525eca3b326799c2521da76236623e2cc57 (diff) | |
| download | iosdc-japan-2025-albatross-4848d10be595cbc257b1d43be1c924fdcf81284e.tar.gz iosdc-japan-2025-albatross-4848d10be595cbc257b1d43be1c924fdcf81284e.tar.zst iosdc-japan-2025-albatross-4848d10be595cbc257b1d43be1c924fdcf81284e.zip | |
feat(backend): change is_public input to checkbox in game edit page
| -rw-r--r-- | backend/admin/handler.go | 2 | ||||
| -rw-r--r-- | backend/admin/templates/game_edit.html | 5 |
2 files changed, 2 insertions, 5 deletions
diff --git a/backend/admin/handler.go b/backend/admin/handler.go index 7ab6ffc..3b8af23 100644 --- a/backend/admin/handler.go +++ b/backend/admin/handler.go @@ -219,7 +219,7 @@ func (h *Handler) postGameEdit(c echo.Context) error { } gameType := c.FormValue("game_type") - isPublic := c.FormValue("is_public") == "public" + isPublic := (c.FormValue("is_public") != "") displayName := c.FormValue("display_name") durationSeconds, err := strconv.Atoi(c.FormValue("duration_seconds")) if err != nil { diff --git a/backend/admin/templates/game_edit.html b/backend/admin/templates/game_edit.html index 3b9d9de..5ff2ddc 100644 --- a/backend/admin/templates/game_edit.html +++ b/backend/admin/templates/game_edit.html @@ -23,10 +23,7 @@ </div> <div> <label>Is Public</label> - <select name="is_public" required> - <option value="public"{{ if .Game.IsPublic }} selected{{ end }}>Public</option> - <option value="private"{{ if not .Game.IsPublic }} selected{{ end }}>Private</option> - </select> + <input type="checkbox" name="is_public"{{ if .Game.IsPublic }} checked{{ end }}> </div> <div> <label>Duration Seconds</label> |
