X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=trash%2Fsliceview.py;h=8f8a8baba542ee364080ab18a85f2b8a15787527;hb=40b1d29c1699a5a04387c0e70e4c42c226a8f14d;hp=2811bb6b8eaa9ddc6e093dfe213bba91a9549c82;hpb=c6f034023202f3e233956e3eb7fdd020ca45867f;p=myslice.git diff --git a/trash/sliceview.py b/trash/sliceview.py index 2811bb6b..8f8a8bab 100644 --- a/trash/sliceview.py +++ b/trash/sliceview.py @@ -8,18 +8,22 @@ from django.contrib.auth.decorators import login_required from unfold.page import Page from manifold.manifoldquery import ManifoldQuery +from plugins.raw.raw import Raw from plugins.stack.stack import Stack from plugins.tabs.tabs import Tabs -from plugins.hazelnut.hazelnut import Hazelnut from plugins.lists.slicelist import SliceList +from plugins.hazelnut.hazelnut import Hazelnut +from plugins.googlemap.googlemap import GoogleMap +from plugins.senslabmap.senslabmap import SensLabMap from plugins.querycode.querycode import QueryCode from plugins.quickfilter.quickfilter import QuickFilter +from plugins.messages.messages import Messages from myslice.viewutils import quickfilter_criterias from myslice.viewutils import topmenu_items, the_user -tmp_default_slice='ple.inria.sfatest' +tmp_default_slice='ple.inria.heartbeat' @login_required def slice_view (request, slicename=tmp_default_slice): @@ -38,18 +42,27 @@ def slice_view (request, slicename=tmp_default_slice): page=page, title="Slice view for %s"%slicename, domid='thestack', -# togglable=False, - sons=[Tabs ( + togglable=False, + sons=[ + Raw (page=page,togglable=False, toggled=True,html="

Slice page for %s

"%slicename), + Messages ( + page=page, + title="Runtime messages for slice %s"%slicename, + domid="msgs-pre", + levels="ALL", + ), + Tabs ( page=page, title="2 tabs : w/ and w/o checkboxes", domid='thetabs', -# toggled=False, - active_domid='checkboxes', + # active_domid='checkboxes', + active_domid='gmap', sons=[ Hazelnut ( page=page, title='a sample and simple hazelnut', domid='simple', + # tab's sons preferably turn this off togglable=False, # this is the query at the core of the slice list query=main_query, @@ -58,35 +71,77 @@ def slice_view (request, slicename=tmp_default_slice): page=page, title='with checkboxes', domid='checkboxes', + # tab's sons preferably turn this off togglable=False, - checkboxes=True, # this is the query at the core of the slice list query=main_query, - # this of course should be automatic in hazelnut - # for now we turn off sorting on the checkboxes columns this way - datatables_options = { 'aoColumns' : [ None, None, None, None, {'bSortable': False} ] }, + 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, + }, + ), + GoogleMap ( + page=page, + title='geographic view', + domid='gmap', + # tab's sons preferably turn this off + togglable=False, + query=main_query, + # center on Paris + latitude=49., + longitude=2.2, + zoom=3, + ), + Raw ( +# SensLabMap ( + page=page, + title='3D view (disabled)', + domid='smap', +# # tab's sons preferably turn this off + togglable=False, +# query=main_query, + html="""

+Thierry: I am commeting off the use of which, + although rudimentarily ported to the django framework, +causes a weird behaviour especially wrt scrolling. +On my Mac any longer +if I keep this active, so for now it's disabled +

""", ), ]), - Hazelnut ( + Hazelnut ( page=page, - title='not in tabs', + title='a hazelnut not in tabs', domid='standalone', -# toggled=False, # this is the query at the core of the slice list query=main_query, columns=['hrn','hostname'], ), - QueryCode ( + # you don't *have to* set a domid, but if you plan on using toggled=persistent then it's required + # because domid is the key for storing toggle status in the browser + QueryCode ( page=page, - title='xmlrpc code', + title='xmlrpc code (toggled=False)', query=main_query, -# toggled=False, +# domid='xmlrpc', + toggled=False, ), - QuickFilter ( + QuickFilter ( page=page, - title="QuickFilter is currently the only one that requires metadata", - criterias=quickfilter_criterias + title="QuickFilter - requires metadata (toggled=False)", + criterias=quickfilter_criterias, + domid='filters', + toggled=False, ), + Messages ( + page=page, + title="Runtime messages (again)", + domid="msgs-post", + ) ]) # variables that will get passed to the view-unfold1.html template @@ -96,14 +151,14 @@ def slice_view (request, slicename=tmp_default_slice): template_env [ 'unfold1_main' ] = main_plugin.render(request) # more general variables expected in the template - template_env [ 'title' ] = 'Test view for hazelnut' + template_env [ 'title' ] = 'Test view that combines various plugins' # the menu items on the top template_env [ 'topmenu_items' ] = topmenu_items('slice', request) # so we can sho who is logged template_env [ 'username' ] = the_user (request) # don't forget to run the requests - page.exec_queue_asynchroneously () + page.expose_queries () # xxx create another plugin with the same query and a different layout (with_datatables) # show that it worls as expected, one single api call to backend and 2 refreshed views