From 51d2fb20a737877e5f52ada75ce2c7686df9c6a2 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Sat, 10 Mar 2018 16:43:57 +0100 Subject: [PATCH] Minor optimization --- pages/users/editors.pixy | 4 ++-- pages/users/users.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/users/editors.pixy b/pages/users/editors.pixy index 499d7b4a..78652c44 100644 --- a/pages/users/editors.pixy +++ b/pages/users/editors.pixy @@ -1,4 +1,4 @@ -component EditorRankingList(users []*arn.User, url string) +component EditorRankingList(users []*arn.User, idToScore map[string]int, url string) h1.page-title Editor ranking list UsersTabs(url) @@ -15,7 +15,7 @@ component EditorRankingList(users []*arn.User, url string) td.ranking-user Avatar(user) a.ajax(href=user.Link())= user.Nick - td.ranking-score= user.EditorScore() + td.ranking-score= idToScore[user.ID] .footer.mountable p Score is generated from new data submissions and data fixes. \ No newline at end of file diff --git a/pages/users/users.go b/pages/users/users.go index 2cae9c83..6127684f 100644 --- a/pages/users/users.go +++ b/pages/users/users.go @@ -84,7 +84,7 @@ func Editors(ctx *aero.Context) string { return scoreA > scoreB }) - return ctx.HTML(components.EditorRankingList(users, ctx.URI())) + return ctx.HTML(components.EditorRankingList(users, score, ctx.URI())) } // ActiveNoAvatar ...