A web blog and personal homepage engine written in Go.
You can not 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
946 B

{{ 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 }}