fix pagination for followers and following (#27127) (#27138)

Backport #27127 by @earl-warren

- Use the correct total amount for pagination. Thereby correctly show
the pagination bare when there's more than one page of
followers/followings.

Refs: https://codeberg.org/forgejo/forgejo/pulls/1477

(cherry picked from commit c1a136318b)

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
Co-authored-by: Gusted <postmaster@gusted.xyz>
(cherry picked from commit 1d6e5c8e58)
This commit is contained in:
Giteabot 2023-09-20 00:03:01 +08:00 committed by Earl Warren
parent f54189092f
commit c041114a20
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -228,10 +228,10 @@ func Profile(ctx *context.Context) {
switch tab { switch tab {
case "followers": case "followers":
ctx.Data["Cards"] = followers ctx.Data["Cards"] = followers
total = int(count) total = int(numFollowers)
case "following": case "following":
ctx.Data["Cards"] = following ctx.Data["Cards"] = following
total = int(count) total = int(numFollowing)
case "activity": case "activity":
date := ctx.FormString("date") date := ctx.FormString("date")
items, count, err := activities_model.GetFeeds(ctx, activities_model.GetFeedsOptions{ items, count, err := activities_model.GetFeeds(ctx, activities_model.GetFeedsOptions{