X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=portal%2Fsliceview.py;h=fff0371309ceeb27577f1a4e9433e72600378e1a;hb=660bb053b1b501b225ba97ff7f14167fe7b06a0a;hp=bebce2136c3dbd47400c760c13581b16f697f60f;hpb=196ec13c424b0d71d3267bde4f9d4ceeda28feb8;p=myslice.git diff --git a/portal/sliceview.py b/portal/sliceview.py index bebce213..fff03713 100644 --- a/portal/sliceview.py +++ b/portal/sliceview.py @@ -25,7 +25,7 @@ from plugins.messages.messages import Messages tmp_default_slice='ple.upmc.myslicedemo' # temporary : turn off the users part to speed things up -do_query_users=true +do_query_users=True class SliceView (LoginRequiredAutoLogoutView): @@ -34,6 +34,7 @@ class SliceView (LoginRequiredAutoLogoutView): page = Page(request) page.add_css_files ('css/slice-view.css') page.add_js_chunks ('$(function() { console.log("sliceview: jQuery version " + $.fn.jquery); });') + page.add_js_chunks ('$(function() { console.log("sliceview: users turned %s"); });'%("on" if do_query_users else "off")) page.expose_js_metadata() metadata = page.get_metadata() @@ -115,7 +116,7 @@ class SliceView (LoginRequiredAutoLogoutView): resources_as_list = Hazelnut( page = page, title = 'Resources as a List', - domid = 'checkboxes', + domid = 'resources_list', # this is the query at the core of the slice list query = sq_resource, query_all = query_resource_all, @@ -123,9 +124,10 @@ class SliceView (LoginRequiredAutoLogoutView): datatables_options = { # for now we turn off sorting on the checkboxes columns this way # this of course should be automatic in hazelnut - 'aoColumns' : [None, None, None, None, {'bSortable': False}], - 'iDisplayLength' : 25, - 'bLengthChange' : True, + 'aoColumns' : [None, None, None, None, {'bSortable': False}], + 'iDisplayLength': 25, + 'bLengthChange' : True, + 'bAutiWidth' : True, }, ) @@ -147,10 +149,12 @@ class SliceView (LoginRequiredAutoLogoutView): resources_query_editor = QueryEditor( page = page, query = sq_resource, + title = "Select Columns", ) resources_active_filters = ActiveFilters( page = page, query = sq_resource, + title = "Active Filters ?", ) resources_area = Stack ( @@ -161,13 +165,17 @@ class SliceView (LoginRequiredAutoLogoutView): outline_complete=True, sons = [ Tabs ( page=page, - sons=[ resources_as_list, resources_as_map, ] + sons=[ resources_as_list, resources_as_map, ] , + active_domid = 'gmap', + ), + Tabs ( page=page, + title="Customize Resources layout", + togglable=True, + toggled='persistent', + domid="customize-resources", + outline_complete=True, + sons = [ resources_query_editor, resources_active_filters, ], ), - Stack ( page=page, - title="Customize", - togglable=True, - sons = [ resources_query_editor, resources_active_filters, ] - ), ] ) @@ -206,34 +214,35 @@ class SliceView (LoginRequiredAutoLogoutView): # USERS # - tab_users = Tabs( - page = page, - domid = 'users', - outline_complete = True, - togglable = True, - title = 'Users', - active_domid = 'checkboxes2', - ) - main_stack.insert(tab_users) + if do_query_users: + tab_users = Tabs( + page = page, + domid = 'users', + outline_complete = True, + togglable = True, + title = 'Users', + active_domid = 'checkboxes2', + ) + main_stack.insert(tab_users) -# tab_users.insert(Hazelnut( -# page = page, -# title = 'Users List', -# domid = 'checkboxes2', -# # tab's sons preferably turn this off -# togglable = False, -# # this is the query at the core of the slice list -# query = sq_user, -# query_all = query_user_all, -# checkboxes = True, -# datatables_options = { -# # for now we turn off sorting on the checkboxes columns this way -# # this of course should be automatic in hazelnut -# 'aoColumns' : [None, None, None, None, {'bSortable': False}], -# 'iDisplayLength' : 25, -# 'bLengthChange' : True, -# }, -# )) + tab_users.insert(Hazelnut( + page = page, + title = 'Users List', + domid = 'checkboxes2', + # tab's sons preferably turn this off + togglable = False, + # this is the query at the core of the slice list + query = sq_user, + query_all = query_user_all, + checkboxes = True, + datatables_options = { + # for now we turn off sorting on the checkboxes columns this way + # this of course should be automatic in hazelnut + 'aoColumns' : [None, None, None, None, {'bSortable': False}], + 'iDisplayLength' : 25, + 'bLengthChange' : True, + }, + )) tab_measurements = Tabs ( page = page,