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.
 
 

38 lines
1.0 KiB

  1. {{ define "title" }}Recent Comments{{ end }}
  2. {{ define "content" }}
  3. <h1>Recent Comments</h1>
  4. {{ with .V.PagedComments }}
  5. {{ range .Comments }}
  6. {{ if gt .PostID 0 }}
  7. <div class="alert alert-info">
  8. <strong>In post <a href="{{ .Post.Fragment }}">{{ or .Post.Title "Untitled" }}</a>:</strong>
  9. </div>
  10. {{ else if .OriginURL }}
  11. <div class="alert alert-info">
  12. <strong>On page <a href="{{ .OriginURL }}">{{ .OriginURL }}</a>:</strong>
  13. </div>
  14. {{ end }}
  15. {{ RenderComment $.ResponseWriter $.Request . "/comments" false }}
  16. {{ end }}
  17. <div class="alert alert-success">
  18. Page {{ .Page }} of {{ .Pages }} ({{ .Total }} total)
  19. {{ if or (gt .PreviousPage 0) (gt .NextPage 0) }}
  20. [
  21. {{ if gt .NextPage 0 }}
  22. <a href="/comments?page={{ .NextPage }}&per_page={{ .PerPage }}">Older</a>
  23. {{ if gt .PreviousPage 0 }} | {{ end }}
  24. {{ end }}
  25. {{ if gt .PreviousPage 0 }}
  26. <a href="/comments?page={{ .PreviousPage }}&per_page={{ .PerPage }}">Newer</a>
  27. {{ end }}
  28. ]
  29. {{ end }}
  30. </div>
  31. {{ end }}
  32. {{ end }}