use topmenu_items_live in all pages that have a page instance
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Mon, 16 Dec 2013 20:18:51 +0000 (21:18 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Mon, 16 Dec 2013 20:18:51 +0000 (21:18 +0100)
portal/platformsview.py
portal/platformview.py
portal/registrationview.py
portal/resourceview.py
portal/views.py
sample/dashboardview.py
sample/pluginview.py
sample/querygridview.py
sample/querytableview.py
sandbox/views.py

index fee7397..7e7d53a 100644 (file)
@@ -2,7 +2,7 @@ from manifold.core.query         import Query
 from unfold.page                 import Page
 
 from unfold.loginrequired       import FreeAccessView
-from ui.topmenu                  import topmenu_items, the_user
+from ui.topmenu                  import topmenu_items_live, the_user
 
 from plugins.querytable          import QueryTable
 
@@ -41,7 +41,7 @@ class PlatformsView(FreeAccessView):
         # more general variables expected in the template
         context['title'] = 'Platforms connected to MySlice'
         # the menu items on the top
-        context['topmenu_items'] = topmenu_items('Platforms', self.request)
+        context['topmenu_items'] = topmenu_items_live('Platforms', page)
         # so we can sho who is logged
         context['username'] = the_user(self.request)
 
index f852daa..86d282b 100644 (file)
@@ -2,7 +2,7 @@ from manifold.core.query         import Query
 from unfold.page                 import Page
 
 from unfold.loginrequired        import FreeAccessView
-from ui.topmenu                  import topmenu_items, the_user
+from ui.topmenu                  import topmenu_items_live, the_user
 
 from plugins.querytable          import QueryTable
 
@@ -53,7 +53,7 @@ class PlatformView(FreeAccessView):
         # more general variables expected in the template
         context['title'] = 'Platforms connected to MySlice'
         # the menu items on the top
-        context['topmenu_items'] = topmenu_items('Platforms', self.request)
+        context['topmenu_items'] = topmenu_items_live('Platforms', page)
         # so we can sho who is logged
         context['username'] = the_user(self.request)
 
index 8f91de7..0002bf4 100644 (file)
@@ -9,7 +9,7 @@ from django.shortcuts           import render
 
 from unfold.page                import Page
 from unfold.loginrequired       import FreeAccessView
-from ui.topmenu                 import topmenu_items
+from ui.topmenu                 import topmenu_items_live
 
 from manifold.manifoldapi       import execute_admin_query
 from manifold.core.query        import Query
@@ -168,7 +168,7 @@ class RegistrationView (FreeAccessView):
                 return render(request, 'user_register_complete.html') 
 
         template_env = {
-          'topmenu_items': topmenu_items('Register', request),
+          'topmenu_items': topmenu_items_live('Register', page),
           'errors': errors,
           'firstname': request.POST.get('firstname', ''),
           'lastname': request.POST.get('lastname', ''),
index c4d6e28..3ed9dcc 100644 (file)
@@ -2,7 +2,7 @@ from manifold.core.query        import Query
 from unfold.page                import Page
 
 from unfold.loginrequired       import FreeAccessView
-from ui.topmenu                 import topmenu_items, the_user
+from ui.topmenu                 import topmenu_items_live, the_user
 
 from plugins.googlemap          import GoogleMap
 from plugins.querytable         import QueryTable
@@ -85,7 +85,7 @@ class ResourceView(FreeAccessView):
         # more general variables expected in the template
         context['title'] = 'Information about a resource'
         # the menu items on the top
-        context['topmenu_items'] = topmenu_items(None, self.request)
+        context['topmenu_items'] = topmenu_items_live(None, page)
         # so we can sho who is logged
         context['username'] = the_user(self.request)
 
index d454502..3a71907 100644 (file)
@@ -28,7 +28,7 @@ from django.shortcuts           import render
 from django.template.loader     import render_to_string
 
 from unfold.loginrequired       import FreeAccessView
-from ui.topmenu                 import topmenu_items, the_user
+from ui.topmenu                 import topmenu_items_live, the_user
 
 from portal.event               import Event
 # presview is put in observation for now
@@ -68,7 +68,7 @@ class PresViewView(FreeAccessView):
         # more general variables expected in the template
         context['title'] = 'Test view that combines various plugins'
         # the menu items on the top
-        context['topmenu_items'] = topmenu_items('PresView', self.request)
+        context['topmenu_items'] = topmenu_items_live('PresView', page)
         # so we can sho who is logged
         context['username'] = the_user(self.request)
 
index 947c79d..18438d8 100644 (file)
@@ -19,7 +19,7 @@ from plugins.quickfilter import QuickFilter
 from trash.trashutils import quickfilter_criterias
 
 # 
-from ui.topmenu import topmenu_items, the_user
+from ui.topmenu import topmenu_items_live, the_user
 
 @login_required
 def dashboard_view (request):
@@ -71,7 +71,7 @@ def dashboard_view (request):
     # more general variables expected in the template
     template_env [ 'title' ] = 'Test view for a full request cycle'
     # the menu items on the top 
-    template_env [ 'topmenu_items' ] = topmenu_items('dashboard', request
+    template_env [ 'topmenu_items' ] = topmenu_items_live('dashboard', page
     # so we can sho who is logged
     template_env [ 'username' ] = the_user (request) 
 
index 85441bf..144115e 100644 (file)
@@ -19,7 +19,7 @@ from plugins.raw                        import Raw
 from plugins.messages                   import Messages
 from plugins.querytable                 import QueryTable
 
-from ui.topmenu                         import topmenu_items, the_user
+from ui.topmenu                         import topmenu_items_live, the_user
 from trash.trashutils                   import hard_wired_slice_names, hard_wired_list, lorem_p, lorem, quickfilter_criterias
 
 #might be useful or not depending on the context
@@ -89,7 +89,7 @@ $(function(){$("#bouton").click(issue_debug);});
 
     # more general variables expected in the template
     template_env [ 'title' ] = 'Single Plugin View' 
-    template_env [ 'topmenu_items' ] = topmenu_items('plugin', request
+    template_env [ 'topmenu_items' ] = topmenu_items_live('plugin', page
     template_env [ 'username' ] = the_user (request) 
 
     # the prelude object in page contains a summary of the requirements() for all plugins
index 1b2a16b..0e2fc8e 100644 (file)
@@ -7,7 +7,7 @@ from manifold.core.query import Query, AnalyzedQuery
 
 from unfold.page import Page
 
-from ui.topmenu import topmenu_items, the_user
+from ui.topmenu import topmenu_items_live, the_user
 
 from plugins.querygrid import QueryGrid
 
@@ -69,7 +69,7 @@ class QueryGridView (TemplateView):
         # more general variables expected in the template
         template_env [ 'title' ] = 'simple %(slicename)s'%locals()
         # the menu items on the top
-        template_env [ 'topmenu_items' ] = topmenu_items('Slice', request
+        template_env [ 'topmenu_items' ] = topmenu_items_live('Slice', page
         # so we can sho who is logged
         template_env [ 'username' ] = the_user (request) 
     
index 4b667aa..25cb6a0 100644 (file)
@@ -7,7 +7,7 @@ from manifold.core.query import Query, AnalyzedQuery
 
 from unfold.page import Page
 
-from ui.topmenu import topmenu_items, the_user
+from ui.topmenu import topmenu_items_live, the_user
 
 from plugins.querytable import QueryTable
 
@@ -68,7 +68,7 @@ class QueryTableView (TemplateView):
         # more general variables expected in the template
         template_env [ 'title' ] = 'simple %(slicename)s'%locals()
         # the menu items on the top
-        template_env [ 'topmenu_items' ] = topmenu_items('Slice', request
+        template_env [ 'topmenu_items' ] = topmenu_items_live('Slice', page
         # so we can sho who is logged
         template_env [ 'username' ] = the_user (request) 
     
index 707e8f7..6e1e152 100644 (file)
@@ -29,7 +29,7 @@ from django.template.loader     import render_to_string
 from manifold.core.query        import Query
 from plugins.myplugin           import MyPlugin
 from plugins.maddash            import MadDash
-from ui.topmenu                 import topmenu_items, the_user
+from ui.topmenu                 import topmenu_items_live, the_user
 from unfold.loginrequired       import FreeAccessView
 from unfold.page                import Page
 
@@ -52,7 +52,7 @@ class MyPluginView(FreeAccessView):
         # more general variables expected in the template
         context['title'] = 'Sandbox for MyPlugin plugin'
         # the menu items on the top
-        context['topmenu_items'] = topmenu_items('myplugin', self.request)
+        context['topmenu_items'] = topmenu_items_live('myplugin', page)
         # so we can sho who is logged
         context['username'] = the_user(self.request)
 
@@ -85,7 +85,7 @@ class MadDashView(FreeAccessView):
         context = super(MadDashView, self).get_context_data(**kwargs)
         context['unfold_main'] = plugin.render(self.request)
         context['title'] = 'Sandbox for MadDash plugin'
-        context['topmenu_items'] = topmenu_items('maddash', self.request)
+        context['topmenu_items'] = topmenu_items_live ('maddash', page)
         context['username'] = the_user(self.request)
 
         prelude_env = page.prelude_env()