2019-04-14 03:59:53 +02:00
|
|
|
{{ define "Title" }}{{ or .Prefix "Řady" }}{{ end }}
|
|
|
|
{{ define "Content" }}
|
|
|
|
|
2019-04-15 01:10:48 +02:00
|
|
|
{{ if .ErrorInvalidPrefix }}
|
|
|
|
<p>Chyba: Neplatný prefix.
|
|
|
|
{{ else if .ErrorSeriesAlreadyExists }}
|
|
|
|
<p>Chyba: Řada s tímto prefixem už existuje.
|
|
|
|
{{ else if .ErrorCannotChangePrefix }}
|
|
|
|
<p>Chyba: Prefix nelze měnit.
|
|
|
|
{{ else if .ErrorNoSuchSeries }}
|
|
|
|
<p>Chyba: Řada neexistuje.
|
|
|
|
{{ else if .ErrorSeriesInUse }}
|
|
|
|
<p>Chyba: Řada se používá.
|
|
|
|
{{ else if .Error }}
|
|
|
|
<p>Chyba: {{ .Error }}
|
|
|
|
{{ end }}
|
|
|
|
|
2019-04-14 03:59:53 +02:00
|
|
|
{{ if .Prefix }}
|
|
|
|
<h2>{{ .Prefix }}</h2>
|
|
|
|
|
|
|
|
{{ if .Description }}
|
|
|
|
<p>{{ .Description }}
|
|
|
|
{{ end }}
|
|
|
|
{{ else }}
|
|
|
|
<section>
|
2019-04-16 03:56:53 +02:00
|
|
|
<form method=post action="series">
|
|
|
|
<header>
|
|
|
|
<h3>Nová řada</h3>
|
|
|
|
<input type=text name=prefix placeholder="Prefix řady">
|
|
|
|
<input type=text name=description placeholder="Popis řady"
|
|
|
|
><input type=submit value="Uložit">
|
|
|
|
</header>
|
2019-04-14 03:59:53 +02:00
|
|
|
</form>
|
|
|
|
</section>
|
|
|
|
|
2019-04-14 23:19:25 +02:00
|
|
|
{{ range .AllSeries }}
|
2019-04-14 03:59:53 +02:00
|
|
|
<section>
|
2019-04-16 03:56:53 +02:00
|
|
|
<header>
|
|
|
|
<h3><a href="series?prefix={{ .Prefix }}">{{ .Prefix }}</a></h3>
|
|
|
|
{{- with $count := len .Containers }}
|
|
|
|
{{- if eq $count 1 }}
|
|
|
|
<p>{{ $count }} obal
|
|
|
|
{{- else if and (ge $count 2) (le $count 4) }}
|
|
|
|
<p>{{ $count }} obaly
|
|
|
|
{{- else if gt $count 0 }}
|
|
|
|
<p>{{ $count }} obalů
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
<form method=post action="series?prefix={{ .Prefix }}">
|
|
|
|
<input type=text name=description value="{{ .Description }}"
|
|
|
|
><input type=submit value="Uložit">
|
|
|
|
</form>
|
|
|
|
<form method=post action="series?prefix={{ .Prefix }}&remove">
|
|
|
|
<input type=submit value="Odstranit">
|
|
|
|
</form>
|
|
|
|
</header>
|
2019-04-14 03:59:53 +02:00
|
|
|
</section>
|
|
|
|
{{ else }}
|
|
|
|
<p>Nejsou žádné řady.
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ end }}
|