from plugins.raw.raw import Raw
from plugins.stack.stack import Stack
from plugins.tabs.tabs import Tabs
from plugins.raw.raw import Raw
from plugins.stack.stack import Stack
from plugins.tabs.tabs import Tabs
from plugins.senslabmap.senslabmap import SensLabMap
from plugins.querycode.querycode import QueryCode
from plugins.query_editor import QueryEditor
from plugins.senslabmap.senslabmap import SensLabMap
from plugins.querycode.querycode import QueryCode
from plugins.query_editor import QueryEditor
class SliceView (LoginRequiredAutoLogoutView):
def get (self,request, slicename=tmp_default_slice):
page = Page(request)
page.add_css_files ('css/slice-view.css')
class SliceView (LoginRequiredAutoLogoutView):
def get (self,request, slicename=tmp_default_slice):
page = Page(request)
page.add_css_files ('css/slice-view.css')
aq = AnalyzedQuery(main_query, metadata=metadata)
page.enqueue_query(main_query, analyzed_query=aq)
page.enqueue_query(query_resource_all)
aq = AnalyzedQuery(main_query, metadata=metadata)
page.enqueue_query(main_query, analyzed_query=aq)
page.enqueue_query(query_resource_all)
- sq_resource = aq.subquery('resource')
- sq_user = aq.subquery('user')
- sq_lease = aq.subquery('lease')
+ sq_resource = aq.subquery('resource')
+ sq_user = aq.subquery('user')
+ sq_lease = aq.subquery('lease')
resources_as_list = Hazelnut(
page = page,
title = 'Resources as a List',
resources_as_list = Hazelnut(
page = page,
title = 'Resources as a List',
# this is the query at the core of the slice list
query = sq_resource,
query_all = query_resource_all,
# this is the query at the core of the slice list
query = sq_resource,
query_all = query_resource_all,
datatables_options = {
# for now we turn off sorting on the checkboxes columns this way
# this of course should be automatic in hazelnut
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,
- 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, ],
- 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,
+ },
+ ))