Couple bugfixes with /go/comment links

This commit is contained in:
Noah Petherbridge 2024-01-05 22:25:05 -08:00
parent 70402b42c9
commit 64ce5a9d7c
4 changed files with 6 additions and 1 deletions

View File

@ -147,6 +147,9 @@ func FindPageByComment(user *User, comment *Comment, pageSize int) (int, error)
for i, cid := range allCommentIDs {
if cid == comment.ID {
var page = int(math.Ceil(float64(i) / float64(pageSize)))
if page == 0 {
page = 1
}
return page, nil
}
}

View File

@ -104,7 +104,7 @@
<div class="box has-background-success-light">
<h2 class="subtitle mb-1">Latest Post</h2>
{{if $Stats.RecentThread}}
<a href="/forum/thread/{{$Stats.RecentThread.ID}}">
<a href="/go/comment?id={{$Stats.RecentPost.ID}}">
<strong>{{$Stats.RecentThread.Title}}</strong>
</a>
<em>by {{$Stats.RecentThread.Comment.User.Username}}</em>

View File

@ -305,6 +305,7 @@
class="has-text-dark"
title="Copy link to clipboard">
<span class="icon"><i class="fa fa-paragraph"></i></span>
<span>Link</span>
</a>
</div>
</div>

View File

@ -296,6 +296,7 @@
class="has-text-dark"
title="Copy link to clipboard">
<span class="icon"><i class="fa fa-paragraph"></i></span>
<span>Link</span>
</a>
</div>
</div>