delete and select

This commit is contained in:
Dan Ballard 2015-05-21 22:55:59 -07:00
parent 4f023f6093
commit 3b004dbeb3
1 changed files with 17 additions and 1 deletions

View File

@ -19,9 +19,25 @@
{{else}}
<div class="col-xs-12 category-row">
{{end}}
{{.Name}}</div>
{{.Name}} <a href="/categories/delete?id={{.Id}}">delete</a>
<select class="form-control category-change-parent" name="category-change-parent-{{.Id}}" >
<option value="-1" {{if not .Parent.Valid}} selected="true"{{end}}>-- None --</option>
{{range $category := .categories}}
{{template "option-category" $category }}
{{end}}
</select>
</div>
{{range $child := .Children}}
{{template "row-category" $child}}
{{end}}
{{end}}
{{define "option-category"}}
<option value="{{.Id}}">{{.ToString}}</option>
{{range $child := .Children}}
{{template "option-category" $child}}
{{end}}
{{end}}