From 1b0bb6fdbd9e3cdc40f3c41265596b9e132b6084 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Wed, 28 Aug 2019 00:46:28 +0900 Subject: [PATCH] Fixed follower count in country lists --- pages/users/users.go | 4 ++-- pages/users/users.pixy | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pages/users/users.go b/pages/users/users.go index 077c9a70..6c246cf9 100644 --- a/pages/users/users.go +++ b/pages/users/users.go @@ -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 ... diff --git a/pages/users/users.pixy b/pages/users/users.pixy index 0f3e9501..d2018cf6 100644 --- a/pages/users/users.pixy +++ b/pages/users/users.pixy @@ -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