Further blog post tweaks
This commit is contained in:
parent
716014c607
commit
9ab533dc32
|
@ -22,81 +22,83 @@
|
|||
</div>
|
||||
|
||||
{{ if not .IsProjectPage }}
|
||||
{{ template "newsletter_signup.html" . }}
|
||||
<div class="pv4">
|
||||
{{ template "newsletter_signup.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
<hr class="m-center mw-site">
|
||||
|
||||
<div class="pt4 m-center mw-site-narrow ph3 ph0-l flex flex-column g2">
|
||||
<div class="flex justify-between">
|
||||
<h3 class="f4">Comments</h3>
|
||||
{{ if .Project.HasBlog }}
|
||||
<a class="flex items-center g2" href="{{ not (not $.User) | ternary .ReplyLink .LoginLink }}">{{ svg "add" }}<span>Leave a Comment</span></a>
|
||||
{{ end }}
|
||||
</div>
|
||||
<div class="flex flex-column g2">
|
||||
{{ range .Comments }}
|
||||
<div class="bg3 pa3 flex flex-column g3">
|
||||
<div class="flex link-normal">
|
||||
<img class="avatar avatar-user mr2" src="{{ .Author.AvatarUrl }}">
|
||||
<div class="flex flex-column g1">
|
||||
<div class="flex items-center g2">
|
||||
<a class="b" href="{{ .Author.ProfileUrl }}">{{ .Author.Name }}</a>
|
||||
{{ if .Author.IsStaff }}
|
||||
<div class="badge staff"></div>
|
||||
{{ end }}
|
||||
</div>
|
||||
<div class="f6">
|
||||
{{ timehtml (absoluteshortdate .PostDate) .PostDate }}
|
||||
{{- if .Editor -}}
|
||||
.
|
||||
Edited by <a class="name" href="{{ .Editor.ProfileUrl }}">{{ coalesce .Editor.Name .Editor.Username }}</a>
|
||||
on {{ timehtml (absolutedate .EditDate) .EditDate }}
|
||||
{{ with .EditReason }}
|
||||
Reason: {{ . }}
|
||||
{{ end }}
|
||||
</span>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-grow-1"></div>
|
||||
<div>
|
||||
{{ if and $.User $.Project.HasBlog }}
|
||||
<div class="flex">
|
||||
{{ if or (eq .Author.ID $.User.ID) $.User.IsStaff }}
|
||||
<a class="delete action button" href="{{ .DeleteUrl }}" title="Delete">✖</a>
|
||||
<a class="edit action button" href="{{ .EditUrl }}" title="Edit">✎</a>
|
||||
{{ end }}
|
||||
{{ if or (not $.Thread.Locked) $.User.IsStaff }}
|
||||
{{ if $.Thread.Locked }}
|
||||
WARNING: locked thread - use power responsibly!
|
||||
{{ end }}
|
||||
<a class="reply action button" href="{{ .ReplyUrl }}" title="Reply">↪</a>
|
||||
{{ end }}
|
||||
<span class="postid">
|
||||
<a name="{{ .ID }}" href="{{ .Url }}">#{{ .ID }}</a>
|
||||
</span>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="post-content overflow-x-auto">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
</div>
|
||||
{{ else }}
|
||||
<div class="bg3 tc pv4 f7">
|
||||
No comments yet.
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ if .Project.HasBlog }}
|
||||
{{ if gt (len .Comments) 0 }}
|
||||
<div class="flex justify-end">
|
||||
<div class="pv4 ph3 ph0-l bg1 bt bb flex">
|
||||
<div class="m-center w-100 mw-site-narrow flex flex-column g2">
|
||||
<div class="flex justify-between">
|
||||
<h3 class="f4">Comments</h3>
|
||||
{{ if .Project.HasBlog }}
|
||||
<a class="flex items-center g2" href="{{ not (not $.User) | ternary .ReplyLink .LoginLink }}">{{ svg "add" }}<span>Leave a Comment</span></a>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
<div class="flex flex-column g2">
|
||||
{{ range .Comments }}
|
||||
<div class="bg3 pa3 flex flex-column g3">
|
||||
<div class="flex link-normal">
|
||||
<img class="avatar avatar-user mr2" src="{{ .Author.AvatarUrl }}">
|
||||
<div class="flex flex-column g1">
|
||||
<div class="flex items-center g2">
|
||||
<a class="b" href="{{ .Author.ProfileUrl }}">{{ .Author.Name }}</a>
|
||||
{{ if .Author.IsStaff }}
|
||||
<div class="badge staff"></div>
|
||||
{{ end }}
|
||||
</div>
|
||||
<div class="f6">
|
||||
{{ timehtml (absoluteshortdate .PostDate) .PostDate }}
|
||||
{{- if .Editor -}}
|
||||
.
|
||||
Edited by <a class="name" href="{{ .Editor.ProfileUrl }}">{{ coalesce .Editor.Name .Editor.Username }}</a>
|
||||
on {{ timehtml (absolutedate .EditDate) .EditDate }}
|
||||
{{ with .EditReason }}
|
||||
Reason: {{ . }}
|
||||
{{ end }}
|
||||
</span>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-grow-1"></div>
|
||||
<div>
|
||||
{{ if and $.User $.Project.HasBlog }}
|
||||
<div class="flex">
|
||||
{{ if or (eq .Author.ID $.User.ID) $.User.IsStaff }}
|
||||
<a class="delete action button" href="{{ .DeleteUrl }}" title="Delete">✖</a>
|
||||
<a class="edit action button" href="{{ .EditUrl }}" title="Edit">✎</a>
|
||||
{{ end }}
|
||||
{{ if or (not $.Thread.Locked) $.User.IsStaff }}
|
||||
{{ if $.Thread.Locked }}
|
||||
WARNING: locked thread - use power responsibly!
|
||||
{{ end }}
|
||||
<a class="reply action button" href="{{ .ReplyUrl }}" title="Reply">↪</a>
|
||||
{{ end }}
|
||||
<span class="postid">
|
||||
<a name="{{ .ID }}" href="{{ .Url }}">#{{ .ID }}</a>
|
||||
</span>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="post-content overflow-x-auto">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
</div>
|
||||
{{ else }}
|
||||
<div class="bg2 tc pv4 f7">
|
||||
No comments yet.
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ if .Project.HasBlog }}
|
||||
{{ if gt (len .Comments) 0 }}
|
||||
<div class="flex justify-end">
|
||||
<a class="flex items-center g2" href="{{ not (not $.User) | ternary .ReplyLink .LoginLink }}">{{ svg "add" }}<span>Leave a Comment</span></a>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<div class="hmn-form pv3 flex flex-column g2 items-center">
|
||||
<div class="hmn-form flex flex-column g2 items-center">
|
||||
<form id="newsletter-form" class="flex flex-column items-center">
|
||||
<div class="b pv2">Sign up for our email newsletter:</div>
|
||||
<div class="flex g2 justify-center">
|
||||
|
|
Loading…
Reference in New Issue