From 53a6dc359927340892abb8f44140910a733743ff Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Fri, 16 Jun 2017 11:37:49 -0400 Subject: [PATCH 1/2] Failing test for single enumeration of packages --- tests/ttw/test_package_discovery.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/ttw/test_package_discovery.py b/tests/ttw/test_package_discovery.py index bb981ec9d3..9a43105112 100644 --- a/tests/ttw/test_package_discovery.py +++ b/tests/ttw/test_package_discovery.py @@ -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'] From f8421785b3ac69b2a398a991adbfc47e34d3ec1a Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Fri, 16 Jun 2017 11:41:08 -0400 Subject: [PATCH 2/2] Count all packages in one enumeration --- www/on/npm/index.html.spt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/www/on/npm/index.html.spt b/www/on/npm/index.html.spt index c93b1adf41..defb5191ae 100644 --- a/www/on/npm/index.html.spt +++ b/www/on/npm/index.html.spt @@ -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 %} @@ -105,11 +107,11 @@ if request.method == 'POST': {% if flow == None %} {% if discovered %}
-{% for heading, group in discovered %} +{% for I, heading, group in discovered %}

{{ heading }}

{% if group %} - {% for i, (source, name, package, project) in enumerate(group, start=1) %} + {% for i, (source, name, package, project) in enumerate(group, start=I) %}
{% if project %}