diff options
author | Přemysl Janouch <p@janouch.name> | 2019-04-14 22:30:40 +0200 |
---|---|---|
committer | Přemysl Janouch <p@janouch.name> | 2019-04-14 22:30:40 +0200 |
commit | 1331f3b5642f521236fcb1ec21ee43d5b76c0b91 (patch) | |
tree | 1213c2f2014cf0eff5a4a881b02cbebf91a604b8 /cmd/sklad/container.tmpl | |
parent | 7d9410c6b3a724e3670941f7ec2d00e7966d0b1a (diff) | |
download | sklad-1331f3b5642f521236fcb1ec21ee43d5b76c0b91.tar.gz sklad-1331f3b5642f521236fcb1ec21ee43d5b76c0b91.tar.xz sklad-1331f3b5642f521236fcb1ec21ee43d5b76c0b91.zip |
Move commands under cmd/
Diffstat (limited to 'cmd/sklad/container.tmpl')
-rw-r--r-- | cmd/sklad/container.tmpl | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/cmd/sklad/container.tmpl b/cmd/sklad/container.tmpl new file mode 100644 index 0000000..4bacae8 --- /dev/null +++ b/cmd/sklad/container.tmpl @@ -0,0 +1,99 @@ +{{ define "Title" }}{{/* +*/}}{{ if .Container }}{{ .Container.Id }}{{ else }}Obaly{{ end }}{{ end }} +{{ define "Content" }} + +{{ if .Container }} + +<section> +<header> + <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={{ .Container.Id }}&remove"> + <input type=submit value="Odstranit"> + </form> +</header> + +<form method=post action="/?id={{ .Container.Id }}"> +<textarea name=description rows=5> +{{ .Container.Description }} +</textarea> +<footer> + <div> + <label for=series>Řada:</label> + <select name=series id=series> +{{ range $prefix, $desc := .AllSeries }} + <option value="{{ $prefix }}" + {{ 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="{{ .Container.Parent }}"> + </div> + <input type=submit value="Uložit"> +</footer> +</form> +</section> + +<h2>Podobaly</h3> + +{{ else }} +<section> +<header> + <h2>Nový obal</h2> +</header> +<form method=post action="/"> +<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> +{{ end }} + </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> + +<h2>Obaly nejvyšší úrovně</h2> +{{ end }} + +{{ range .Children }} +<section> +<header> + <h3><a href="/?id={{ .Id }}">{{ .Id }}</a></h3> + <form method=post action="/label?id={{ .Id }}"> + <input type=submit value="Vytisknout štítek"> + </form> + <form method=post action="/?id={{ .Id }}&remove"> + <input type=submit value="Odstranit"> + </form> +</header> +{{ 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ý. +{{ end }} + +{{ end }} |