You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.4 KiB
Cheetah
37 lines
1.4 KiB
Cheetah
{{define "title"}}Create a New Snippet{{end}}
|
|
|
|
{{define "main"}}
|
|
<form action='/snippet/create' method='POST'>
|
|
<div>
|
|
<label>Title:</label>
|
|
<!-- Use the `with` action to render the value of .Form.FieldErrors.title
|
|
if it is not empty. -->
|
|
{{with .Form.FieldErrors.title}}
|
|
<label class='error'>{{.}}</label>
|
|
{{end}}
|
|
<input type='text' name='title' value="{{.Form.Title}}">
|
|
</div>
|
|
<div>
|
|
<label>Content:</label>
|
|
<!-- Likewise render the value of .Form.FieldErrors.content if it is not
|
|
empty. -->
|
|
{{with .Form.FieldErrors.content}}
|
|
<label class='error'>{{.}}</label>
|
|
{{end}}
|
|
<textarea name='content'>{{.Form.Content}}</textarea>
|
|
</div>
|
|
<div>
|
|
<label>Delete in:</label>
|
|
<!-- And render the value of .Form.FieldErrors.expires if it is not empty. -->
|
|
{{with .Form.FieldErrors.expires}}
|
|
<label class='error'>{{.}}</label>
|
|
{{end}}
|
|
<input type='radio' name='expires' value='365' {{if (eq .Form.Expires 365)}}checked{{end}}> One Year
|
|
<input type='radio' name='expires' value='7' {{if (eq .Form.Expires 7)}}checked{{end}}> One Week
|
|
<input type='radio' name='expires' value='1' {{if (eq .Form.Expires 1)}}checked{{end}}> One Day
|
|
</div>
|
|
<div>
|
|
<input type='submit' value='Publish snippet'>
|
|
</div>
|
|
</form>
|
|
{{end}} |