2019-04-14 19:12:31 +02:00
|
|
|
{{ define "Title" }}{{/*
|
|
|
|
*/}}{{ if .Container }}{{ .Container.Id }}{{ else }}Obaly{{ end }}{{ end }}
|
2019-04-13 22:50:08 +02:00
|
|
|
{{ define "Content" }}
|
|
|
|
|
2019-04-15 01:10:48 +02:00
|
|
|
{{ if .ErrorNoSuchSeries }}
|
|
|
|
<p>Chyba: Řada neexistuje.
|
|
|
|
{{ else if .ErrorContainerAlreadyExists }}
|
|
|
|
<p>Chyba: Obal s tímto ID už existuje.
|
|
|
|
{{ else if .ErrorNoSuchContainer }}
|
|
|
|
<p>Chyba: Obal neexistuje.
|
|
|
|
{{ else if .ErrorCannotChangeSeriesNotEmpty }}
|
|
|
|
<p>Chyba: Řadu u neprázdných obalů nelze měnit.
|
|
|
|
{{ else if .ErrorCannotChangeNumber }}
|
|
|
|
<p>Chyba: Číslo obalu v řadě nelze měnit.
|
2019-04-16 00:07:00 +02:00
|
|
|
{{ else if .ErrorWouldContainItself }}
|
|
|
|
<p>Chyba: Obal by obsahoval sám sebe.
|
2019-04-15 01:10:48 +02:00
|
|
|
{{ else if .ErrorContainerInUse }}
|
|
|
|
<p>Chyba: Obal se používá.
|
|
|
|
{{ else if .Error }}
|
|
|
|
<p>Chyba: {{ .Error }}
|
|
|
|
{{ end }}
|
|
|
|
|
2019-04-14 19:12:31 +02:00
|
|
|
{{ if .Container }}
|
2019-04-14 03:59:53 +02:00
|
|
|
|
|
|
|
<section>
|
|
|
|
<header>
|
2019-04-15 02:57:04 +02:00
|
|
|
<h2>{{ .Container.Id }}
|
|
|
|
{{ range .Container.Path }}
|
2019-04-15 03:16:19 +02:00
|
|
|
<small>« <a href="container?id={{ . }}">{{ . }}</a></small>
|
2019-04-15 02:57:04 +02:00
|
|
|
{{ end }}
|
|
|
|
</h2>
|
2019-04-15 23:31:13 +02:00
|
|
|
<form method=post action="label?id={{ .Container.Id }}" target=_blank>
|
2019-04-14 03:59:53 +02:00
|
|
|
<input type=submit value="Vytisknout štítek">
|
|
|
|
</form>
|
2019-04-15 03:16:19 +02:00
|
|
|
<form method=post action="container?id={{ .Container.Id }}&remove">
|
2019-04-14 03:59:53 +02:00
|
|
|
<input type=submit value="Odstranit">
|
|
|
|
</form>
|
|
|
|
</header>
|
|
|
|
|
2019-04-15 03:16:19 +02:00
|
|
|
<form method=post action="container?id={{ .Container.Id }}">
|
2019-04-15 10:52:14 +02:00
|
|
|
<textarea name=description rows="{{ max 5 (lines .Container.Description) }}"
|
|
|
|
placeholder="Popis obalu nebo jeho obsahu">
|
|
|
|
{{ .Container.Description }}</textarea>
|
2019-04-14 03:59:53 +02:00
|
|
|
<footer>
|
|
|
|
<div>
|
|
|
|
<label for=series>Řada:</label>
|
|
|
|
<select name=series id=series>
|
|
|
|
{{ range $prefix, $desc := .AllSeries }}
|
|
|
|
<option value="{{ $prefix }}"
|
2019-04-14 19:12:31 +02:00
|
|
|
{{ if eq $prefix $.Container.Series }}selected{{ end }}
|
2019-04-14 03:59:53 +02:00
|
|
|
>{{ $prefix }} — {{ $desc }}</option>
|
|
|
|
{{ end }}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<label for=parent>Nadobal:</label>
|
2019-04-14 19:12:31 +02:00
|
|
|
<input type=text name=parent id=parent value="{{ .Container.Parent }}">
|
2019-04-14 03:59:53 +02:00
|
|
|
</div>
|
|
|
|
<input type=submit value="Uložit">
|
|
|
|
</footer>
|
|
|
|
</form>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<h2>Podobaly</h3>
|
|
|
|
|
2019-04-14 01:05:05 +02:00
|
|
|
{{ else }}
|
2019-04-14 03:59:53 +02:00
|
|
|
<section>
|
|
|
|
<header>
|
|
|
|
<h2>Nový obal</h2>
|
|
|
|
</header>
|
2019-04-15 03:16:19 +02:00
|
|
|
<form method=post action="container">
|
2019-04-14 03:59:53 +02:00
|
|
|
<textarea name=description rows=5
|
|
|
|
placeholder="Popis obalu nebo jeho obsahu"></textarea>
|
|
|
|
<footer>
|
|
|
|
<div>
|
|
|
|
<label for=series>Řada:</label>
|
|
|
|
<select name=series id=series>
|
|
|
|
{{ range $prefix, $desc := .AllSeries }}
|
|
|
|
<option value="{{ $prefix }}"
|
|
|
|
>{{ $prefix }} — {{ $desc }}</option>
|
2019-04-14 01:05:05 +02:00
|
|
|
{{ end }}
|
2019-04-14 03:59:53 +02:00
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<label for=parent>Nadobal:</label>
|
|
|
|
<input type=text name=parent id=parent value="">
|
|
|
|
</div>
|
|
|
|
<input type=submit value="Uložit">
|
|
|
|
</footer>
|
|
|
|
</form>
|
|
|
|
</section>
|
2019-04-14 01:05:05 +02:00
|
|
|
|
2019-04-14 03:59:53 +02:00
|
|
|
<h2>Obaly nejvyšší úrovně</h2>
|
2019-04-14 01:05:05 +02:00
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ range .Children }}
|
2019-04-14 03:59:53 +02:00
|
|
|
<section>
|
|
|
|
<header>
|
2019-04-15 03:16:19 +02:00
|
|
|
<h3><a href="container?id={{ .Id }}">{{ .Id }}</a>
|
2019-04-15 02:57:04 +02:00
|
|
|
{{ range .Path }}
|
2019-04-15 03:16:19 +02:00
|
|
|
<small>« <a href="container?id={{ . }}">{{ . }}</a></small>
|
2019-04-15 02:57:04 +02:00
|
|
|
{{ end }}
|
|
|
|
</h3>
|
2019-04-15 23:31:13 +02:00
|
|
|
<form method=post action="label?id={{ .Id }}" target=_blank>
|
2019-04-14 03:59:53 +02:00
|
|
|
<input type=submit value="Vytisknout štítek">
|
|
|
|
</form>
|
2019-04-15 03:16:19 +02:00
|
|
|
<form method=post action="container?id={{ .Id }}&remove">
|
2019-04-14 03:59:53 +02:00
|
|
|
<input type=submit value="Odstranit">
|
|
|
|
</form>
|
|
|
|
</header>
|
2019-04-14 01:05:05 +02:00
|
|
|
{{ if .Description }}
|
|
|
|
<p>{{ .Description }}
|
|
|
|
{{ end }}
|
2019-04-14 19:12:31 +02:00
|
|
|
{{ if .Children }}
|
|
|
|
<p>
|
|
|
|
{{ range .Children }}
|
2019-04-15 03:16:19 +02:00
|
|
|
<a href="container?id={{ .Id }}">{{ .Id }}</a>
|
2019-04-14 19:12:31 +02:00
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
2019-04-14 03:59:53 +02:00
|
|
|
</section>
|
2019-04-14 01:05:05 +02:00
|
|
|
{{ else }}
|
|
|
|
<p>Obal je prázdný.
|
|
|
|
{{ end }}
|
2019-04-13 22:50:08 +02:00
|
|
|
|
|
|
|
{{ end }}
|