Improve Newest Forum page

This commit is contained in:
Noah 2022-08-31 22:05:05 -07:00
parent 500456c05e
commit c8d7b891c1

View File

@ -82,6 +82,18 @@
<h2 class="is-size-4 pt-0"> <h2 class="is-size-4 pt-0">
<a href="/forum/thread/{{.ThreadID}}" class="has-text-dark has-text-weight-bold"> <a href="/forum/thread/{{.ThreadID}}" class="has-text-dark has-text-weight-bold">
{{.Thread.Title}} {{.Thread.Title}}
{{if .Thread.Pinned}}
<sup class="has-text-success fa fa-thumbtack is-size-6 ml-1"></sup>
{{end}}
{{if .Thread.Explicit}}
<sup class="has-text-danger fa fa-fire is-size-6 ml-1"></sup>
{{end}}
{{if .Thread.NoReply}}
<sup class="has-text-warning-dark fa fa-ban is-size-6 ml-1"></sup>
{{end}}
</a> </a>
</h2> </h2>
@ -89,29 +101,62 @@
{{TrimEllipses .Thread.Comment.Message 256}} {{TrimEllipses .Thread.Comment.Message 256}}
</a> </a>
<div class="is-size-7 is-italic is-grey"> <div class="is-size-7 is-italic is-grey pt-1">
by {{.Thread.Comment.User.Username}} {{if eq .Comment.ID .Thread.CommentID}}new {{end}}thread by {{.Thread.Comment.User.Username}}
in <a href="/f/{{.Forum.Fragment}}">
{{.Forum.Title}}
{{if .Forum.Privileged}}
<small class="has-text-warning-dark fa fa-gavel"></small>
{{end}}
{{if .Forum.Explicit}}
<small class="has-text-danger fa fa-fire"></small>
{{end}}
</a>
&ndash; &ndash;
{{SincePrettyCoarse .Thread.Comment.UpdatedAt}} ago {{SincePrettyCoarse .Thread.Comment.UpdatedAt}} ago
</div> </div>
<hr class="has-background-grey my-2"> <!-- If a reply to a thread, show the reply too -->
<h2 class="is-size-5 pt-0">
<a href="/forum/thread/{{.ThreadID}}?page=-1" class="has-text-dark">Latest Post</a>
</h2>
{{if ne .Comment.ID .Thread.CommentID}} {{if ne .Comment.ID .Thread.CommentID}}
<a href="/forum/thread/{{.ThreadID}}?page=-1" class="is-size-7 has-text-dark"> <hr class="has-background-grey my-2">
{{TrimEllipses .Comment.Message 256}}
</a>
{{end}}
<div class="is-size-7 is-italic is-grey"> <div class="columns is-gapless mb-0">
by {{.Comment.User.Username}} <div class="column is-narrow">
&ndash; <a href="/forum/thread/{{.ThreadID}}?page=-1" class="has-text-grey">
{{SincePrettyCoarse .Comment.UpdatedAt}} ago <h2 class="is-size-5 py-0 is-italic has-text-grey">
</div> <span class="icon"><i class="fa fa-reply"></i></span>
Comment added by
</h2>
</a>
</div>
<div class="column is-narrow mx-2">
<a href="/u/{{.Comment.User.Username}}">
<figure class="image is-32x32 is-inline-block">
{{if .Comment.User.ProfilePhoto.ID}}
<img src="{{PhotoURL .Comment.User.ProfilePhoto.CroppedFilename}}" class="is-rounded">
{{else}}
<img src="/static/photos/shy.png" class="is-rounded">
{{end}}
</figure>
</a>
</div>
<div class="column is-narrow">
<h2 class="is-size-5 py-0">
<a href="/u/{{.Comment.User.Username}}" class="has-text-dark">{{.Comment.User.Username}}</a>
</h2>
</div>
</div>
<a href="/forum/thread/{{.ThreadID}}?page=-1" class="has-text-dark">
{{TrimEllipses .Comment.Message 256}}
</a>
<div class="is-size-7 is-italic is-grey mt-1">
{{SincePrettyCoarse .Comment.UpdatedAt}} ago
</div>
{{end}}
</div> </div>
</div> </div>
</div> </div>