diff options
Diffstat (limited to 'sklad/container.tmpl')
-rw-r--r-- | sklad/container.tmpl | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/sklad/container.tmpl b/sklad/container.tmpl index cbc8ea4..4bacae8 100644 --- a/sklad/container.tmpl +++ b/sklad/container.tmpl @@ -1,22 +1,23 @@ -{{ define "Title" }}{{ or .Id "Obaly" }}{{ end }} +{{ define "Title" }}{{/* +*/}}{{ if .Container }}{{ .Container.Id }}{{ else }}Obaly{{ end }}{{ end }} {{ define "Content" }} -{{ if .Id }} +{{ if .Container }} <section> <header> - <h2>{{ .Id }}</h2> - <form method=post action="/label?id={{ .Id }}"> + <h2>{{ .Container.Id }}</h2> + <form method=post action="/label?id={{ .Container.Id }}"> <input type=submit value="Vytisknout štítek"> </form> - <form method=post action="/?id={{ .Id }}&remove"> + <form method=post action="/?id={{ .Container.Id }}&remove"> <input type=submit value="Odstranit"> </form> </header> -<form method=post action="/?id={{ .Id }}"> +<form method=post action="/?id={{ .Container.Id }}"> <textarea name=description rows=5> -{{ .Description }} +{{ .Container.Description }} </textarea> <footer> <div> @@ -24,14 +25,14 @@ <select name=series id=series> {{ range $prefix, $desc := .AllSeries }} <option value="{{ $prefix }}" - {{ if eq $prefix $.Series }}selected{{ end }} + {{ if eq $prefix $.Container.Series }}selected{{ end }} >{{ $prefix }} — {{ $desc }}</option> {{ end }} </select> </div> <div> <label for=parent>Nadobal:</label> - <input type=text name=parent id=parent value="{{ .Parent }}"> + <input type=text name=parent id=parent value="{{ .Container.Parent }}"> </div> <input type=submit value="Uložit"> </footer> @@ -54,7 +55,6 @@ <select name=series id=series> {{ range $prefix, $desc := .AllSeries }} <option value="{{ $prefix }}" - {{ if eq $prefix $.Series }}selected{{ end }} >{{ $prefix }} — {{ $desc }}</option> {{ end }} </select> @@ -74,7 +74,7 @@ {{ range .Children }} <section> <header> - <h3><a href="/container?id={{ .Id }}">{{ .Id }}</a></h3> + <h3><a href="/?id={{ .Id }}">{{ .Id }}</a></h3> <form method=post action="/label?id={{ .Id }}"> <input type=submit value="Vytisknout štítek"> </form> @@ -85,6 +85,12 @@ {{ if .Description }} <p>{{ .Description }} {{ end }} +{{ if .Children }} +<p> +{{ range .Children }} +<a href="/?id={{ .Id }}">{{ .Id }}</a> +{{ end }} +{{ end }} </section> {{ else }} <p>Obal je prázdný. |