allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hei...@apache.org
Subject [02/13] allura git commit: [#7919] Refactor _nav endpoint to use json_nav on the project model
Date Tue, 06 Oct 2015 07:28:53 GMT
[#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/edcb1159
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/edcb1159
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/edcb1159

Branch: refs/heads/hs/7919
Commit: edcb115946038f8e8de3e8fb281aed66da7a1e00
Parents: 15983cb
Author: Heith Seewald <hseewald@hsmb.local>
Authored: Tue Oct 6 03:01:25 2015 -0400
Committer: Heith Seewald <hseewald@hsmb.local>
Committed: Tue Oct 6 03:01:25 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/edcb1159/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):


Mime
View raw message