Couple bugfixes with /go/comment links
This commit is contained in:
parent
70402b42c9
commit
64ce5a9d7c
|
@ -147,6 +147,9 @@ func FindPageByComment(user *User, comment *Comment, pageSize int) (int, error)
|
||||||
for i, cid := range allCommentIDs {
|
for i, cid := range allCommentIDs {
|
||||||
if cid == comment.ID {
|
if cid == comment.ID {
|
||||||
var page = int(math.Ceil(float64(i) / float64(pageSize)))
|
var page = int(math.Ceil(float64(i) / float64(pageSize)))
|
||||||
|
if page == 0 {
|
||||||
|
page = 1
|
||||||
|
}
|
||||||
return page, nil
|
return page, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,7 +104,7 @@
|
||||||
<div class="box has-background-success-light">
|
<div class="box has-background-success-light">
|
||||||
<h2 class="subtitle mb-1">Latest Post</h2>
|
<h2 class="subtitle mb-1">Latest Post</h2>
|
||||||
{{if $Stats.RecentThread}}
|
{{if $Stats.RecentThread}}
|
||||||
<a href="/forum/thread/{{$Stats.RecentThread.ID}}">
|
<a href="/go/comment?id={{$Stats.RecentPost.ID}}">
|
||||||
<strong>{{$Stats.RecentThread.Title}}</strong>
|
<strong>{{$Stats.RecentThread.Title}}</strong>
|
||||||
</a>
|
</a>
|
||||||
<em>by {{$Stats.RecentThread.Comment.User.Username}}</em>
|
<em>by {{$Stats.RecentThread.Comment.User.Username}}</em>
|
||||||
|
|
|
@ -305,6 +305,7 @@
|
||||||
class="has-text-dark"
|
class="has-text-dark"
|
||||||
title="Copy link to clipboard">
|
title="Copy link to clipboard">
|
||||||
<span class="icon"><i class="fa fa-paragraph"></i></span>
|
<span class="icon"><i class="fa fa-paragraph"></i></span>
|
||||||
|
<span>Link</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -296,6 +296,7 @@
|
||||||
class="has-text-dark"
|
class="has-text-dark"
|
||||||
title="Copy link to clipboard">
|
title="Copy link to clipboard">
|
||||||
<span class="icon"><i class="fa fa-paragraph"></i></span>
|
<span class="icon"><i class="fa fa-paragraph"></i></span>
|
||||||
|
<span>Link</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user