incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tvansteenbu...@apache.org
Subject [14/50] [abbrv] git commit: [#5599] Removed empty children list from _nav.json
Date Tue, 07 May 2013 22:30:56 GMT
[#5599] Removed empty children list from _nav.json

Signed-off-by: Cory Johns <cjohns@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/tv/3876
Commit: dbee43f23c3ae07ced764f33392fe199409f76ce
Parents: 323b7d9
Author: Cory Johns <cjohns@slashdotmedia.com>
Authored: Thu May 2 15:32:56 2013 +0000
Committer: Cory Johns <cjohns@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()


Mime
View raw message