IMPORTANT: myslice/manifold folder REMOVED due to conflicts with Manifold Server...
[myslice.git] / portal / dashboardview.py
index 17e3a5c..a4e0ad4 100644 (file)
@@ -1,6 +1,6 @@
 import json
 from manifold.core.query         import Query
-from manifold.manifoldapi        import execute_query
+from manifoldapi.manifoldapi     import execute_query
 
 from unfold.page                 import Page
 
@@ -11,8 +11,10 @@ from unfold.loginrequired        import LoginRequiredAutoLogoutView
 
 from ui.topmenu                  import topmenu_items_live, the_user
 
+from theme import ThemeView
+
 #This view requires login 
-class DashboardView (LoginRequiredAutoLogoutView):
+class DashboardView (LoginRequiredAutoLogoutView, ThemeView):
 
     template_name = "dashboard.html"
     
@@ -20,14 +22,14 @@ class DashboardView (LoginRequiredAutoLogoutView):
         # We might have slices on different registries with different user accounts 
         # 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
         # Different registries mean different identities, unless we identify via SFA HRN or have associated the user email to a single hrn
-
+       print self.request
         #messages.info(self.request, 'You have logged in')
         page = Page(self.request)
 
         print "Dashboard page"
         # Slow...
         #slice_query = Query().get('slice').filter_by('user.user_hrn', 'contains', user_hrn).select('slice_hrn')
-        testbed_query  = Query().get('network').select('network_hrn','platform')
+        testbed_query  = Query().get('network').select('network_hrn','platform','version')
         # DEMO GEC18 Query only PLE
 #        user_query  = Query().get('local:user').select('config','email')
 #        user_details = execute_query(self.request, user_query)
@@ -53,6 +55,7 @@ class DashboardView (LoginRequiredAutoLogoutView):
         slicelist = SliceList(
             page  = page,
             title = "slices",
+            warning_msg = "<a href='../slice_request'>Request Slice</a>",
             query = slice_query,
         )
         testbedlist = TestbedList(
@@ -74,6 +77,8 @@ class DashboardView (LoginRequiredAutoLogoutView):
         # so we can sho who is logged
         context['username'] = the_user(self.request) 
 
+        context['theme'] = self.theme
+        
         page.expose_js_metadata()
 
         # the page header and other stuff