allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [5/5] git commit: [#5716] expose tool type in _nav.json
Date Wed, 29 May 2013 20:39:53 GMT
[#5716] expose tool type in _nav.json


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/06d4a2a1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/06d4a2a1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/06d4a2a1

Branch: refs/heads/master
Commit: 06d4a2a1d7f881a3a63a346136e3abb2f819d67a
Parents: 17c0937
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Tue May 28 19:07:16 2013 +0000
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Wed May 29 19:01:56 2013 +0000

----------------------------------------------------------------------
 Allura/allura/controllers/project.py        |    5 +++--
 Allura/allura/tests/functional/test_home.py |    6 +++---
 2 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/06d4a2a1/Allura/allura/controllers/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/project.py b/Allura/allura/controllers/project.py
index cc80ad3..da39e5d 100644
--- a/Allura/allura/controllers/project.py
+++ b/Allura/allura/controllers/project.py
@@ -311,9 +311,10 @@ class ProjectController(FeedController):
     def _nav(self):
         menu = []
         for s in c.project.grouped_navbar_entries():
-            entry = dict(name=s.label, url=s.url, icon=s.ui_icon)
+            entry = dict(name=s.label, url=s.url, icon=s.ui_icon, tool_name=s.tool_name)
             if s.children:
-                entry['children'] = [dict(name=child.label, url=child.url, icon=child.ui_icon)
for child in s.children]
+                entry['children'] = [dict(name=child.label, url=child.url, icon=child.ui_icon,
tool_name=child.tool_name) 
+                                    for child in s.children]
             menu.append(entry)
         return dict(menu=menu)
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/06d4a2a1/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 3e11437..5e9ec2e 100644
--- a/Allura/allura/tests/functional/test_home.py
+++ b/Allura/allura/tests/functional/test_home.py
@@ -50,8 +50,8 @@ class TestProjectHome(TestController):
         response = self.app.get('/p/test/_nav.json')
         menu = response.json['menu']
         assert_equal(len(menu[1]['children']), 2)
-        assert {u'url': u'/p/test/wiki/', u'name': u'Wiki', u'icon': u'tool-wiki'} in menu[1]['children'],
menu[1]['children']
-        assert {u'url': u'/p/test/wiki2/', u'name': u'wiki2', u'icon': u'tool-wiki'} in menu[1]['children'],
menu[1]['children']
+        assert {u'url': u'/p/test/wiki/', u'name': u'Wiki', u'icon': u'tool-wiki', 'tool_name':
'wiki'} in menu[1]['children'], menu[1]['children']
+        assert {u'url': u'/p/test/wiki2/', u'name': u'wiki2', u'icon': u'tool-wiki', 'tool_name':
'wiki'} in menu[1]['children'], menu[1]['children']
 
     @td.with_wiki
     def test_project_group_nav_more_than_ten(self):
@@ -65,7 +65,7 @@ class TestProjectHome(TestController):
         response = self.app.get('/p/test/_nav.json')
         menu = response.json['menu']
         assert_equal(len(menu[1]['children']), 11)
-        assert {u'url': u'/p/test/_list/wiki', u'name': u'More...', u'icon': u'tool-wiki'}
in menu[1]['children']
+        assert {u'url': u'/p/test/_list/wiki', u'name': u'More...', u'icon': u'tool-wiki',
'tool_name': 'wiki'} in menu[1]['children']
 
     @td.with_wiki
     def test_neighborhood_home(self):


Mime
View raw message