This repository has been archived on 2021-09-01. You can view files and clone it, but cannot push or open issues or pull requests.
goddit/templates/post_create.html

29 lines
1.4 KiB
HTML
Raw Permalink Normal View History

{{define "header"}}
<h5>Create a new post in</h5>
<h1 class="mb-0">{{.Thread.Title}}</h1>
{{end}}
{{define "content"}}
<form action=/threads/{{.Thread.ID}} method="POST">
2021-08-29 16:55:23 +02:00
{{.CSRF}}
<div class="form-group">
<label>Title</label>
2021-08-29 18:22:08 +02:00
<input name="title" type="text" class="form-control {{with .Form.Errors.Title}}is-invalid{{end}}" placeholder="Give your post a great title" value="{{with .Form.Title}}{{.}}{{end}}">
{{with .Form.Errors.Title}}
<div class="invalid-feedack">{{.}}</div>
{{end}}
</div>
<div class="form-group">
<label>Text</label>
2021-08-29 18:22:08 +02:00
<textarea name="content" class="form-control {{with .Form.Errors.Content}}is-invalid{{end}}" rows="3" placeholder="Tell people about your thoughts">
{{- with .Form.Content}}{{.}}{{end -}}
</textarea>
{{with .Form.Errors.Content}}
<div class="invalid-feedack">{{.}}</div>
{{end}}
</div>
<button type="submit" class="btn btn-primary">Submit Post</button>
</form>
{{end}}