{{ template "header.html" . }}
{{ template "headeronegroup.html" . }}
<main>
<div class="outline">
{{ if .Post.Pending }}(pending) {{ end }}<a href="{{ .Post.Link }}" referrerpolicy="origin">{{ .Post.Title }}</a>
<span class="size08">
{{ if .Post.Site }}({{ .Post.Site }}){{ end }}
<br>from <a href="/u/{{ .Post.PersonName }}">{{ .Post.PersonName }}</a> to <a href="/g/{{ .Post.GroupName }}">{{ .Post.GroupName }}</a> on {{ .Post.Date.Local.Format "02 Jan 2006 15:04 -0700" }}
<br><a href="{{ .Post.APid }}">{{ .Post.APid }}</a>
</span>
<p>{{ .Post.HTContent }}
{{ range .Post.Attachments }}
<p><img src="/file/{{ .Xid }}" title="{{ .Desc }}" alt="{{ .Desc }}">
{{ end }}
<p>{{ range .Post.Tags }}{{ . }} {{ end }}
</p>
{{ if .UserInfo }}
{{ if .Post.IsShared .UserInfo.Person.ID }}
<form class="inline" action="/unshare" method="POST">
<input type="hidden" name="postxid" value="{{ .Post.Xid }}">
<button>unshare</button>
</form>
{{ else }}
<form class="inline" action="/share" method="POST">
<input type="hidden" name="postxid" value="{{ .Post.Xid }}">
<button>share</button>
</form>
{{ end }}
{{ if .Post.IsSubbed .UserInfo.ID }}
<form class="inline" action="/unsubscribe" method="POST">
<input type="hidden" name="post" value="{{ .Post.Xid }}">
<button>unsubscribe</button>
</form>
{{ else }}
<form class="inline" action="/subscribe" method="POST">
<input type="hidden" name="post" value="{{ .Post.Xid }}">
<button>subscribe</button>
</form>
{{ end }}
{{ if .Post.Pending }}{{ if .Post.CanApprove .UserInfo }}
<button><a href="{{ .Post.Rel }}/approve">approve</a></button>
{{ end }}{{ end }}
{{ if .Post.CanMod .UserInfo }}
<button><a href="{{ .Post.Rel }}/edit">edit</a></button>
{{ end }}
<button><a href="/report?what={{ .Post.APid }}">report</a></button>
{{ end }}
</div>
<div class="commentbox size08">
{{ $userinfo := .UserInfo }}
{{ range .Comments }}
{{ template "fragcomment.html" map "Comment" . "UserInfo" $userinfo }}
{{ end }}
</div>
{{ if .UserInfo }}{{ if .UserInfo.IsApproved }}
{{ template "formcomment.html" . }}
{{ end }}{{ end }}
</main>
