You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by he...@apache.org on 2015/10/15 21:01:07 UTC

[20/42] allura git commit: [#7919] Refactor _nav endpoint to use json_nav on the project model

[#7919] Refactor _nav endpoint to use json_nav on the project model


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

Branch: refs/heads/hs/7919
Commit: 432852417801d5479a58bf0281d6654225fb4df6
Parents: 280fd2b
Author: Heith Seewald <hs...@hsmb.local>
Authored: Tue Oct 6 03:01:25 2015 -0400
Committer: Heith Seewald <hs...@hsmb.local>
Committed: Thu Oct 15 15:00:16 2015 -0400

----------------------------------------------------------------------
 Allura/allura/controllers/project.py | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/43285241/Allura/allura/controllers/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/project.py b/Allura/allura/controllers/project.py
index 20d9f63..869d326 100644
--- a/Allura/allura/controllers/project.py
+++ b/Allura/allura/controllers/project.py
@@ -380,16 +380,8 @@ class ProjectController(FeedController):
         self._list = ToolListController()
 
     @expose('json:')
-    def _nav(self, **kw):
-        menu = []
-        for s in c.project.grouped_navbar_entries():
-            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, tool_name=child.tool_name)
-                                     for child in s.children]
-            menu.append(entry)
-        return dict(menu=menu)
+    def _nav(self):
+        return c.project.json_nav()
 
     @expose()
     def _lookup(self, name, *remainder):