When constructing the sidebar don't overide 'sidebar'
authorSverre Rabbelier <srabbelier@gmail.com>
Tue, 20 Jan 2009 17:41:47 +0000
changeset 840 d3f9fff0860b
parent 839 3e50c012a4a8
child 841 9dac40accd06
When constructing the sidebar don't overide 'sidebar' Instead specify 'sidebar_additional' and include it even if there is a 'sidebar' defined. Patch by: Sverre Rabbelier
app/soc/views/models/user_self.py
app/soc/views/sitemap/sidebar.py
--- a/app/soc/views/models/user_self.py	Tue Jan 20 16:31:53 2009 +0000
+++ b/app/soc/views/models/user_self.py	Tue Jan 20 17:41:47 2009 +0000
@@ -269,7 +269,7 @@
     items = [('/' + 'notification/list', link_title, 'notification')]
 
     new_params = {}
-    new_params['sidebar'] = items
+    new_params['sidebar_additional'] = items
 
     params = dicts.merge(params, new_params)
 
--- a/app/soc/views/sitemap/sidebar.py	Tue Jan 20 16:31:53 2009 +0000
+++ b/app/soc/views/sitemap/sidebar.py	Tue Jan 20 17:41:47 2009 +0000
@@ -74,7 +74,11 @@
 
   # Return the found result
   if params['sidebar']:
-    return params['sidebar']
+    default = params['sidebar']
+    result = default[:]
+    for item in params['sidebar_additional']:
+      result.append(item)
+    return result
 
   # Construct defaults manualy
   defaults = params['sidebar_defaults']