You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2013/05/02 17:42:43 UTC
git commit: [#5599] Removed empty children list from _nav.json
Updated Branches:
refs/heads/master 323b7d937 -> dbee43f23
[#5599] Removed empty children list from _nav.json
Signed-off-by: Cory Johns <cj...@slashdotmedia.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/dbee43f2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/dbee43f2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/dbee43f2
Branch: refs/heads/master
Commit: dbee43f23c3ae07ced764f33392fe199409f76ce
Parents: 323b7d9
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Thu May 2 15:32:56 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Thu May 2 15:41:56 2013 +0000
----------------------------------------------------------------------
Allura/allura/controllers/project.py | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/dbee43f2/Allura/allura/controllers/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/project.py b/Allura/allura/controllers/project.py
index f8789a3..d47caf4 100644
--- a/Allura/allura/controllers/project.py
+++ b/Allura/allura/controllers/project.py
@@ -311,8 +311,10 @@ class ProjectController(FeedController):
def _nav(self):
menu = []
for s in c.project.grouped_navbar_entries():
- children = [dict(name=child.label, url=child.url, icon=child.ui_icon) for child in s.children]
- menu.append(dict(name=s.label, url=s.url, icon=s.ui_icon, children=children))
+ entry = dict(name=s.label, url=s.url, icon=s.ui_icon)
+ if s.children:
+ entry['children'] = [dict(name=child.label, url=child.url, icon=child.ui_icon) for child in s.children]
+ menu.append(entry)
return dict(menu=menu)
@expose()