Merge branch 'dev' of http://git.verdnatura.es/salix into dev
This commit is contained in:
commit
e6dd09cb6a
|
@ -1,6 +1,7 @@
|
||||||
vn-icon {
|
vn-icon {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
font-size: 18pt;
|
font-size: 18pt;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
& > i,
|
& > i,
|
||||||
& > i.material-icons {
|
& > i.material-icons {
|
||||||
|
|
|
@ -1,18 +1,12 @@
|
||||||
<vn-vertical ng-if="$ctrl.state.current.name === 'home'">
|
<div ng-if="$ctrl.state.current.name === 'home'">
|
||||||
<vn-horizontal>
|
<div class="modules">
|
||||||
<h6 vn-one translate="Modules access"></h6>
|
<a
|
||||||
</vn-horizontal>
|
ng-repeat="mod in ::$ctrl.modules"
|
||||||
<vn-module-container>
|
ui-sref="{{::mod.route.state}}"
|
||||||
<a ng-repeat="mod in ::$ctrl.modules" ui-sref="{{::mod.route.state}}" class="vn-module mdl-shadow--4dp">
|
translate-attr="{title: '{{::mod.name}}'}"
|
||||||
<vn-vertical class="home__icon">
|
class="mdl-shadow--4dp">
|
||||||
<vn-one>
|
<vn-icon icon="{{::mod.icon}}"></vn-icon>
|
||||||
<vn-icon ng-if="::mod.icon && !mod.icon.startsWith('/')" icon="{{::mod.icon}}"></vn-icon>
|
<h4 translate>{{::mod.name}}</h4>
|
||||||
<img ng-if="::mod.icon && mod.icon.startsWith('/')" ng-src="{{::mod.icon}}" />
|
|
||||||
</vn-one>
|
|
||||||
<vn-one>
|
|
||||||
<h4 translate="{{::mod.name}}"></h4>
|
|
||||||
</vn-one>
|
|
||||||
</vn-vertical>
|
|
||||||
</a>
|
</a>
|
||||||
</vn-horizontal>
|
</div>
|
||||||
</vn-vertical>
|
</div>
|
|
@ -1,59 +1,49 @@
|
||||||
vn-home {
|
vn-home {
|
||||||
padding: 2em;
|
padding: 2em;
|
||||||
vn-horizontal{
|
|
||||||
margin-bottom: 15px;
|
|
||||||
}
|
|
||||||
h6{
|
|
||||||
color: #3C393B;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
a:link{
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
vn-module-container{
|
|
||||||
display: flex;
|
|
||||||
flex: 1;
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
.vn-module{
|
& > div {
|
||||||
|
& > h6 {
|
||||||
|
color: #3C393B;
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
& > .modules {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex: none;
|
flex: 1;
|
||||||
margin: 10px;
|
flex-direction: row;
|
||||||
background-color: #FF9300;
|
justify-content: center;
|
||||||
color: white;
|
flex-wrap: wrap;
|
||||||
|
|
||||||
overflow:hidden;
|
& > a {
|
||||||
-moz-border-radius: 6px;
|
overflow:hidden;
|
||||||
-webkit-border-radius: 6px;
|
border-radius: 6px;
|
||||||
border-radius: 6px;
|
background-color: #FF9300;
|
||||||
|
color: white;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 8em;
|
||||||
|
width: 7em;
|
||||||
|
margin: .5em;
|
||||||
|
padding: 1em;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
.home__icon{
|
transition: opacity 250ms ease-out;
|
||||||
width: 150px;
|
|
||||||
height: 150px;
|
&:hover {
|
||||||
img {
|
opacity: .7;
|
||||||
max-width: 50%;
|
}
|
||||||
margin-top: 20px;
|
& > vn-icon {
|
||||||
|
font-size: 4em;
|
||||||
|
}
|
||||||
|
& > h4 {
|
||||||
|
text-align: center;
|
||||||
|
padding-top: .4em;
|
||||||
|
font-size: 16pt;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
h4{
|
|
||||||
text-transform: capitalize;
|
|
||||||
font-size: 16pt;
|
|
||||||
}
|
|
||||||
vn-one{
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
i{
|
|
||||||
font-size: 75px !important;
|
|
||||||
margin: 0 auto;
|
|
||||||
padding-top: 15px;
|
|
||||||
}
|
|
||||||
&:hover{
|
|
||||||
opacity: 0.7;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -113,6 +113,10 @@ html [noDrop], .noDrop{
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
|
|
||||||
|
&:link {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.vn-clickable {
|
.vn-clickable {
|
||||||
|
|
|
@ -8,7 +8,6 @@ export default {
|
||||||
vnSubmit: 'vn-submit > input',
|
vnSubmit: 'vn-submit > input',
|
||||||
vnTopbar: 'vn-topbar > header',
|
vnTopbar: 'vn-topbar > header',
|
||||||
vnIcon: 'vn-icon',
|
vnIcon: 'vn-icon',
|
||||||
vnModuleContainer: 'vn-module-container > a',
|
|
||||||
vnSearchBar: 'vn-searchbar > form > vn-horizontal',
|
vnSearchBar: 'vn-searchbar > form > vn-horizontal',
|
||||||
vnFloatButton: 'vn-float-button > button',
|
vnFloatButton: 'vn-float-button > button',
|
||||||
vnMenuItem: 'vn-menu-item > li > a',
|
vnMenuItem: 'vn-menu-item > li > a',
|
||||||
|
|
|
@ -11,9 +11,9 @@ export default {
|
||||||
ticketsButton: `vn-main-menu [vn-id="apps-menu"] ul > li:nth-child(6)`
|
ticketsButton: `vn-main-menu [vn-id="apps-menu"] ul > li:nth-child(6)`
|
||||||
},
|
},
|
||||||
moduleAccessView: {
|
moduleAccessView: {
|
||||||
clientsSectionButton: `${components.vnModuleContainer}[ui-sref="clients"]`,
|
clientsSectionButton: `vn-home a[ui-sref="clients"]`,
|
||||||
itemsSectionButton: `${components.vnModuleContainer}[ui-sref="item.index"]`,
|
itemsSectionButton: `vn-home a[ui-sref="item.index"]`,
|
||||||
ticketsSectionButton: `${components.vnModuleContainer}[ui-sref="ticket.list"]`
|
ticketsSectionButton: `vn-home a[ui-sref="ticket.list"]`
|
||||||
},
|
},
|
||||||
clientsIndex: {
|
clientsIndex: {
|
||||||
searchClientInput: `${components.vnTextfield}`,
|
searchClientInput: `${components.vnTextfield}`,
|
||||||
|
|
|
@ -4,12 +4,18 @@
|
||||||
"Unable to mark the equivalence surcharge": "Unable to mark the equivalence surcharge",
|
"Unable to mark the equivalence surcharge": "Unable to mark the equivalence surcharge",
|
||||||
"The default consignee can not be unchecked": "The default consignee can not be unchecked",
|
"The default consignee can not be unchecked": "The default consignee can not be unchecked",
|
||||||
"Unable to default a disabled consignee": "Unable to default a disabled consignee",
|
"Unable to default a disabled consignee": "Unable to default a disabled consignee",
|
||||||
"El método de pago seleccionado requiere que se especifique el IBAN": "El método de pago seleccionado requiere que se especifique el IBAN",
|
"Can't be blank": "No puede estar en blanco",
|
||||||
"Ya existe un usuario con ese nombre": "Ya existe un usuario con ese nombre",
|
"Invalid TIN": "Invalid TIN",
|
||||||
|
"TIN must be unique": "TIN must be unique",
|
||||||
|
"A user with that name already exists": "A user with that name already exists",
|
||||||
|
"Is invalid": "Is invalid",
|
||||||
"Quantity cannot be zero": "Quantity cannot be zero",
|
"Quantity cannot be zero": "Quantity cannot be zero",
|
||||||
"can't be blank": "can't be blank",
|
"Enter an integer different to zero": "Enter an integer different to zero",
|
||||||
"DNI Incorrecto": "DNI Incorrecto",
|
"Package cannot be blank": "Package cannot be blank",
|
||||||
"El NIF/CIF debe ser único": "El NIF/CIF debe ser único",
|
"The company name must be unique": "The company name must be unique",
|
||||||
|
"Invalid email": "Invalid email",
|
||||||
|
"The IBAN does not have the correct format": "The IBAN does not have the correct format",
|
||||||
|
"That payment method requires an IBAN": "That payment method requires an IBAN",
|
||||||
"State cannot be blank": "State cannot be blank",
|
"State cannot be blank": "State cannot be blank",
|
||||||
"La razón social debe ser única": "La razón social debe ser única"
|
"Cannot change the payment method if no salesperson": "Cannot change the payment method if no salesperson"
|
||||||
}
|
}
|
|
@ -4,12 +4,18 @@
|
||||||
"Unable to mark the equivalence surcharge": "No se puede marcar el recargo de equivalencia",
|
"Unable to mark the equivalence surcharge": "No se puede marcar el recargo de equivalencia",
|
||||||
"The default consignee can not be unchecked": "No se puede desmarcar el consignatario predeterminado",
|
"The default consignee can not be unchecked": "No se puede desmarcar el consignatario predeterminado",
|
||||||
"Unable to default a disabled consignee": "No se puede poner predeterminado un consignatario desactivado",
|
"Unable to default a disabled consignee": "No se puede poner predeterminado un consignatario desactivado",
|
||||||
"El método de pago seleccionado requiere que se especifique el IBAN": "El método de pago seleccionado requiere que se especifique el IBAN",
|
"Can't be blank": "Can't be blank",
|
||||||
"can't be blank": "can't be blank",
|
"Invalid TIN": "DNI Incorrecto",
|
||||||
"DNI Incorrecto": "DNI Incorrecto",
|
"TIN must be unique": "El NIF/CIF debe ser único",
|
||||||
"Ya existe un usuario con ese nombre": "Ya existe un usuario con ese nombre",
|
"A user with that name already exists": "Ya existe un usuario con ese nombre",
|
||||||
"is invalid": "is invalid",
|
"Is invalid": "Is invalid",
|
||||||
|
"Quantity cannot be zero": "La cantidad no puede ser cero",
|
||||||
"Enter an integer different to zero": "Introduce un entero distinto de cero",
|
"Enter an integer different to zero": "Introduce un entero distinto de cero",
|
||||||
"Package cannot be blank": "Package cannot be blank",
|
"Package cannot be blank": "Embalaje no puede estar en blanco",
|
||||||
"State cannot be blank": "El estado no puede estar en blanco"
|
"The company name must be unique": "La razón social debe ser única",
|
||||||
|
"Invalid email": "Correo electrónico inválido",
|
||||||
|
"The IBAN does not have the correct format": "El IBAN no tiene el formato correcto",
|
||||||
|
"That payment method requires an IBAN": "El método de pago seleccionado requiere que se especifique el IBAN",
|
||||||
|
"State cannot be blank": "El estado no puede estar en blanco",
|
||||||
|
"Cannot change the payment method if no salesperson": "No se puede cambiar la forma de pago si no hay comercial asignado"
|
||||||
}
|
}
|
|
@ -4,7 +4,7 @@ module.exports = function(Self) {
|
||||||
// Validations
|
// Validations
|
||||||
|
|
||||||
Self.validatesUniquenessOf('name', {
|
Self.validatesUniquenessOf('name', {
|
||||||
message: 'Ya existe un usuario con ese nombre'
|
message: 'A user with that name already exists'
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.observe('before save', (ctx, next) => {
|
Self.observe('before save', (ctx, next) => {
|
||||||
|
|
|
@ -23,13 +23,13 @@ module.exports = function(Self) {
|
||||||
// Validations
|
// Validations
|
||||||
|
|
||||||
Self.validatesUniquenessOf('fi', {
|
Self.validatesUniquenessOf('fi', {
|
||||||
message: 'El NIF/CIF debe ser único'
|
message: 'TIN must be unique'
|
||||||
});
|
});
|
||||||
Self.validatesUniquenessOf('socialName', {
|
Self.validatesUniquenessOf('socialName', {
|
||||||
message: 'La razón social debe ser única'
|
message: 'The company name must be unique'
|
||||||
});
|
});
|
||||||
Self.validatesFormatOf('email', {
|
Self.validatesFormatOf('email', {
|
||||||
message: 'Correo electrónico inválido',
|
message: 'Invalid email',
|
||||||
allowNull: true,
|
allowNull: true,
|
||||||
allowBlank: true,
|
allowBlank: true,
|
||||||
with: /^[\w|.|-]+@[\w|-]+(\.[\w|-]+)*(,[\w|.|-]+@[\w|-]+(\.[\w|-]+)*)*$/
|
with: /^[\w|.|-]+@[\w|-]+(\.[\w|-]+)*(,[\w|.|-]+@[\w|-]+(\.[\w|-]+)*)*$/
|
||||||
|
@ -42,13 +42,13 @@ module.exports = function(Self) {
|
||||||
|
|
||||||
var validateIban = require('../validations/validateIban');
|
var validateIban = require('../validations/validateIban');
|
||||||
Self.validateBinded('iban', validateIban, {
|
Self.validateBinded('iban', validateIban, {
|
||||||
message: 'El iban no tiene el formato correcto',
|
message: 'The IBAN does not have the correct format',
|
||||||
allowNull: true, // FIXME: Ignored by loopback when it's false
|
allowNull: true, // FIXME: Ignored by loopback when it's false
|
||||||
allowBlank: true
|
allowBlank: true
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.validateAsync('fi', tinIsValid, {
|
Self.validateAsync('fi', tinIsValid, {
|
||||||
message: 'DNI Incorrecto'
|
message: 'Invalid TIN'
|
||||||
});
|
});
|
||||||
let validateTin = require('../validations/validateTin');
|
let validateTin = require('../validations/validateTin');
|
||||||
async function tinIsValid(err, done) {
|
async function tinIsValid(err, done) {
|
||||||
|
@ -65,7 +65,7 @@ module.exports = function(Self) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Self.validate('payMethod', hasSalesMan, {
|
Self.validate('payMethod', hasSalesMan, {
|
||||||
message: 'No se puede cambiar la forma de pago si no hay comercial asignado'
|
message: 'Cannot change the payment method if no salesperson'
|
||||||
});
|
});
|
||||||
function hasSalesMan(err) {
|
function hasSalesMan(err) {
|
||||||
if (this.payMethod && !this.salesPerson)
|
if (this.payMethod && !this.salesPerson)
|
||||||
|
@ -73,7 +73,7 @@ module.exports = function(Self) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Self.validateAsync('payMethodFk', hasIban, {
|
Self.validateAsync('payMethodFk', hasIban, {
|
||||||
message: 'El método de pago seleccionado requiere que se especifique el IBAN'
|
message: 'That payment method requires an IBAN'
|
||||||
});
|
});
|
||||||
function hasIban(err, done) {
|
function hasIban(err, done) {
|
||||||
Self.app.models.PayMethod.findById(this.payMethodFk, (_, instance) => {
|
Self.app.models.PayMethod.findById(this.payMethodFk, (_, instance) => {
|
||||||
|
|
Loading…
Reference in New Issue