GoBlog/templates/commentsadmin.gohtml

36 lines
1.2 KiB
Plaintext

{{ define "title" }}
<title>{{ string .Blog.Lang "comments" }} - {{ mdtext .Blog.Title }}</title>
{{ end }}
{{ define "main" }}
<main>
<h1>{{ string .Blog.Lang "comments" }}</h1>
{{ $blog := .Blog }}
{{ range $i, $comment := .Data.Comments }}
<div class="p">
<p>
ID: {{ $comment.ID }}<br/>
Target: <a href="{{ $comment.Target }}" target="_blank">{{ $comment.Target }}</a><br/>
Name: {{ if $comment.Website }}<a href="{{ $comment.Website }}" target="_blank" rel="nofollow noopener noreferrer ugc">{{ $comment.Name }}</a>{{ else }}{{ $comment.Name }}{{ end }}
</p>
<p>
{{ html $comment.Comment }}
</p>
<form method="post">
<input type="hidden" name="commentid" value="{{ $comment.ID }}">
<input type="submit" formaction="comment/delete" value="{{ string $blog.Lang "delete" }}">
</form>
</div>
{{ end }}
{{ if .Data.HasPrev }}
<p><a href="{{ .Data.Prev }}">{{ string .Blog.Lang "prev" }}</a></p>
{{ end }}
{{ if .Data.HasNext }}
<p><a href="{{ .Data.Next }}">{{ string .Blog.Lang "next" }}</a></p>
{{ end }}
</main>
{{ end }}
{{ define "commentsadmin" }}
{{ template "base" . }}
{{ end }}