1 # -*- coding: utf-8 -*-
3 # sample/views.py: views for the sample application
4 # This file is part of the Manifold project.
7 # Jordan Augé <jordan.auge@lip6.fr>
8 # Copyright 2013, UPMC Sorbonne Universités / LIP6
10 # This program is free software; you can redistribute it and/or modify it under
11 # the terms of the GNU General Public License as published by the Free Software
12 # Foundation; either version 3, or (at your option) any later version.
14 # This program is distributed in the hope that it will be useful, but WITHOUT
15 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
19 # You should have received a copy of the GNU General Public License along with
20 # this program; see the file COPYING. If not, write to the Free Software
21 # Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 from django.views.generic.base import TemplateView
24 from myslice.viewutils import topmenu_items, the_user
26 class WebSocketsView(TemplateView):
27 template_name = "websockets.html"
29 def get_context_data(self, **kwargs):
30 # We might have slices on different registries with different user accounts
31 # We note that this portal could be specific to a given registry, to which we register users, but i'm not sure that simplifies things
32 # Different registries mean different identities, unless we identify via SFA HRN or have associated the user email to a single hrn
34 context = super(WebSocketsView, self).get_context_data(**kwargs)
36 # XXX This is repeated in all pages
37 # more general variables expected in the template
38 context['title'] = 'SAMPLE WEBSOCKET PAGE',
39 # the menu items on the top
40 context['topmenu_items'] = topmenu_items('Dashboard', self.request)
41 # so we can sho who is logged
42 context['username'] = the_user(self.request)
47 class WebSockets2View(TemplateView):
48 template_name = "websockets2.html"
50 def get_context_data(self, **kwargs):
51 # We might have slices on different registries with different user accounts
52 # We note that this portal could be specific to a given registry, to which we register users, but i'm not sure that simplifies things
53 # Different registries mean different identities, unless we identify via SFA HRN or have associated the user email to a single hrn
55 context = super(WebSockets2View, self).get_context_data(**kwargs)
57 # XXX This is repeated in all pages
58 # more general variables expected in the template
59 context['title'] = 'SAMPLE WEBSOCKET PAGE',
60 # the menu items on the top
61 context['topmenu_items'] = topmenu_items('Dashboard', self.request)
62 # so we can sho who is logged
63 context['username'] = the_user(self.request)