Commit 432b69da authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Migrate to dbui 0.4.9.2 and modify the node structure in the viewport.

parent 901a758e
This diff is collapsed.
......@@ -25,7 +25,7 @@ main_tables = ['diplomas', 'publications']
#
# The configuration tools node
# configuration tables node
#
if session.role == 'admin':
hidden_tables = set(db.tables).difference(configuration_tools_tables)
......@@ -46,24 +46,48 @@ else:
hidden_tables = set(db.tables).difference(main_tables)
#
# The grid node of the navigation tree
# core tables node
#
gridNode = dbui.Node(T('Tables'))
configurator = lambda tablename: dbui.to_gridPanel(db[tablename])
gridNode.add_children(db.tables, func=configurator, hidden=hidden_tables)
#
# The tool node of the navigation tree
# The tools accessible depend on the user role
# help node
#
fields = dbui.to_fields(virtdb.authors_selector)
selector = dbui.FieldSet(items=fields, plugins=['pFormToolTip'],
title=T('Fill'))
authorNode = dbui.PanelWithUrlSelector(baseUrl='/'+request.application+'/helpers/extract_authors',
isMathJax=False,
panelCfg=dbui.Panel(),
selectorCfg=selector,
selectorCollapsible=False)
schemaNode = dbui.Panel(autoLoad='/'+request.application+'/default/schema')
versionNode = dbui.Panel(autoLoad='/'+request.application+'/default/versions')
helpNode = dbui.Node(T('Help'))
helpNode.add_child(T('versions'), versionNode)
if session.role == 'admin':
helpNode.add_child(T('database schema'), schemaNode)
helpNode.sort_children()
#
# report node
#
url = '/'+request.application+'/lists'
listNode = dbui.to_panel_with_url_selector(virtdb.list_selector,
url,
is_mathjax=dbui.is_mathjax())
url = '/'+request.application+'/metrics'
metricNode = dbui.to_panel_with_url_selector(virtdb.metric_selector, url)
reportNode = dbui.Node(T('Reports'))
reportNode.add_child(T('lists'), listNode)
reportNode.add_child(T('metrics'), metricNode)
reportNode.sort_children()
#
# wizard node
#
url = '/'+request.application+'/helpers/extract_authors'
authorNode = dbui.to_panel_with_url_selector(virtdb.authors_selector, url)
fields = dbui.to_fields(virtdb.harvester_selector)
selector = dbui.FieldSet(items=fields, plugins=['pFormToolTip'],
......@@ -76,48 +100,17 @@ harvesterNode = dbui.PanelWithUrlSelector(baseUrl='/'+request.application+'/harv
selectorCollapsible=False,
timeout=3600)
fields = dbui.to_fields(virtdb.list_selector)
selector = dbui.FieldSet(items=fields, plugins=['pFormToolTip'],
title=T('Select'))
listNode = dbui.PanelWithUrlSelector(baseUrl='/'+request.application+'/lists',
isMathJax=dbui.is_mathjax(),
panelCfg=dbui.Panel(),
selectorCfg=selector,
selectorCollapsible=False)
fields = dbui.to_fields(virtdb.marc12_selector)
selector = dbui.FieldSet(items=fields, plugins=['pFormToolTip'],
title=T('Select'))
marc12Node = dbui.PanelWithUrlSelector(baseUrl='/'+request.application+'/harvest',
ctrlField='Marc12_selectorController',
isMathJax=False,
panelCfg=dbui.Panel(),
selectorCfg=selector,
selectorCollapsible=False)
fields = dbui.to_fields(virtdb.metric_selector)
selector = dbui.FieldSet(items=fields, title=T('Select'))
metricNode = dbui.PanelWithUrlSelector(baseUrl='/'+request.application+'/metrics',
isMathJax=False,
panelCfg=dbui.Panel(),
selectorCfg=selector,
selectorCollapsible=False)
schemaNode = dbui.Panel(autoLoad='/'+request.application+'/default/schema')
versionNode = dbui.Panel(autoLoad='/'+request.application+'/default/versions')
url = '/'+request.application+'/harvest'
marc12Node = dbui.to_panel_with_url_selector(virtdb.marc12_selector, url)
toolNode = dbui.Node(T('Tools'))
toolNode.add_child(T('get lists'), listNode)
toolNode.add_child(T('get metrics'), metricNode)
toolNode.add_child(T('insert MARCXML'), marc12Node)
toolNode.add_child(T('versions'), versionNode)
wizardNode = dbui.Node(T('Wizards'))
wizardNode.add_child(T('insert MARCXML'), marc12Node)
if session.role == 'admin':
toolNode.add_child(T('extract authors'), authorNode)
toolNode.add_child(T('database schema'), schemaNode)
toolNode.add_child(T('run harvesters'), harvesterNode)
wizardNode.add_child(T('extract authors'), authorNode)
wizardNode.add_child(T('run harvesters'), harvesterNode)
toolNode.sort_children()
wizardNode.sort_children()
#
# The viewport with its navigation tree
......@@ -127,10 +120,10 @@ viewportModifier = dbui.ViewportModifier()
viewportModifier.append_plugins('pViewportLogin')
if session.role == 'admin':
viewportModifier.add_node(confNode, gridNode, toolNode)
viewportModifier.add_node(helpNode, wizardNode, confNode, gridNode, reportNode)
viewportModifier.configure(logged=True)
else:
viewportModifier.add_node(gridNode, toolNode)
viewportModifier.add_node(helpNode, wizardNode, gridNode, reportNode)
viewportModifier.configure(logged=False)
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment