Commits

Olemis Lang committed a508b36

BH Theme #585: Admin breadcrumbs patch built against r1502032

Comments (0)

Files changed (3)

-t585/t585_r_admin_breadcrumbs_href.diff
+t585/t585_r1502032_admin_breadcrumbs_href.diff

t585/t585_r1502032_admin_breadcrumbs_href.diff

+# HG changeset patch
+# Parent c968b44aa150938d887047c5811e9246e75b943e
+BH Multiproduct #585 : Admin URLs in the right product context
+
+diff -r c968b44aa150 bloodhound_theme/bhtheme/theme.py
+--- a/bloodhound_theme/bhtheme/theme.py	Wed Jul 10 22:34:15 2013 +0000
++++ b/bloodhound_theme/bhtheme/theme.py	Thu Jul 11 16:03:05 2013 -0500
+@@ -398,8 +398,15 @@
+ 
+     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')
++        global_env = ProductEnvironment.lookup_env(self.env, '')
++        global_href = ProductEnvironment.resolve_href(global_env, self.env)
++        glsettings = (None, _('(Global settings)'), global_href.admin())
++
++        def admin_url(x):
++            env = ProductEnvironment.lookup_env(self.env, x)
++            href = ProductEnvironment.resolve_href(env, self.env)
++            return href('admin')
++
+         data['admin_product_list'] = [glsettings] + \
+             ProductModule.get_product_list(self.env, req, admin_url)
+ 

t585/t585_r_admin_breadcrumbs_href.diff

-# HG changeset patch
-# Parent c968b44aa150938d887047c5811e9246e75b943e
-BH Multiproduct #585 : Admin URLs in the right product context
-
-diff -r c968b44aa150 bloodhound_theme/bhtheme/theme.py
---- a/bloodhound_theme/bhtheme/theme.py	Wed Jul 10 22:34:15 2013 +0000
-+++ b/bloodhound_theme/bhtheme/theme.py	Thu Jul 11 16:03:05 2013 -0500
-@@ -398,8 +398,15 @@
- 
-     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')
-+        global_env = ProductEnvironment.lookup_env(self.env, '')
-+        global_href = ProductEnvironment.resolve_href(global_env, self.env)
-+        glsettings = (None, _('(Global settings)'), global_href.admin())
-+
-+        def admin_url(x):
-+            env = ProductEnvironment.lookup_env(self.env, x)
-+            href = ProductEnvironment.resolve_href(env, self.env)
-+            return href('admin')
-+
-         data['admin_product_list'] = [glsettings] + \
-             ProductModule.get_product_list(self.env, req, admin_url)
-