aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/admin/templates/tournament_edit.html
blob: 6c1ad6cc62f9dfb2fba8f166e4f43c198079f9da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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 }}