Author: rjollos
Date: Wed Oct 16 05:17:11 2013
New Revision: 1532641

URL: http://svn.apache.org/r1532641
Log:
0.8dev: Fixed regression in r1522789 which resulted in active mainnav item not 
being highlighted. Refs #693.

`req.chrome` should be manipulated in `post_process_request` rather than 
`pre_process_request` since it is assigned a dictionary in 
`trac.web.chrome:Chrome.prepare_request`.

Patch by Olemis Lang.

Modified:
    bloodhound/trunk/bloodhound_theme/bhtheme/theme.py

Modified: bloodhound/trunk/bloodhound_theme/bhtheme/theme.py
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_theme/bhtheme/theme.py?rev=1532641&r1=1532640&r2=1532641&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_theme/bhtheme/theme.py (original)
+++ bloodhound/trunk/bloodhound_theme/bhtheme/theme.py Wed Oct 16 05:17:11 2013
@@ -252,12 +252,6 @@ class BloodhoundTheme(ThemeBase):
 
         req.href.wiki = hwiki
 
-        # Move 'admin' entry from mainnav to metanav
-        for i, entry in enumerate(req.chrome['nav'].get('mainnav', [])):
-            if entry['name'] == 'admin':
-                req.chrome['nav'].setdefault('metanav', []) \
-                    .append(req.chrome['nav']['mainnav'].pop(i))
-
         return handler
 
     def post_process_request(self, req, template, data, content_type):
@@ -295,6 +289,12 @@ class BloodhoundTheme(ThemeBase):
         
         is_active_theme = is_active_theme()
         if self.disable_all_trac_css and is_active_theme:
+            # Move 'admin' entry from mainnav to metanav
+            for i, entry in enumerate(req.chrome['nav'].get('mainnav', [])):
+                if entry['name'] == 'admin':
+                    req.chrome['nav'].setdefault('metanav', []) \
+                       .append(req.chrome['nav']['mainnav'].pop(i))
+
             if self.disable_all_trac_css:
                 stylesheets = links.get('stylesheet', [])
                 if stylesheets:


Reply via email to