You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bloodhound.apache.org by rj...@apache.org on 2013/07/13 00:32:08 UTC

svn commit: r1502716 - /bloodhound/trunk/bloodhound_theme/bhtheme/theme.py

Author: rjollos
Date: Fri Jul 12 22:32:07 2013
New Revision: 1502716

URL: http://svn.apache.org/r1502716
Log:
Admin breadcrumb URLs were not accurate for custom URLs. Fixes #585.

For some configurations of `product_base_url` such as products that map to sub-domains, the breadcrumb URLs were not correct. Patch by Olemis.

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=1502716&r1=1502715&r2=1502716&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_theme/bhtheme/theme.py (original)
+++ bloodhound/trunk/bloodhound_theme/bhtheme/theme.py Fri Jul 12 22:32:07 2013
@@ -398,9 +398,15 @@ class BloodhoundTheme(ThemeBase):
 
     def _modify_admin_breadcrumb(self, req, template, data, content_type, is_active):
         # override 'normal' product list with the admin one
-        glsettings = (None, _('(Global settings)'), req.href.admin())
-        admin_url = lambda x: req.href.products(x, 'admin')
-        data['admin_product_list'] = [glsettings] + \
+
+        def admin_url(prefix):
+            env = ProductEnvironment.lookup_env(self.env, prefix)
+            href = ProductEnvironment.resolve_href(env, self.env)
+            return href.admin()
+
+        global_settings = (None, _('(Global settings)'), admin_url(None))
+
+        data['admin_product_list'] = [global_settings] + \
             ProductModule.get_product_list(self.env, req, admin_url)
 
         if isinstance(req.perm.env, ProductEnvironment):
@@ -409,7 +415,7 @@ class BloodhoundTheme(ThemeBase):
                 (product.prefix, product.name,
                  req.href.products(product.prefix, 'admin'))
         else:
-            data['admin_current_product'] = glsettings
+            data['admin_current_product'] = global_settings
         data['resourcepath_template'] = 'bh_path_general.html'
 
     def _modify_browser(self, req, template, data, content_type, is_active):