You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2012/09/19 20:43:27 UTC
[14/50] git commit: [#4718] faster nav generation using main_menu
instead of sitemap() method
[#4718] faster nav generation using main_menu instead of sitemap() method
App sitemap methods generate a full nav tree including sidebar info
for the tool, but the project sitemap method would only take the top
level anyway (never descend into .children)
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/053e8e43
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/053e8e43
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/053e8e43
Branch: refs/heads/master
Commit: 053e8e4395ba48e6ec0465bc7280c61295927c9d
Parents: 879c0de
Author: Dave Brondsema <db...@geek.net>
Authored: Mon Sep 10 20:57:29 2012 +0000
Committer: Cory Johns <jo...@geek.net>
Committed: Fri Sep 14 20:58:17 2012 +0000
----------------------------------------------------------------------
Allura/allura/controllers/project.py | 2 +-
Allura/allura/model/project.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/053e8e43/Allura/allura/controllers/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/project.py b/Allura/allura/controllers/project.py
index 194e241..7e262da 100644
--- a/Allura/allura/controllers/project.py
+++ b/Allura/allura/controllers/project.py
@@ -251,7 +251,7 @@ class ProjectController(object):
def _nav(self):
return dict(menu=[
dict(name=s.label, url=s.url, icon=s.ui_icon)
- for s in c.project.sitemap() ])
+ for s in c.project.sitemap()])
@expose()
def _lookup(self, name, *remainder):
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/053e8e43/Allura/allura/model/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py
index 40868a8..5c2ff86 100644
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -408,7 +408,7 @@ class Project(MappedClass, ActivityNode, ActivityObject):
App = ac.load()
app = App(self, ac)
if app.is_visible_to(c.user):
- for sm in app.sitemap:
+ for sm in app.main_menu():
entry = sm.bind_app(app)
entry.ui_icon='tool-%s' % ac.tool_name.lower()
ordinal = int(ac.options.get('ordinal', 0)) + delta_ordinal