X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=portal%2Fsliceview.py;h=24567f3862fbef72e8e7ec348b2e816233b62c9a;hb=3ca7ddcaea07557767696dd2a622059a5c2078f8;hp=e4e1bc5fd76e89f4e78be2ac7a5ed73b202728ad;hpb=3a7b21bbf4396590a40ea02d83846ce3ed951f53;p=myslice.git diff --git a/portal/sliceview.py b/portal/sliceview.py index e4e1bc5f..24567f38 100644 --- a/portal/sliceview.py +++ b/portal/sliceview.py @@ -13,7 +13,7 @@ from plugins.stack.stack import Stack from plugins.tabs.tabs import Tabs from plugins.hazelnut import Hazelnut from plugins.resources_selected import ResourcesSelected -from plugins.googlemaps import GoogleMaps +from plugins.googlemap import GoogleMap from plugins.senslabmap.senslabmap import SensLabMap from plugins.querycode.querycode import QueryCode from plugins.query_editor import QueryEditor @@ -34,7 +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("users turned %s"); });'%("on" if do_query_users else "off")) + 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() @@ -95,8 +95,8 @@ class SliceView (LoginRequiredAutoLogoutView): ) # -------------------------------------------------------------------------- - # ResourcesSelected - # + # ResourcesSelected (Pending Operations) + main_stack.insert(ResourcesSelected( page = page, title = 'Pending operations', @@ -106,34 +106,14 @@ class SliceView (LoginRequiredAutoLogoutView): outline_complete = True, )) -# main_stack.insert( -# Raw (page=page,togglable=False, toggled=True,html='Description: TODO') -# ) - - # the resources part is made of a Stack, - # with first a Tabs (List, Geographic), - # and second the QueryEditor to tweak the set of attributes to show - resources_as_list = Hazelnut( - page = page, - title = 'Resources as a List', - domid = 'checkboxes', - # this is the query at the core of the slice list - query = sq_resource, - query_all = query_resource_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, - }, - ) + # -------------------------------------------------------------------------- + # RESOURCES + # the resources part is made of a Tabs (Geographic, List), - resources_as_map = GoogleMaps( + resources_as_map = GoogleMap( page = page, title = 'Geographic view', - domid = 'gmap', + domid = 'resources-map', # tab's sons preferably turn this off togglable = False, query = sq_resource, @@ -145,67 +125,64 @@ class SliceView (LoginRequiredAutoLogoutView): zoom = 3, ) + resources_as_list = Hazelnut( + page = page, + domid = 'resources-list', + # this is the query at the core of the slice list + query = sq_resource, + query_all = query_resource_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, + 'bAutiWidth' : True, + }, + ) + 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 ( - page=page, - domid="resources", - togglable=True, - title="Resources", - outline_complete=True, - sons = [ - Tabs ( page=page, - sons=[ resources_as_list, resources_as_map, ] - ), - Stack ( page=page, - title="Customize", - togglable=True, - sons = [ resources_query_editor, resources_active_filters, ] - ), - ] + # List area itself is a Stack with hazelnut on top, + # and a togglable tabs for customization plugins + resources_as_list_area = Stack( + page = page, + title = 'Resources as a List', + domid = 'resources-list-area', + sons= [ resources_as_list, + Tabs ( page=page, + title="Customize Resources layout", + togglable=True, + toggled='persistent', + domid="customize-resources", + outline_complete=True, + sons = [ resources_query_editor, resources_active_filters, ], + ), + ], ) - + resources_area = Tabs ( page=page, + domid="resources", + togglable=True, + title="Resources", + outline_complete=True, + sons=[ resources_as_map, resources_as_list_area, ], + active_domid = 'resources-map', + ) main_stack.insert (resources_area) -# sq_plugin = Tabs ( -# page=page, -# title="Slice view for %s"%slicename, -# togglable=True, -# sons=[], -# ) - - - ############################################################################ - # RESOURCES - # - # A stack inserted in the subquery tab that will hold all operations - # related to resources - # - -# stack_resources = Stack( -# page = page, -# title = 'Resources', -# sons=[], -# ) - -# stack_resources.insert(resource_active_filters) -# -# -# stack_resources.insert(tab_resource_plugins) - -# sq_plugin.insert(stack_resources) - - ############################################################################ + # -------------------------------------------------------------------------- # USERS - # if do_query_users: tab_users = Tabs( @@ -237,6 +214,8 @@ class SliceView (LoginRequiredAutoLogoutView): }, )) + # -------------------------------------------------------------------------- + # MEASUREMENTS tab_measurements = Tabs ( page = page, active_domid = 'checkboxes3', @@ -265,6 +244,8 @@ class SliceView (LoginRequiredAutoLogoutView): }, )) + # -------------------------------------------------------------------------- + # MESSAGES (we use transient=False for now) main_stack.insert(Messages( page = page, title = "Runtime messages for slice %s"%slicename,