diff --git a/templates/pages/categories.html b/templates/pages/categories.html index 003f9b7..315231b 100644 --- a/templates/pages/categories.html +++ b/templates/pages/categories.html @@ -1,22 +1,35 @@ {{define "body"}} -

Categories

-{{template "flashes" .}} - - -{{range $category := .categories}} - {{template "row-category" dict "category" $category "categories" $.categories}} -{{end}} - +

Categories

+ {{template "flashes" .}} + {{range $category := .categories}} + {{template "row-category" dict "category" $category "categories" $.categories}} + {{end}} + +
+
+
+ +
+
+ {{template "select-category" dict "categories" .categories "id" -1}} +
+
+ +
+
+
{{end}} + {{define "row-category"}}
- -
{{stringTimes .category.Depth "- "}} - - {{.category.Name}}
@@ -24,16 +37,11 @@
- + {{if $.category.Parent.Valid }} + {{template "select-category" dict "categories" .categories "id" $.category.Parent.Value}} + {{else}} + {{template "select-category" dict "categories" .categories "id" -1}} + {{end}}
@@ -44,9 +52,27 @@ {{end}} + +{{define "select-category"}} + +{{end}} + {{define "option-category"}} {{range $child := .category.Children}} {{template "option-category" dict "category" $child "id" $.id}} - {{end}} + {{end}} {{end}} \ No newline at end of file