admin: tymy, pridani a mazani

This commit is contained in:
2025-10-09 16:19:44 +02:00
parent f6075c5eb6
commit 045c91c4a0
8 changed files with 105 additions and 13 deletions

View File

@@ -31,6 +31,8 @@
Jméno: <input type="text" name="name" required>
<button type="submit">Přidat úroveň</button>
</form>
<hr>
<a href="/admin">Zpět na admin panel</a>
</body>
</html>

View File

@@ -34,6 +34,8 @@
</table>
<hr>
{{end}}
<hr>
<a href="/admin">Zpět na admin panel</a>
</body>
</html>

View File

@@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<title>Admin Panel</title>
<title>Týmy</title>
</head>
<body>
@@ -14,13 +14,21 @@
<th>Obtížnost</th>
<th>Poslední šifra</th>
<th>Penalizace (minuty)</th>
<th>Smazat tým</th>
</th>
</tr>
{{range .}}
{{range .Teams}}
<tr>
<td>{{.TeamName}}</td>
<td>{{.Difficulty}}</td>
<td>{{.LastCipher}}</td>
<td>{{.Penalties}}</td>
<td>
<form action="/admin/teams" method="post">
<input type="hidden" name="delete" value="{{.TeamName}}">
<button type="submit">Smazat</button>
</form>
</td>
</tr>
{{end}}
</table>
@@ -28,6 +36,19 @@
<p>Vynulování penalizací a posledních šifer.</p>
<a href="/admin/start">Start Závodu</a>
<hr>
<h2>Přidat tým</h2>
<form method="post" action="/admin/teams">
Název týmu: <input type="text" name="name" required>
Obtížnost:
<select name="difficulty">
{{range .Difficulties}}
<option value="{{.ID}}">{{.Name}}</option>
{{end}}
</select>
Heslo: <input type="text" name="password" required>
<input type="submit" value="Přidat tým">
</form>
<hr>
<a href="/admin">Zpět na admin panel</a>
</body>