Anonymous avatar Anonymous committed dd017b0 Draft

dashboard: move dashboard link to be under the Tickets link in the main nav - fixes #133 (from olemis)

Comments (0)

Files changed (1)


     implements(IRequestHandler, IRequestFilter, INavigationContributor, \
-    mainnav_label = Option('dashboard', 'mainnav', 'Dashboard', \
+    mainnav_label = Option('dashboard', 'mainnav', 'Tickets', \
                             """Dashboard label in mainnav""")
     default_widget_height = IntOption('widgets', 'default_height', 320, \
                             """Default widget height in pixels""")
         if data is not None :
             data['bhdb'] = DashboardChrome(self.env)
+        for item in['nav'].get('mainnav', []):
+            self.log.debug('%s' % (item,))
+            if item['name'] == 'tickets':
+                item['label'] = tag.a(_(self.mainnav_label), 
+                        href=req.href.dashboard())
+                break
         return template, data, content_type
     # IRequestHandler methods
     def get_active_navigation_item(self, req):
         """Highlight dashboard mainnav item.
-        return 'dashboard'
+        return 'tickets'
     def get_navigation_items(self, req):
-        """Add an item in mainnav to access global dashboard
+        """Skip silently
-        if 'DASHBOARD_VIEW' in req.perm:
-            yield ('mainnav', 'dashboard', 
-                    tag.a(_(self.mainnav_label), href=req.href.dashboard()))
+        return None
     # ITemplateProvider methods
     def get_htdocs_dirs(self):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.