83 lines
2.6 KiB
Go Template
83 lines
2.6 KiB
Go Template
|
{{ template "header" . }}
|
||
|
|
||
|
{{ if .State }}
|
||
|
<h5 class="card-title mb-2">Уровень</h5>
|
||
|
<table class="table table-bordered mb-4">
|
||
|
<thead class="table-primary">
|
||
|
<th colspan="4">
|
||
|
{{.State.Task.Title}}
|
||
|
</th>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
<tr>
|
||
|
<td>Выдано:</td>
|
||
|
<td>{{ .State.CreatedAt.Format "15:04 02.01.2006" }}</td>
|
||
|
<td>Автопереход:</td>
|
||
|
<td>{{ .State.Deadline.Format "15:04 02.01.2006" }} (через {{ (.State.Deadline.Sub now) | toTime }})</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td colspan="4">{{ .State.Task.Text | markDown }}</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
|
||
|
<table class="table table-bordered mb-4">
|
||
|
<thead class="table-primary">
|
||
|
<th colspan="1">
|
||
|
Ввод кода
|
||
|
</th>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
<tr>
|
||
|
<td>
|
||
|
<form method="post" action="/go/{{ .Game.ID }}/code">
|
||
|
<div class="col-lg-8 px-0">
|
||
|
<div class="mb-3 row">
|
||
|
<div class="col-sm-10">
|
||
|
<input type="text" class="form-control" id="code" name="code">
|
||
|
</div>
|
||
|
<input type="submit" class="col-sm-2 btn btn-outline-primary" value="Ввод" />
|
||
|
</div>
|
||
|
</div>
|
||
|
</form>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
|
||
|
<h5 class="card-title">История игры</h5>
|
||
|
<table class="table table-bordered">
|
||
|
<thead class="table-primary">
|
||
|
<tr>
|
||
|
<th scope="col" class="thin">Уровень</th>
|
||
|
<th scope="col" class="thin">Время начала</th>
|
||
|
<th scope="col" class="thin">Время окончания</th>
|
||
|
<th scope="col">Статус</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
{{ range $i, $a := .History }}
|
||
|
<tr>
|
||
|
<td>{{ inc $i }}</td>
|
||
|
<td>{{ $a.CreatedAt.Format "15:04 02.01.2006" }}</td>
|
||
|
<td>{{ $a.Deadline.Format "15:04 02.01.2006" }}</td>
|
||
|
<td>
|
||
|
{{ if eq $a.Status 0 }}
|
||
|
Текущее
|
||
|
{{ else if eq $a.Status 1 }}
|
||
|
Пройден
|
||
|
{{ else if eq $a.Status 2 }}
|
||
|
Снят
|
||
|
{{ else if eq $a.Status 3 }}
|
||
|
Автопереход
|
||
|
{{ end }}
|
||
|
</td>
|
||
|
</tr>
|
||
|
{{ end }}
|
||
|
</tbody>
|
||
|
</table>
|
||
|
{{ else }}
|
||
|
<p>Вам не предусмотренно следующее задание</p>
|
||
|
{{ end }}
|
||
|
|
||
|
{{ template "footer" . }}
|