Fixed follower count in country lists
This commit is contained in:
parent
f5b2e75ffe
commit
1b0bb6fdbd
@ -148,8 +148,8 @@ func ByCountry(ctx aero.Context) error {
|
|||||||
return strings.ToLower(user.Location.CountryName) == countryName && user.Settings().Privacy.ShowLocation && user.HasAvatar() && user.HasNick() && user.IsActive()
|
return strings.ToLower(user.Location.CountryName) == countryName && user.Settings().Privacy.ShowLocation && user.HasAvatar() && user.HasNick() && user.IsActive()
|
||||||
})
|
})
|
||||||
|
|
||||||
arn.SortUsersFollowers(users)
|
followerCount := arn.SortUsersFollowers(users)
|
||||||
return ctx.HTML(components.UsersByCountry(users, countryName))
|
return ctx.HTML(components.UsersByCountry(users, followerCount, countryName))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Staff ...
|
// Staff ...
|
||||||
|
@ -6,7 +6,7 @@ component Users(users []*arn.User, followerCount map[string]int, url string)
|
|||||||
each user in users
|
each user in users
|
||||||
UserCard(user, stringutils.Plural(followerCount[user.ID], "follower"))
|
UserCard(user, stringutils.Plural(followerCount[user.ID], "follower"))
|
||||||
|
|
||||||
component UsersByCountry(users []*arn.User, countryName string)
|
component UsersByCountry(users []*arn.User, followerCount map[string]int, countryName string)
|
||||||
if len(users) == 0
|
if len(users) == 0
|
||||||
p.no-data.mountable= "Seems like there are no active users in " + stringutils.Capitalize(countryName)
|
p.no-data.mountable= "Seems like there are no active users in " + stringutils.Capitalize(countryName)
|
||||||
else
|
else
|
||||||
@ -14,7 +14,7 @@ component UsersByCountry(users []*arn.User, countryName string)
|
|||||||
|
|
||||||
.user-cards.mountable
|
.user-cards.mountable
|
||||||
each user in users
|
each user in users
|
||||||
UserCard(user, "1 follower")
|
UserCard(user, stringutils.Plural(followerCount[user.ID], "follower"))
|
||||||
|
|
||||||
component ProUsers(users []*arn.User, url string)
|
component ProUsers(users []*arn.User, url string)
|
||||||
h1.page-title Supporters
|
h1.page-title Supporters
|
||||||
|
Loading…
Reference in New Issue
Block a user