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

Fixes #15.

parent 40d32b3f
......@@ -2,6 +2,7 @@
""" Common settings
"""
import datetime
import filters
import harvest_tools
import locale
......@@ -12,12 +13,11 @@ from callbacks import (INHIBIT_CASCADE_DELETE,
INHIBIT_PUBLICATION_DELETE_ON_OK,
INHIBIT_PUBLICATION_UPDATE_ON_OK)
from datetime import datetime
from gluon.tools import PluginManager
from regex import (REG_COLLABORATION,
REG_CONF_DATES,
REG_DEFENSE,
from regex import (REG_COLLABORATION,
REG_CONF_DATES,
REG_DEFENSE,
REG_SUBMITTED)
#-------------------------------------------------------------------------------
......@@ -27,19 +27,19 @@ from regex import (REG_COLLABORATION,
#-------------------------------------------------------------------------------
plugins = PluginManager()
plugins.dbui.app_css = 'static/my.css'
#plugins.dbui.app_js_dir = None
#plugins.dbui.app_libmin = None
# plugins.dbui.app_js_dir = None
# plugins.dbui.app_libmin = None
plugins.dbui.app_script = 'static/app.js'
#plugins.dbui.app_script_dir = None
# plugins.dbui.app_script_dir = None
#-------------------------------------------------------------------------------
#
# LANGUAGE
#
#-------------------------------------------------------------------------------
T.set_current_languages('en', 'en-gb', 'en-us') # mother tongue
T.force('fr-fr') # user language
T.lazy = False # immediate translation
T.set_current_languages('en', 'en-gb', 'en-us') # mother tongue
T.force('fr-fr') # user language
T.lazy = False # immediate translation
locale.setlocale(locale.LC_ALL, "fr_FR.UTF-8")
......@@ -50,25 +50,25 @@ locale.setlocale(locale.LC_ALL, "fr_FR.UTF-8")
#-------------------------------------------------------------------------------
undef = T(dbui.UNDEF)
undef_id = dbui.UNDEF_ID
year = datetime.now().year
year = datetime.datetime.now().year
CONTROLLERS = ['articles',
'notes',
'preprints',
'proceedings',
'proceedings',
'reports',
'talks',
'theses']
DIRS = ['ASC', 'DESC']
CAT_USUAL = [T('article'),
T('book'),
CAT_USUAL = [T('article'),
T('book'),
T('patent'),
T('poster'),
T('proceeding'),
T('report'),
T('talk'),
T('poster'),
T('proceeding'),
T('report'),
T('talk'),
T('thesis'),
undef]
CAT_USUAL.sort()
......@@ -114,7 +114,7 @@ tables = ['application',
# a user see the categories table but he/she can not modify it.
if session.role == USER:
tables.remove('categories')
dbui.configure_forms(tables, plugins=['pFormToolTip'], width=350)
dbui.configure_grids(tables, plugins=['pGridRowEditorConfirmDelete',
......
......@@ -13,10 +13,10 @@ fieldsModifier.configure_field('conference_start', format='Y-m-d')
fieldsModifier.configure_field('id_authors_roles', hidden=True)
fieldsModifier.configure_field('pages', emptyText=T('pages'))
fieldsModifier.configure_field('publication_date', format='Y-m-d')
fieldsModifier.configure_field('volume', emptyText=T('volume'))
fieldsModifier.configure_field('year',
emptyText=T('year'),
maxValue=datetime.now().year)
fieldsModifier.configure_field('volume', emptyText=T('volume'))
fieldsModifier.configure_field('year',
emptyText=T('year'),
maxValue=year)
if session.role == USER:
fieldsModifier.configure_field('id_status', hidden=True)
......@@ -33,7 +33,7 @@ formModifier.link_comboboxes(master=db.publications.id_projects,
masterHasSlaveData='organisation',
slaveExtJS={'hidden': True})
fieldsModifier.merge_fields('volume',
fieldsModifier.merge_fields('volume',
'pages',
fieldLabel=T('Volume / pages'))
......@@ -58,18 +58,18 @@ formModifier.merge_fields('conference_title',
'conference_speaker',
title=T('Conference'))
formModifier.merge_fields('report_numbers',
formModifier.merge_fields('report_numbers',
'id_reports',
title=T('Report'))
formModifier.merge_fields('directors',
formModifier.merge_fields('directors',
'universities',
'defense',
title=T('Thesis'))
formModifier.merge_fields('book_isbn',
'book_issn',
'book_chapters',
'book_chapters',
title=T('Book'))
formModifier.merge_fields('authors_institute',
......@@ -116,13 +116,13 @@ tpl = ['<b>{PublicationsTitle}</b><br>',
'<tpl if="PublicationsDefense">, {PublicationsDefense}</tpl>']
gridModifier = dbui.GridModifier('publications')
gridModifier.configure(plugins=['pGridPaging',
gridModifier.configure(plugins=['pGridPaging',
'pMathJax',
{'ptype': 'pGridRowEditorConfirmDelete',
{'ptype': 'pGridRowEditorConfirmDelete',
'resetFields': ['PublicationsId_status', 'PublicationsOrigin']}])
gridModifier.merge_columns('title',
'first_author',
'id_collaborations',
gridModifier.merge_columns('title',
'first_author',
'id_collaborations',
'id_publishers',
'volume',
'pages',
......@@ -174,7 +174,7 @@ gridModifier.append_filter(('id', '==', T('is equal to')), \
hidden=False, hideLabel=False, readOnly=False)
gridModifier.configure_filters(plugins=['pFormToolTip'], width=300)
gridModifier.configure_gridWithFilter(selectorTitle= T('Filter'))
gridModifier.configure_gridWithFilter(selectorTitle=T('Filter'))
#-------------------------------------------------------------------------------
#
......
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