forked from elmau/empresa-libre
Config title app
This commit is contained in:
commit
b73d0d6284
|
@ -96,6 +96,11 @@ class AppValues(object):
|
|||
values = req.params
|
||||
session = req.env['beaker.session']
|
||||
|
||||
if req.path == '/values/titlelogin':
|
||||
req.context['result'] = self._db.get_values(table, values, session)
|
||||
resp.status = falcon.HTTP_200
|
||||
return
|
||||
|
||||
if not 'userobj' in session and req.path != '/values/empresas':
|
||||
session.invalidate()
|
||||
raise falcon.HTTPTemporaryRedirect('/')
|
||||
|
|
|
@ -37,7 +37,9 @@ class AuthMiddleware(object):
|
|||
user = session.get('userobj', None)
|
||||
id_session = req.cookies.get('beaker.session.id', '')
|
||||
|
||||
if req.path == '/empresas' or req.path == '/values/empresas':
|
||||
if req.path == '/values/titlelogin':
|
||||
pass
|
||||
elif req.path == '/empresas' or req.path == '/values/empresas':
|
||||
if MV:
|
||||
pass
|
||||
else:
|
||||
|
|
|
@ -25,6 +25,9 @@ class StorageEngine(object):
|
|||
return getattr(self, '_get_{}'.format(table))(values, session)
|
||||
return getattr(self, '_get_{}'.format(table))(values)
|
||||
|
||||
def _get_titlelogin(self, values):
|
||||
return main.get_title_app(2)
|
||||
|
||||
def _get_canopenpre(self, values):
|
||||
return main.PreFacturasDetalle.can_open(values['id'])
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ if __name__ == '__main__':
|
|||
from controllers import util
|
||||
from settings import log, VERSION, PATH_CP, COMPANIES, PRE, CURRENT_CFDI, \
|
||||
INIT_VALUES, DEFAULT_PASSWORD, DECIMALES, IMPUESTOS, DEFAULT_SAT_PRODUCTO, \
|
||||
CANCEL_SIGNATURE, PUBLIC, DEFAULT_SERIE_TICKET, DECIMALES_TAX
|
||||
CANCEL_SIGNATURE, PUBLIC, DEFAULT_SERIE_TICKET, DECIMALES_TAX, TITLE_APP
|
||||
|
||||
|
||||
FORMAT = '{0:.2f}'
|
||||
|
@ -194,13 +194,13 @@ def config_main():
|
|||
|
||||
punto_de_venta = util.get_bool(Configuracion.get_('chk_usar_punto_de_venta'))
|
||||
data = {
|
||||
'empresa': 'Empresa Libre',
|
||||
'empresa': get_title_app(3),
|
||||
'punto_de_venta': punto_de_venta
|
||||
|
||||
}
|
||||
if not obj is None:
|
||||
titulo = 'Empresa Libre - <b><font color="#610B0B">{}</font></b>'
|
||||
data['empresa'] = titulo.format(obj.nombre)
|
||||
titulo = '{} - <b><font color="#610B0B">{}</font></b>'
|
||||
data['empresa'] = titulo.format(data['empresa'], obj.nombre)
|
||||
|
||||
return data
|
||||
|
||||
|
@ -5035,6 +5035,15 @@ def get_sat_productos(key):
|
|||
return util.get_sat_productos(key)
|
||||
|
||||
|
||||
def get_title_app(by=1):
|
||||
html = {
|
||||
1: '<font color="#610B0B">{}</font>',
|
||||
2: '<font color="#610B0B">Bienvenido a {}</font>',
|
||||
3: '<font color="#000000">{}</font>',
|
||||
}
|
||||
return html[by].format(TITLE_APP)
|
||||
|
||||
|
||||
def test_correo(values):
|
||||
server = {
|
||||
'servidor': values['correo_servidor'],
|
||||
|
|
|
@ -19,6 +19,11 @@ try:
|
|||
except ImportError:
|
||||
SEAFILE_SERVER = {}
|
||||
|
||||
try:
|
||||
from conf import TITLE_APP
|
||||
except ImportError:
|
||||
TITLE_APP = 'Empresa Libre'
|
||||
|
||||
|
||||
DEBUG = DEBUG
|
||||
VERSION = '1.2.0'
|
||||
|
|
|
@ -16,12 +16,11 @@ var form_controls = [
|
|||
]
|
||||
|
||||
|
||||
var msg_header = '<font color="#610B0B">Bienvenido a Empresa Libre</font>'
|
||||
|
||||
var ui_login = {
|
||||
rows: [
|
||||
{maxHeight: 50},
|
||||
{view: 'template', template: msg_header, maxHeight: 50, css: 'login_header'},
|
||||
{view: 'template', id: 'title_login', template: '', maxHeight: 50,
|
||||
css: 'login_header'},
|
||||
{maxHeight: 50},
|
||||
{cols: [{}, {type: 'space', padding: 5,
|
||||
rows: [
|
||||
|
|
|
@ -36,6 +36,10 @@ function validate_login(){
|
|||
|
||||
webix.ready(function(){
|
||||
webix.ui(ui_login);
|
||||
webix.ajax().get("/values/titlelogin", function(text, data, xhr){
|
||||
var value = data.json();
|
||||
$$("title_login").setHTML(value);
|
||||
})
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue