1 from django.template import RequestContext
2 from django.shortcuts import render_to_response
4 from unfold.page import Page
5 from ui.topmenu import topmenu_items, the_user
7 class PortalPage(Page):
8 def __init__(self, request):
9 Page.__init__(self, request)
12 def __lshift__(self, content):
13 self._content.append(content)
18 # define 'unfold_main' to the template engine - the main contents
19 template_env [ 'unfold_main' ] = "\n".join(self._content)
21 # more general variables expected in the template
22 template_env [ 'title' ] = 'Test view that combines various plugins'
23 # the menu items on the top
24 template_env [ 'topmenu_items' ] = topmenu_items('slice', self.request)
25 # so we can sho who is logged
26 template_env [ 'username' ] = the_user (self.request)
28 # don't forget to run the requests
29 # Jordan: it seems we need this to init plugins js
30 # Issue a "manifold is not defined" error
31 #self.expose_queries ()
32 # Thierry: this is deprecated anyway, and will happen as part of prelude_env
33 # "manifold not defined" would be due to a missing dependency to manifold.js or something...
35 template_env.update(self.prelude_env())
36 result=render_to_response ('view-unfold1.html',template_env,
37 context_instance=RequestContext(self.request))