2017-11-26 23:53:10 +00:00
|
|
|
{{ $t := .Thread }}
|
|
|
|
{{ $a := .Authors }}
|
|
|
|
|
|
|
|
<p>
|
|
|
|
{{- if eq (len $t.Comments) 1 -}}
|
|
|
|
There is 1 comment on this page.
|
|
|
|
{{- else -}}
|
|
|
|
There are {{ len $t.Comments }} comments on this page.
|
2017-11-27 02:52:14 +00:00
|
|
|
{{- end }}
|
|
|
|
<a href="#add-comment">Add yours.</a>
|
2017-11-26 23:53:10 +00:00
|
|
|
</p>
|
|
|
|
|
|
|
|
{{ range $t.Comments }}
|
|
|
|
{{ template "comment" . }}
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
<h3 id="add-comment">Add a Comment</h3>
|
|
|
|
|
|
|
|
<form action="/comments" method="POST">
|
|
|
|
<input type="hidden" name="_csrf" value="{{ .CSRF }}">
|
|
|
|
<input type="hidden" name="thread" value="{{ .Thread.ID }}">
|
|
|
|
<input type="hidden" name="subject" value="{{ .Subject }}">
|
|
|
|
<input type="hidden" name="origin" value="{{ .OriginURL }}">
|
|
|
|
|
2017-11-27 02:52:14 +00:00
|
|
|
{{ template "comment-form" .NewComment }}
|
2017-11-26 23:53:10 +00:00
|
|
|
|
|
|
|
<button type="submit"
|
|
|
|
name="submit"
|
|
|
|
value="preview"
|
|
|
|
class="btn btn-primary">Preview</button>
|
|
|
|
<button type="submit"
|
|
|
|
name="submit"
|
|
|
|
value="post"
|
|
|
|
class="btn btn-danger">Post</button>
|
|
|
|
</form>
|