Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Light refactor on npm_stats for the page
Browse files Browse the repository at this point in the history
  • Loading branch information
chadwhitacre committed Jun 16, 2017
1 parent c6d6a63 commit affc93b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions www/on/npm/index.html.spt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -122,8 +123,8 @@ if user.participant:
{% endif %}
<p class="fine-print">
{{ _( "{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)
) }}
</p>
{% endblock %}

0 comments on commit affc93b

Please sign in to comment.