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

Commit

Permalink
Merge pull request #4521 from gratipay/global-count
Browse files Browse the repository at this point in the history
Don't restart count across ready/unready packages
  • Loading branch information
rohitpaulk authored Jun 19, 2017
2 parents 14f8b80 + 24a86b3 commit 4f84de5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions tests/ttw/test_package_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,5 @@ def test_pasting_a_package_json_works(self):

enabled = [not x.has_class('disabled') for x in self.css('td.item')]
assert enabled == [True, True, True, True, False]

assert [x.text for x in self.css('.listing-details .i')] == ['1', '2', '3', '4', '5']
8 changes: 5 additions & 3 deletions www/on/npm/index.html.spt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ if request.method == 'POST':
for rec in group.values():
project = rec[3]
(yes if project and project.is_approved else no).append(rec)
discovered = [(_("Ready to accept payments"), yes), (_("Not available to pay"), no)]
discovered = [ (1, _("Ready to accept payments"), yes)
, (len(yes)+1, _("Not available to pay"), no)
]

[---]
{% from "templates/nav-tabs.html" import nav_tabs with context %}
Expand Down Expand Up @@ -105,11 +107,11 @@ if request.method == 'POST':
{% if flow == None %}
{% if discovered %}
<div class="discovery">
{% for heading, group in discovered %}
{% for I, heading, group in discovered %}
<h2>{{ heading }}</h2>
{% if group %}
<table class="listing">
{% for i, (source, name, package, project) in enumerate(group, start=1) %}
{% for i, (source, name, package, project) in enumerate(group, start=I) %}
<tr>
<td class="item i{{i}}{% if not package %} disabled{% endif %}">
{% if project %}
Expand Down

0 comments on commit 4f84de5

Please sign in to comment.