gophertype/pvt-www/_builtin/comments/recent.gohtml

38 lines
946 B
Plaintext

{{ define "title" }}Recent Comments{{ end }}
{{ define "content" }}
<h1>Recent Comments</h1>
{{ with .V.PagedComments }}
<p>
Page {{ .Page }} of {{ .Pages }} ({{ .Total }} total)
{{ if or (gt .PreviousPage 0) (gt .NextPage 0) }}
[
{{ if gt .NextPage 0 }}
<a href="/comments?page={{ .NextPage }}&per_page={{ .PerPage }}">Older</a>
{{ if gt .PreviousPage 0 }} | {{ end }}
{{ end }}
{{ if gt .PreviousPage 0 }}
<a href="/comments?page={{ .PreviousPage }}&per_page={{ .PerPage }}">Newer</a>
{{ end }}
]
{{ end }}
</p>
{{ range .Comments }}
{{ if gt .PostID 0 }}
<p>
<strong>In post <a href="{{ .Post.Fragment }}">{{ or .Post.Title "Untitled" }}</a>:</strong>
</p>
{{ else if .OriginURL }}
<p>
<strong>On page <a href="{{ .OriginURL }}">{{ .OriginURL }}</a>:</strong>
</p>
{{ end }}
{{ RenderComment $.ResponseWriter $.Request . "/comments" false }}
{{ end }}
{{ end }}
{{ end }}