From affc93b5d8397b438d23b4101d78966ebc3c2387 Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Thu, 15 Jun 2017 10:54:57 -0400 Subject: [PATCH] Light refactor on npm_stats for the page --- www/on/npm/index.html.spt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/www/on/npm/index.html.spt b/www/on/npm/index.html.spt index 80fd43eb1c..a2bcf17065 100644 --- a/www/on/npm/index.html.spt +++ b/www/on/npm/index.html.spt @@ -2,8 +2,9 @@ from gratipay.utils import icons [---] banner = manager = "npm" suppress_sidebar = True -npackages, Npackages = website.db.one(''' - select (select count(*) from teams_to_packages) as n, (select count(*) from packages) as t +npm_stats = website.db.one(''' + select (select count(*) from teams_to_packages) as claimed_packages + , (select count(*) from packages) as total_packages ''') if user.participant: packages_for_claiming = user.participant.get_packages_for_claiming(manager) @@ -122,8 +123,8 @@ if user.participant: {% endif %}

{{ _( "{n} out of all {N} npm packages are on Gratipay." - , n=format_number(npackages) - , N=format_number(Npackages) + , n=format_number(npm_stats.claimed_packages) + , N=format_number(npm_stats.total_packages) ) }}

{% endblock %}