diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-02-18 22:38:15 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-02-18 22:38:15 +0900 |
| commit | 9f9efc2bc07810d2e06b37bad94e5922681eadef (patch) | |
| tree | 79bcce2bf065a7ea282aa7855822c3bdee92ee7c /backend/admin/templates/tournament_edit.html | |
| parent | c095200dc79f24c0cd17a2e3ba15c85a2971ea9a (diff) | |
| download | phperkaigi-2026-albatross-9f9efc2bc07810d2e06b37bad94e5922681eadef.tar.gz phperkaigi-2026-albatross-9f9efc2bc07810d2e06b37bad94e5922681eadef.tar.zst phperkaigi-2026-albatross-9f9efc2bc07810d2e06b37bad94e5922681eadef.zip | |
feat: refactor tournament to generic DB-backed N-person bracket
Replace hardcoded 6-person tournament with a generic single-elimination
bracket system backed by new DB tables (tournaments, tournament_entries,
tournament_matches). Includes admin CRUD, standard seeding algorithm,
bye handling, and a CSS Grid bracket renderer on the frontend.
Add comprehensive tests for backend API/admin handlers, seeding logic,
and frontend bracket component.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'backend/admin/templates/tournament_edit.html')
| -rw-r--r-- | backend/admin/templates/tournament_edit.html | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/backend/admin/templates/tournament_edit.html b/backend/admin/templates/tournament_edit.html new file mode 100644 index 0000000..6c1ad6c --- /dev/null +++ b/backend/admin/templates/tournament_edit.html @@ -0,0 +1,48 @@ +{{ template "base.html" . }} + +{{ define "breadcrumb" }} +<a href="{{ .BasePath }}admin/dashboard">Dashboard</a> | <a href="{{ .BasePath }}admin/tournaments">Tournaments</a> +{{ end }} + +{{ define "content" }} +<form method="post"> + <div> + <label>Display Name</label> + <input type="text" name="display_name" value="{{ .Tournament.DisplayName }}" required> + </div> + + <h3>Bracket (size={{ .Tournament.BracketSize }}, rounds={{ .Tournament.NumRounds }})</h3> + + <h3>Entries (seed → user)</h3> + {{ range .Seeds }} + {{ $seed := . }} + <div> + <label>Seed {{ $seed }}</label> + <select name="seed_{{ $seed }}"> + <option value="0">-- none (bye) --</option> + {{ range $.Users }} + <option value="{{ .UserID }}" {{ if eq .UserID (index $.SeedUserMap $seed) }}selected{{ end }}>{{ .Username }} (id={{ .UserID }})</option> + {{ end }} + </select> + </div> + {{ end }} + + <h3>Matches (game assignment)</h3> + {{ range .Matches }} + <div> + <label>Round {{ .Round }} Pos {{ .Position }} ({{ .Description }})</label> + {{ $matchID := .MatchID }} + <select name="match_{{ $matchID }}"> + <option value="0">-- no game --</option> + {{ range $.Games }} + <option value="{{ .GameID }}" {{ if eq .GameID (index $.MatchGameMap $matchID) }}selected{{ end }}>{{ .DisplayName }} (id={{ .GameID }})</option> + {{ end }} + </select> + </div> + {{ end }} + + <div> + <button type="submit">Save</button> + </div> +</form> +{{ end }} |
