myslice.ini possible themes = onelab, fed4fire, fibre, smartfire
[myslice.git] / portal / portalpage.py
1 from django.template import RequestContext
2 from django.shortcuts import render_to_response
3
4 from unfold.page import Page
5 from ui.topmenu import topmenu_items, the_user
6
7 class PortalPage(Page):
8     def __init__(self, request):
9         Page.__init__(self, request)
10         self._content = []
11
12     def __lshift__(self, content):
13         self._content.append(content)
14
15     def render(self):
16         template_env = {}
17         
18         # define 'unfold_main' to the template engine - the main contents
19         template_env [ 'unfold_main' ] = "\n".join(self._content)
20
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) 
27
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...
34
35         template_env.update(self.prelude_env())
36         result=render_to_response ('view-unfold1.html',template_env,
37                                    context_instance=RequestContext(self.request))
38         return result