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/28 19:01:38 UTC
[16/50] [abbrv] 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/4903efc1
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/4903efc1
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/4903efc1
Branch: refs/heads/hs/7919
Commit: 4903efc126fef4bb530377b833a02aada44c7835
Parents: 6969ed5
Author: Heith Seewald <hs...@hsmb.local>
Authored: Tue Oct 6 03:01:25 2015 -0400
Committer: Heith Seewald <hs...@hsmb.local>
Committed: Wed Oct 28 14:00:42 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/4903efc1/Allura/allura/controllers/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/project.py b/Allura/allura/controllers/project.py
index 695e18a..185fc58 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):