# -*- coding: utf-8 -*- """ Common settings """ import datetime import filters import harvest_tools import plugin_dbui as dbui from callbacks import (INHIBIT_CASCADE_DELETE, INHIBIT_CONTROLLER_INSERT, INHIBIT_CONTROLLER_UPDATE, INHIBIT_DUPLICATE_PUBLICATION, INHIBIT_HARVESTER, INHIBIT_PUBLICATION_DELETE_ON_OK, INHIBIT_PUBLICATION_UPDATE_ON_OK) from gluon.tools import PluginManager from regex import (REG_COLLABORATION, REG_CONF_DATES, REG_DEFENSE, REG_SUBMITTED, REG_VALID_ORIGIN) #------------------------------------------------------------------------------- # # PLUGIN DBUI # #------------------------------------------------------------------------------- plugins = PluginManager() plugins.dbui.app_css = 'static/my.css' plugins.dbui.app_debug = None plugins.dbui.app_lg = 'static/limbra/locale/limbra-lang-fr.js' plugins.dbui.app_libmin = 'static/limbra-min.js' plugins.dbui.app_script = 'static/app.js' # 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 #------------------------------------------------------------------------------- # # CONSTANTS # #------------------------------------------------------------------------------- undef = T(dbui.UNDEF) undef_id = dbui.UNDEF_ID year = datetime.datetime.now().year CONTROLLERS = ['articles', 'notes', 'preprints', 'proceedings', 'reports', 'talks', 'theses'] DIRS = ['ASC', 'DESC'] CAT_USUAL = [T('article'), T('book'), T('patent'), T('poster'), T('proceeding'), T('report'), T('talk'), T('thesis'), undef] CAT_USUAL.sort() MODE_DRY_RUN = T(harvest_tools.DRY_RUN) MODE_CHANGE_STATUS = T('change status') MODE_LOAD_IN_DB = T('load in the database') ONE_HOUR = 3600000 STORES = ['cds.cern.ch', 'inspirehep.net'] #------------------------------------------------------------------------------- # # COMMON CONFIGURATION FOR FORMS AND GRIDS # #------------------------------------------------------------------------------- tables = ['application', 'auth_group', 'auth_membership', 'auth_user', 'authors_roles', 'axes', 'categories', 'collaborations', 'controllers', 'countries', 'harvesters', 'graphs', 'lists', 'metrics', 'my_authors', 'organisation', 'projects', 'publications', 'publishers', 'renderers', 'reports', 'sections', 'status', 'teams'] # 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', 'pGridRowEditorContextMenu', 'pGridRowEditorDblClick', 'pGridToolbar'])