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
1.0 KiB

{{ define "title" }}Recent Comments{{ end }}
{{ define "content" }}
<h1>Recent Comments</h1>
{{ with .V.PagedComments }}
{{ range .Comments }}
{{ if gt .PostID 0 }}
<div class="alert alert-info">
<strong>In post <a href="{{ .Post.Fragment }}">{{ or .Post.Title "Untitled" }}</a>:</strong>
</div>
{{ else if .OriginURL }}
<div class="alert alert-info">
<strong>On page <a href="{{ .OriginURL }}">{{ .OriginURL }}</a>:</strong>
</div>
{{ end }}
{{ RenderComment $.ResponseWriter $.Request . "/comments" false }}
{{ end }}
<div class="alert alert-success">
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 }}
</div>
{{ end }}
{{ end }}