Commit a39b2704 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Refactor the graph controllers: dashboard, linechart and stackedchart.

parent 2b4a81c7
......@@ -14,6 +14,23 @@ INLINE_ALERT = "<script>Ext.Msg.alert('%s', '%s');</script>"
def dashboard():
"""Return a pre-configure linechart for public used.
Cumulative distribution for the publications are shown for
the current year.
"""
selector = Storage()
selector.Dashboard_selectorCumulative = True
selector.Dashboard_selectorId = ''
selector.Dashboard_selectorId_projects = ''
selector.Dashboard_selectorId_teams = ''
selector.Dashboard_selectorYear_start = datetime.now().year
selector.Dashboard_selectorYear_end = ''
redirect(URL('graphs', 'linechart', vars=selector))
def linechart():
"""show the cumulative distribution of the number of publications
as a function of the months. It can be build for the institute,
for a team or for a project.
......
......@@ -311,6 +311,7 @@
'liaisons, team leaders,...': 'correspondants, chefs de groupe,...',
'licence': 'license',
'Lignes': 'Lignes',
'line chart': 'line chart',
'List': 'Liste',
'List of authors belonging to your institute, separated by comma: P.-Y. Doe, J. Smith': 'Liste des auteurs du labaoratoire, séparé par une virgule : P.-Y. Doe, J. Smith',
'List of authors separated by comma: J. Doe, P.-Y. Smith': 'Liste des auteurs séparé par une virgule : J. Doe, P.-Y. Smith',
......
......@@ -147,14 +147,24 @@ helpNode.sort_children()
# REPORT NODE
#
#-------------------------------------------------------------------------------
dashBoardLeaf = PanelWithUrlSelector(virtdb.dashboard_selector,
baseUrl=URL('graphs', 'dashboard'))
loader = dict(autoLoad=True,
renderer='html',
scripts=True,
url=URL('graphs', 'dashboard'))
dashBoardLeaf = Panel(loader=loader,
plugins=['pPanelLoaderException'],
autoScroll=True)
listLeaf = PanelWithUrlSelector(virtdb.list_selector,
baseUrl=URL('lists', 'index'),
extField='format',
plugins=['pMathJax'])
lineChartLeaf = PanelWithUrlSelector(virtdb.dashboard_selector,
baseUrl=URL('graphs', 'linechart'))
metricLeaf = PanelWithUrlSelector(virtdb.metric_selector,
baseUrl=URL('metrics', 'index'),
extField='format')
......@@ -163,13 +173,12 @@ stackedChartLeaf = PanelWithUrlSelector(virtdb.stackedchart_selector,
baseUrl=URL('graphs', 'stackedchart'))
reportNode = Node(T('Reports'))
reportNode.add_child(T('dashboard'), dashBoardLeaf)
reportNode.add_child(T('lists'), listLeaf)
reportNode.add_child(T('metrics'), metricLeaf)
reportNode.add_child(T('dashboard'), dashBoardLeaf)
reportNode.add_child(T('line chart'), lineChartLeaf)
reportNode.add_child(T('stacked chart'), stackedChartLeaf)
reportNode.sort_children()
#-------------------------------------------------------------------------------
#
# WIZARD NODE
......@@ -252,3 +261,6 @@ if "auth" in globals():
if session.role in (ADMIN, USER):
viewportModifier.configure(logged=True)
viewportModifier.default_node(T('Data publications'), T('publications'))
else:
viewportModifier.default_node(T('Reports'), T('dashboard'))
\ 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