Fixed follower count in country lists

This commit is contained in:
Eduard Urbach 2019-08-28 00:46:28 +09:00
parent f5b2e75ffe
commit 1b0bb6fdbd
Signed by: akyoto
GPG Key ID: C874F672B1AF20C0
2 changed files with 4 additions and 4 deletions

View File

@ -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()
})
arn.SortUsersFollowers(users)
return ctx.HTML(components.UsersByCountry(users, countryName))
followerCount := arn.SortUsersFollowers(users)
return ctx.HTML(components.UsersByCountry(users, followerCount, countryName))
}
// Staff ...

View File

@ -6,7 +6,7 @@ component Users(users []*arn.User, followerCount map[string]int, url string)
each user in users
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
p.no-data.mountable= "Seems like there are no active users in " + stringutils.Capitalize(countryName)
else
@ -14,7 +14,7 @@ component UsersByCountry(users []*arn.User, countryName string)
.user-cards.mountable
each user in users
UserCard(user, "1 follower")
UserCard(user, stringutils.Plural(followerCount[user.ID], "follower"))
component ProUsers(users []*arn.User, url string)
h1.page-title Supporters