diff --git a/controllers/reports.py b/controllers/reports.py index 5a6e4bd72190833a7d1137162da887ea0207cfdc..82d570cdfa4bd1bafafdb13d61c07e9e702419fb 100644 --- a/controllers/reports.py +++ b/controllers/reports.py @@ -15,11 +15,11 @@ def report_1(): # Resolve foreign key query = db.publications.id_collaborations == db.collaborations.id query = (query) & (db.publications.id_publishers == db.publishers.id) - query = (query) & (db.publications.id_categories_aeres == db.categories_aeres.id) + query = (query) & (db.publications.id_categories == db.categories.id) # publication with comite de lecture query = (query) & (db.publications.conference_title == '') - query = (query) & ((db.categories_aeres.code == 'ACL') | (db.categories_aeres.code == 'ACLN')) + query = (query) & ((db.categories.code == 'ACL') | (db.categories.code == 'ACLN')) # Interrogate the database rows = db(query).select(db.publications.title, @@ -33,13 +33,6 @@ def report_1(): db.publications.first_page, db.publications.last_page, db.publications.conference_title, - db.categories_aeres.code) + db.categories.code) - return {'title': 'Rapport 1', 'publis': rows} - - -def report_2(): - """ Test jsmath on a standalone page - - """ - return {} + return {'title': 'Rapport 1', 'publis': rows} \ No newline at end of file diff --git a/languages/fr-fr.py b/languages/fr-fr.py index 2d34ef43d381fcf6178a0899360d012df61fa203..d8f6234019c7352b79a834ef0718f0af8f3e9c40 100644 --- a/languages/fr-fr.py +++ b/languages/fr-fr.py @@ -35,6 +35,7 @@ 'Report': 'Rapport', 'Report Numbers': 'Numéro du rapport', 'Report type': 'Type du rapport', +'Reports': 'Rapports', 'Speaker': 'Orateur', 'Start date': 'Date de début', 'Table': 'Table', @@ -55,6 +56,7 @@ 'projects': 'projets', 'publications': 'publications', 'publishers': 'éditeur', +'report_1': 'report_1', 'reports': 'rapports', 'select publication for a given year': 'selectionne les publication pour une année', 'select publications for a given CPPM author': 'selectionne les publications pour un auteur du CPPM', diff --git a/models/db_widgets.py b/models/db_widgets.py index b1a92106a69b990e6be9ab4644ecfe0e7d78f640..66c5f3b5af7d8ab53b98dd61b04fcaccfa0980dc 100755 --- a/models/db_widgets.py +++ b/models/db_widgets.py @@ -21,8 +21,13 @@ gridNode = dbui.NodeDB(T('Tables'), tables=db.tables, widget='xgrid') +reportNode = dbui.NodeURL(T('Reports'), + leaves=['report_1'], + urls=[URL(c="reports", f="report_1")], + widget='panel') + viewportModifier = dbui.ViewportModifier() -viewportModifier.add_node(formNode, gridNode) +viewportModifier.add_node(formNode, gridNode, reportNode) # # add plugin to all grids diff --git a/modules/plugin_dbui/cfgsvc.py b/modules/plugin_dbui/cfgsvc.py index c56d22ac743330ef85eaa406e9be644eaca2dee2..952518b4fde1431e3a82794c61ec723de7dae6cd 100755 --- a/modules/plugin_dbui/cfgsvc.py +++ b/modules/plugin_dbui/cfgsvc.py @@ -505,10 +505,12 @@ class CfgSvc(BaseSvc): if xtype in ('form', 'xform'): return self._get_form(tablename) - if xtype in ('grid', 'xgrid', 'xgridxithfilter'): + if xtype in ('grid', 'xgrid', 'xgridwithfilter'): return self._get_grid(tablename) - + return None + + def get_jsonstore(self, tablename): """Build the configuration object for the Ext.data.DirectJsonStore associated to the database table tablename. diff --git a/modules/plugin_dbui/navtree.py b/modules/plugin_dbui/navtree.py index 010ec811b7502ff2b175fb8a63ebdbf36f1737f9..1a5bc76c205d113004bf879d32d63ad25ea93489 100644 --- a/modules/plugin_dbui/navtree.py +++ b/modules/plugin_dbui/navtree.py @@ -111,7 +111,7 @@ class NodeURL(NodeBase): Name of the leaf appearing in the tree are translated. """ - def __init__(self, text, leaves=[], url=[], widget='', hidden=[], widgets={}): + def __init__(self, text, leaves=[], urls=[], widget='', hidden=[], widgets={}): T = current.T @@ -137,4 +137,4 @@ class NodeURL(NodeBase): if leaf in widgets: wdg = widgets[leaf] - self.add_children(refName=leaf, text=tr_leaf, url=url[i], widget=wdg) \ No newline at end of file + self.add_children(refName=leaf, text=tr_leaf, url=urls[i], widget=wdg) \ No newline at end of file diff --git a/static/plugin_dbui/src/appviewport.js b/static/plugin_dbui/src/appviewport.js index 7cc76832ae0555a982ea4e8c6cc12b6e85169c4d..a924b616f66e0cfa8521e3f5475ddcf33010238d 100644 --- a/static/plugin_dbui/src/appviewport.js +++ b/static/plugin_dbui/src/appviewport.js @@ -96,7 +96,8 @@ App.Viewport = Ext.extend(Ext.Viewport, { */ onCreateTab: function(node, event){ - var parent = node.parentNode, + var cfg, + parent = node.parentNode, panel, tabId, refName = node.attributes.refName, @@ -105,6 +106,7 @@ App.Viewport = Ext.extend(Ext.Viewport, { xtype = node.attributes.widget; function addWidget(cfg, response) { + if (cfg === null) {return;} wdg = Ext.ComponentMgr.create(cfg) panel.add(wdg); panel.doLayout(); @@ -124,17 +126,28 @@ App.Viewport = Ext.extend(Ext.Viewport, { return; } - // create a new tab and activate it - // the title is defined as 'Form tablename' or 'Grid tablename' - panel = this.tabPanel.add({ + // tab configuration + // the title is defined as 'Form tablename', 'Grid tablename', ... + // handle the simple case of panel pointing to an url + cfg = { itemId: tabId, closable: true, title: parent.attributes.text + " " + node.attributes.text - }); + }; + + if(xtype === 'panel' && node.attributes.url) { + cfg.autoLoad = node.attributes.url + } + // create a new tab and activate it + panel = this.tabPanel.add(cfg); this.tabPanel.setActiveTab(tabId); - // add the widget in the newly created tab - Dbui.getConfiguration(refName, xtype, addWidget); + // for complex object like form and grid request their configuration + // to the server and add the corresponding widget in the newly + // created tab + if (xtype !== 'panel') { + Dbui.getConfiguration(refName, xtype, addWidget); + } } }); diff --git a/views/reports/report_1.html b/views/reports/report_1.html index 3c75d5a53d40f49f33129cc8d459d0069a508c1a..1c35bdc831975a44f1c68da7abcf167f054014f6 100644 --- a/views/reports/report_1.html +++ b/views/reports/report_1.html @@ -3,7 +3,22 @@ <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>{{=title}}</title> + + <!-- mathjax library --> + <script type="text/x-mathjax-config"> + MathJax.Hub.Config({ + extensions: ["tex2jax.js"], + jax: ["input/TeX", "output/HTML-CSS"], + tex2jax: { + inlineMath: [ ['$','$'], ["\\(","\\)"] ], + displayMath: [ ['$$','$$'], ["\\[","\\]"] ], + processEscapes: true + }, + "HTML-CSS": { availableFonts: ["TeX"] } + }); + </script> <script type="text/javascript" src="/{{=request.application}}/static/plugin_mathjax/MathJax.js"></script> + </head> <body> <h2>Publications avec comité de lecture</h2>