Implement creating new games
This commit is contained in:
31
ui/html/game-overview.page.tmpl.html
Normal file
31
ui/html/game-overview.page.tmpl.html
Normal file
@@ -0,0 +1,31 @@
|
||||
{{- template "base" . -}}
|
||||
|
||||
{{- define "additional-css" -}}
|
||||
{{ end -}}
|
||||
|
||||
{{- define "additional-js" -}}
|
||||
{{ end -}}
|
||||
|
||||
{{- define "header" }}
|
||||
<h1>{{ .Game.Name }} ({{ .Game.Code }})</h1>
|
||||
{{ end -}}
|
||||
|
||||
{{- define "main" }}
|
||||
<dl>
|
||||
<dt>Vytvořena</dt>
|
||||
<dd>{{ .Game.Created.Format "2006.01.02 15:04:05" }}</dd>
|
||||
<dt>Autor</dt>
|
||||
<dd>{{ .Game.Author }}</dd>
|
||||
</dl>
|
||||
<ol>
|
||||
{{ range .Game.Edges.Questions -}}
|
||||
<li>{{ .Title }} ({{ .DefaultLength }}ms)
|
||||
<ul>
|
||||
{{ range .Edges.Choices -}}
|
||||
<li>{{ .Title }}{{ if .Correct }} (správně){{ end }}</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ol>
|
||||
{{ end -}}
|
||||
@@ -38,9 +38,11 @@
|
||||
</section>
|
||||
<section>
|
||||
<h1>Vytvořit nový kvíz</h1>
|
||||
<form id="new" method="get" action="/new">
|
||||
<label>Jméno kvízu: <input type="text" name="quiz" placeholder="Jméno kvízu"></label>
|
||||
<p>Stáhnout <a href="/template" download>šablonu nového kvízu</a></p>
|
||||
<form id="new" enctype="multipart/form-data" method="post" action="/game">
|
||||
<label>Jméno kvízu: <input type="text" name="name" placeholder="Jméno kvízu"></label>
|
||||
<label>Jméno autora: <input type="text" name="author" placeholder="Jméno"></label>
|
||||
<label>Kvíz: <input type="file" name="game" accept="text/csv"></label>
|
||||
<input type="submit" value="Vytvořit">
|
||||
</form>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user