From f775a1ed9099eebfc0002ad2a3566000af599468 Mon Sep 17 00:00:00 2001 From: Loic Baron Date: Sat, 12 Oct 2013 13:54:25 +0200 Subject: [PATCH] Dashboard: link to a single platform in the list of testbeds - http://trac.myslice.info/ticket/26 --- plugins/lists/static/js/simplelist.js | 2 +- plugins/query_editor/__init__.py | 3 ++- plugins/query_editor/templates/query_editor.html | 1 - portal/dashboardview.py | 8 ++++---- portal/templates/dashboard.html | 16 ++++++++-------- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/plugins/lists/static/js/simplelist.js b/plugins/lists/static/js/simplelist.js index 6a65673a..6a61ca53 100644 --- a/plugins/lists/static/js/simplelist.js +++ b/plugins/lists/static/js/simplelist.js @@ -95,7 +95,7 @@ function cell(key, value) { if (key == 'slice.slice_hrn') { return "" + value + ""; - } else if (key == 'network_hrn') { + } else if (key == 'platform') { return "" + value + ""; } else { return value; diff --git a/plugins/query_editor/__init__.py b/plugins/query_editor/__init__.py index b489aa6e..0312ef1f 100644 --- a/plugins/query_editor/__init__.py +++ b/plugins/query_editor/__init__.py @@ -30,12 +30,12 @@ class QueryEditor(Plugin): def template_env(self, request): fields = [] + #hidden_columns = self.hidden_columns metadata = self.page.get_metadata() md_fields = metadata.details_by_object('resource') # XXX use django templating system here for md_field in md_fields['column']: - if md_field['type'] == 'string': if 'allowed_values' in md_field: allowed_values = md_field['allowed_values'].split(',') @@ -81,4 +81,5 @@ class QueryEditor(Plugin): 'header': None, 'checked': md_field['name'] in self.query.get_select() }) + #return { 'fields': fields, 'hidden_columns': hidden_columns } return { 'fields': fields } diff --git a/plugins/query_editor/templates/query_editor.html b/plugins/query_editor/templates/query_editor.html index 972015ae..9afba08f 100644 --- a/plugins/query_editor/templates/query_editor.html +++ b/plugins/query_editor/templates/query_editor.html @@ -6,7 +6,6 @@ EOF; $filter_input = ""; EOF; --> -
diff --git a/portal/dashboardview.py b/portal/dashboardview.py index 01478c7d..8e1fa4c4 100644 --- a/portal/dashboardview.py +++ b/portal/dashboardview.py @@ -23,7 +23,7 @@ class DashboardView (LoginRequiredAutoLogoutView): # Slow... #slice_query = Query().get('slice').filter_by('user.user_hrn', 'contains', user_hrn).select('slice_hrn') slice_query = Query().get('user').filter_by('user_hrn', '==', '$user_hrn').select('user_hrn', 'slice.slice_hrn') - auth_query = Query().get('network').select('network_hrn') + auth_query = Query().get('network').select('network_hrn','platform') print "AUTH QUERY =====================", auth_query print "filter", auth_query.filters page.enqueue_query(slice_query) @@ -38,14 +38,14 @@ class DashboardView (LoginRequiredAutoLogoutView): key = 'slice.slice_hrn', query = slice_query, ) - + # XXX TODO: plugins/lists/static/js/simplelist.js => hardcoded keys that give links : slice_hrn & platform authlist = SimpleList( title = None, page = page, - key = 'network_hrn', + key = 'platform', query = auth_query, ) - + context = super(DashboardView, self).get_context_data(**kwargs) context['person'] = self.request.user context['networks'] = authlist.render(self.request) diff --git a/portal/templates/dashboard.html b/portal/templates/dashboard.html index 972e4b1b..075d1d6a 100644 --- a/portal/templates/dashboard.html +++ b/portal/templates/dashboard.html @@ -24,14 +24,14 @@ -
-
-

Testbeds

-
-
- {{networks}} -
-
+
+
+

Testbeds

+
+
+ {{networks}} +
+
-- 2.43.0