2015-05-02 19:28:11 +00:00
|
|
|
{{define "body"}}
|
2015-09-24 04:12:57 +00:00
|
|
|
<h2 class="form-add-heading">{{if eq .mode "add"}}Add Link{{else}}Edit News{{end}}</h2>
|
2015-05-02 19:28:11 +00:00
|
|
|
{{template "flashes" .}}
|
2015-09-24 04:12:57 +00:00
|
|
|
<form class="form-add" action="{{if eq "add" .mode}}/add{{else}}/edit{{end}}" method="post" role="form" class="container col-form">
|
2015-09-21 15:26:31 +00:00
|
|
|
<input type="hidden" name="popup" value="{{.popup}}" />
|
|
|
|
<input type="hidden" name="id" value="{{.id}}" />
|
2015-05-02 19:28:11 +00:00
|
|
|
<div class="row">
|
2015-05-03 16:31:36 +00:00
|
|
|
<div class="col-xs-2">Link:</div><div class="col-xs-10"><input type="text" class="form-control" name="link" placeholder="Link" value="{{.link}}"/></div>
|
2015-05-05 14:09:10 +00:00
|
|
|
<div class="col-xs-2">Title:</div><div class="col-xs-10"><input type="text" class="form-control" name="title" placeholder="Title" value="{{.title}}"/></div>
|
2015-05-16 21:29:31 +00:00
|
|
|
<div class="col-xs-2">Category:</div><div class="col-xs-10 add-category-col">
|
2015-09-17 15:03:53 +00:00
|
|
|
<select class="form-control add-category" name="category" placeholder="Category">
|
2015-05-16 21:29:31 +00:00
|
|
|
<option value="-1">-- Pick a Category --</option>
|
2015-05-12 05:06:28 +00:00
|
|
|
{{range $category := .categories}}
|
2015-09-22 15:30:51 +00:00
|
|
|
{{template "option-category" dict "category" $category "category_id" $.category_id}}
|
2015-05-07 15:31:18 +00:00
|
|
|
{{end}}
|
|
|
|
</select>
|
|
|
|
</div>
|
2015-09-18 05:49:54 +00:00
|
|
|
<div class="col-xs-2">Notes:</div><div class="col-xs-10"><textarea class="form-control" name="notes" placeholder="Notes" rows="5" cols="80">{{.notes}}</textarea></div>
|
2015-11-03 16:16:59 +00:00
|
|
|
<div class="col-xs-2"></div><div class="col-xs-10">{{ .csrfField }}<input class="add-submit btn btn-lg btn-primary btn-block" type="submit" value="{{if eq .mode "add"}}Add Link{{else}}Commit Edit{{end}}" /></div>
|
2015-05-02 19:28:11 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
</form>
|
2015-05-07 15:31:18 +00:00
|
|
|
{{end}}
|
|
|
|
|
|
|
|
|
2015-05-12 05:06:28 +00:00
|
|
|
{{define "option-category"}}
|
2015-09-22 15:30:51 +00:00
|
|
|
<option value="{{.category.Id}}" {{if eq .category.Id .category_id}}selected="true"{{end}} >{{.category.ToString}}</option>
|
|
|
|
{{range $child := .category.Children}}
|
|
|
|
{{template "option-category" dict "category" $child "category_id" $.category_id}}
|
|
|
|
{{end}}
|
2015-05-03 16:31:36 +00:00
|
|
|
{{end}}
|