Further blog post tweaks

This commit is contained in:
Ben Visness 2024-07-05 15:57:05 -05:00
parent 716014c607
commit 9ab533dc32
2 changed files with 74 additions and 72 deletions

View File

@ -22,81 +22,83 @@
</div> </div>
{{ if not .IsProjectPage }} {{ if not .IsProjectPage }}
{{ template "newsletter_signup.html" . }} <div class="pv4">
{{ template "newsletter_signup.html" . }}
</div>
{{ end }} {{ end }}
</div> </div>
<hr class="m-center mw-site"> <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="pt4 m-center mw-site-narrow ph3 ph0-l flex flex-column g2"> <div class="flex justify-between">
<div class="flex justify-between"> <h3 class="f4">Comments</h3>
<h3 class="f4">Comments</h3> {{ if .Project.HasBlog }}
{{ 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">&#10006;</a>&nbsp;
<a class="edit action button" href="{{ .EditUrl }}" title="Edit">&#9998;</a>&nbsp;
{{ 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">&hookrightarrow;</a>&nbsp;
{{ 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">
<a class="flex items-center g2" href="{{ not (not $.User) | ternary .ReplyLink .LoginLink }}">{{ svg "add" }}<span>Leave a Comment</span></a> <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">&#10006;</a>&nbsp;
<a class="edit action button" href="{{ .EditUrl }}" title="Edit">&#9998;</a>&nbsp;
{{ 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">&hookrightarrow;</a>&nbsp;
{{ 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 }}
{{ end }} </div>
</div> </div>
{{ end }} {{ end }}

View File

@ -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"> <form id="newsletter-form" class="flex flex-column items-center">
<div class="b pv2">Sign up for our email newsletter:</div> <div class="b pv2">Sign up for our email newsletter:</div>
<div class="flex g2 justify-center"> <div class="flex g2 justify-center">