cacert-boardvoting/boardvoting/templates/create_motion_form.html
Jan Dittberner 94dcb5bd75 Use static assets for HTML templates
- implement custom http.Filesystem boardvoting.AssetFS
- replace "footer" and "header" with "footer.html" and "header.html"
- change renderTemplate to use Assets
- use boardvoting.GetAssetFS() with http.Fileserver
2018-03-29 21:26:12 +02:00

73 lines
No EOL
3.3 KiB
HTML

{{ template "header.html" . }}
<div class="column">
<div class="ui basic segment">
<div class="ui floated right secondary menu">
<a href="/motions/" class="item" title="Show all votes">Back to motions</a>
</div>
</div>
</div>
<div class="column">
<div class="ui raised segment">
<form action="/newmotion/" method="post">
<div class="ui form{{ if .Form.Errors }} error{{ end }}">
<div class="three fields">
<div class="field">
<label>ID:</label>
(generated on submit)
</div>
<div class="field">
<label>Proponent:</label>
{{ .Voter.Name }}
</div>
<div class="field">
<label>Proposed date/time:</label>
(auto filled to current date/time)
</div>
</div>
<div class="required field{{ if .Form.Errors.Title }} error{{ end }}">
<label for="Title">Title:</label>
<input id="Title" name="Title" type="text" value="{{ .Form.Title }}">
</div>
<div class="required field{{ if .Form.Errors.Content }} error{{ end }}">
<label for="Content">Text:</label>
<textarea id="Content" name="Content">{{ .Form.Content }}</textarea>
</div>
<div class="two fields">
<div class="required field{{ if .Form.Errors.VoteType }} error{{ end }}">
<label for="VoteType">Vote type:</label>
<select id="VoteType" name="VoteType">
<option value="0"
{{ if eq "0" .Form.VoteType }}selected{{ end }}>
Motion
</option>
<option value="1"
{{ if eq "1" .Form.VoteType }}selected{{ end }}>
Veto
</option>
</select>
</div>
<div class="required field{{ if .Form.Errors.Due }} error{{ end }}">
<label for="Due">Due: (autofilled from chosen
option)</label>
<select id="Due" name="Due">
<option value="+3 days">In 3 Days</option>
<option value="+7 days">In 1 Week</option>
<option value="+14 days">In 2 Weeks</option>
<option value="+28 days">In 4 Weeks</option>
</select>
</div>
</div>
{{ with .Form.Errors }}
<div class="ui error message">
{{ with .Title }}<p>{{ . }}</p>{{ end }}
{{ with .Content }}<p>{{ . }}</p>{{ end }}
{{ with .VoteType }}<p>{{ . }}</p>{{ end }}
{{ with .Due }}<p>{{ . }}</p>{{ end }}
</div>
{{ end }}
<button class="ui button" type="submit">Propose</button>
</div>
</form>
</div>
</div>
{{ template "footer.html" . }}