9 changed files with 305 additions and 21 deletions
@ -0,0 +1,37 @@ |
|||
{{ 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 }} |
@ -0,0 +1,24 @@ |
|||
{{ define "title" }}Comment Subscriptions{{ end }} |
|||
{{ define "content" }} |
|||
|
|||
<h1>Comment Subscriptions</h1> |
|||
|
|||
<p> |
|||
This blog allows users to subscribe to comment threads, when they leave their |
|||
e-mail address and opt-in to do so when adding a comment to a page. |
|||
</p> |
|||
|
|||
<p> |
|||
To unsubscribe from a single comment thread, click on the "Unsubscribe" link |
|||
in that email. Or, to remove yourself from <strong>all comment threads</strong>, |
|||
enter your email address below. |
|||
</p> |
|||
|
|||
<form action="/comments/subscription" method="GET"> |
|||
<input type="hidden" name="all" value="true"> |
|||
<h2>Unsubscribe From All</h2> |
|||
|
|||
<input type="email" class="form-control" name="e" placeholder="Email address"> |
|||
<button type="submit" class="btn btn-primary mt-2">Unsubscribe From All</button> |
|||
</form> |
|||
{{ end }} |
@ -0,0 +1,8 @@ |
|||
{{ define "title" }}Guestbook{{ end }} |
|||
{{ define "content" }} |
|||
|
|||
<h1>My Guestbook</h1> |
|||
|
|||
{{ RenderComments .ResponseWriter .Request "My Guestbook" "guestbook" }} |
|||
|
|||
{{ end }} |
Loading…
Reference in new issue