Return-Path: X-Original-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3D0A610AA3 for ; Wed, 19 Mar 2014 22:05:04 +0000 (UTC) Received: (qmail 52217 invoked by uid 500); 19 Mar 2014 22:00:12 -0000 Delivered-To: apmail-incubator-allura-commits-archive@incubator.apache.org Received: (qmail 51051 invoked by uid 500); 19 Mar 2014 21:59:29 -0000 Mailing-List: contact allura-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: allura-dev@incubator.apache.org Delivered-To: mailing list allura-commits@incubator.apache.org Received: (qmail 40234 invoked by uid 99); 19 Mar 2014 21:52:11 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Mar 2014 21:52:11 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 7734B9850BE; Wed, 19 Mar 2014 21:52:10 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: johnsca@apache.org To: allura-commits@incubator.apache.org Date: Wed, 19 Mar 2014 21:52:15 -0000 Message-Id: <0b10dc48c8224ce28e4245ee0e52645c@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [6/7] git commit: [#7051] Make sure More link still gets added [#7051] Make sure More link still gets added Signed-off-by: Tim Van Steenburgh Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/3a265bd6 Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/3a265bd6 Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/3a265bd6 Branch: refs/heads/master Commit: 3a265bd63e47462e6f17e1713ec78a963afb16d1 Parents: 186c3a3 Author: Tim Van Steenburgh Authored: Tue Mar 18 17:23:49 2014 +0000 Committer: Tim Van Steenburgh Committed: Tue Mar 18 17:23:49 2014 +0000 ---------------------------------------------------------------------- Allura/allura/model/project.py | 4 ++-- Allura/allura/tests/functional/test_home.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/3a265bd6/Allura/allura/model/project.py ---------------------------------------------------------------------- diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py index dd247de..1ee6683 100644 --- a/Allura/allura/model/project.py +++ b/Allura/allura/model/project.py @@ -643,9 +643,9 @@ class Project(MappedClass, ActivityNode, ActivityObject): # add tool url to list of urls that will match this nav # entry grouped_nav[tool_name].matching_urls.append(e.url) - if len(grouped_nav[tool_name].children) < SITEMAP_PER_TOOL_LIMIT: + if len(grouped_nav[tool_name].children) < SITEMAP_PER_TOOL_LIMIT - 1: grouped_nav[tool_name].children.append(e) - elif len(grouped_nav[tool_name].children) == SITEMAP_PER_TOOL_LIMIT: + elif len(grouped_nav[tool_name].children) == SITEMAP_PER_TOOL_LIMIT - 1: e.url = self.url() + '_list/' + tool_name e.label = 'More...' grouped_nav[tool_name].children.append(e) http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/3a265bd6/Allura/allura/tests/functional/test_home.py ---------------------------------------------------------------------- diff --git a/Allura/allura/tests/functional/test_home.py b/Allura/allura/tests/functional/test_home.py index 3b790aa..8a8d087 100644 --- a/Allura/allura/tests/functional/test_home.py +++ b/Allura/allura/tests/functional/test_home.py @@ -83,7 +83,7 @@ class TestProjectHome(TestController): c.app = p.install_app('wiki', tool_name, tool_name, i) response = self.app.get('/p/test/_nav.json') menu = response.json['menu'] - assert_equal(len(menu[0]['children']), 11) + assert_equal(len(menu[0]['children']), 10) assert {u'url': u'/p/test/_list/wiki', u'name': u'More...', u'icon': u'tool-wiki', 'tool_name': 'wiki'} in menu[0]['children']