diff --git a/pkg/models/comment.go b/pkg/models/comment.go index cf9caba..f9812d1 100644 --- a/pkg/models/comment.go +++ b/pkg/models/comment.go @@ -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 } } diff --git a/web/templates/forum/index.html b/web/templates/forum/index.html index 4b6f731..ad32629 100644 --- a/web/templates/forum/index.html +++ b/web/templates/forum/index.html @@ -104,7 +104,7 @@

Latest Post

{{if $Stats.RecentThread}} - + {{$Stats.RecentThread.Title}} by {{$Stats.RecentThread.Comment.User.Username}} diff --git a/web/templates/forum/thread.html b/web/templates/forum/thread.html index 75b1aa5..5aba93c 100644 --- a/web/templates/forum/thread.html +++ b/web/templates/forum/thread.html @@ -305,6 +305,7 @@ class="has-text-dark" title="Copy link to clipboard"> + Link
diff --git a/web/templates/photo/permalink.html b/web/templates/photo/permalink.html index fe3763f..a095108 100644 --- a/web/templates/photo/permalink.html +++ b/web/templates/photo/permalink.html @@ -296,6 +296,7 @@ class="has-text-dark" title="Copy link to clipboard"> + Link