SimpleList No Result optional warning msg
[myslice.git] / portal / views.py
index deb4fad..8194ed8 100644 (file)
 import json
 
 from django.http                import HttpResponseRedirect, HttpResponse
-from django.views.generic.base  import TemplateView
 from django.shortcuts           import render
 from django.template.loader     import render_to_string
 
-from ui.topmenu                 import topmenu_items, the_user
+from unfold.loginrequired       import FreeAccessView
+from ui.topmenu                 import topmenu_items_live, the_user
 
 from portal.event               import Event
 # presview is put in observation for now
@@ -49,7 +49,7 @@ from unfold.page                import Page
 # all the other ones have now migrated into separate classes/files for more convenience
 # I'm leaving these ones here for now as I could not exactly figure what the purpose was 
 # (i.e. what the correct name should be, as presviewview was a bit cryptic)
-class PresViewView(TemplateView):
+class PresViewView(FreeAccessView):
     template_name = "view-unfold1.html"
 
     def get_context_data(self, **kwargs):
@@ -62,13 +62,13 @@ class PresViewView(TemplateView):
         context = super(PresViewView, self).get_context_data(**kwargs)
 
         #context['ALL_STATIC'] = "all_static"
-        context['unfold1_main'] = pres_view.render(self.request)
+        context['unfold_main'] = pres_view.render(self.request)
 
         # XXX This is repeated in all pages
         # 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)
 
@@ -222,7 +222,7 @@ def pres_view_static(request, constraints, id):
     json_answer = json.dumps(cmd)
     return HttpResponse (json_answer, mimetype="application/json")
 
-class ValidatePendingView(TemplateView):
+class ValidatePendingView(FreeAccessView):
     template_name = "validate_pending.html"
 
     def get_context_data(self, **kwargs):
@@ -393,7 +393,7 @@ class ValidatePendingView(TemplateView):
         # 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('Validation', self.request
+        context['topmenu_items'] = topmenu_items_live('Validation', page
         # so we can sho who is logged
         context['username'] = the_user(self.request)