merge index.html

This commit is contained in:
Javi Gallego 2017-01-17 13:06:08 +01:00
commit b469b52ba1
19 changed files with 168 additions and 117 deletions

View File

@ -1,7 +1,7 @@
<li> <li>
<a ui-sref="{{menu.item.href}}" style="display: block; text-decoration: none; color: inherit; padding: .5em 2em;"> <a ui-sref="{{menu.item.href}}" style="display: block; text-decoration: none; color: inherit; padding: .5em 2em;">
<i class="material-icons" style="float: right; margin-left: .4em;">keyboard_arrow_right</i> <i class="material-icons" style="float: right; margin-left: .4em;">keyboard_arrow_right</i>
<i class="material-icons" style="vertical-align: middle; margin-right: .4em;">{{menu.item.icon}}</i> <i class="material-icons" style="vertical-align: middle; margin-right: .4em;">{{menu.item.icon}}</i>
<span>{{menu.item.description}}</span> <span>{{menu.item.description}}</span>
</a> </a>
</li> </li>

View File

@ -9,7 +9,7 @@ export const NAME = util.getName(_NAME);
directive.$inject = [resolveFactory.NAME]; directive.$inject = [resolveFactory.NAME];
export function directive(resolve) { export function directive(resolve) {
return { return {
require: 'E', restrict: 'E',
transclude: true, transclude: true,
template: function(_, attr) { template: function(_, attr) {
return resolve.getTemplate(_NAME, attr); return resolve.getTemplate(_NAME, attr);

View File

@ -48,6 +48,8 @@ export {NAME as CARD, directive as CardDirective} from './card/card';
export {NAME as CARD_MDL, factory as cardMdl} from './card/card.mdl'; export {NAME as CARD_MDL, factory as cardMdl} from './card/card.mdl';
export {NAME as SWITCH, directive as SwitchDirective} from './switch/switch'; export {NAME as SWITCH, directive as SwitchDirective} from './switch/switch';
export {NAME as SWITCH_MDL, factory as switchdMdl} from './switch/switch.mdl'; export {NAME as SWITCH_MDL, factory as switchdMdl} from './switch/switch.mdl';
export {NAME as FLOATBUTTON, directive as FloatButtonDirective} from './floatbutton/floatbutton';
export {NAME as FLOATBUTTON_MDL, factory as floatButtondMdl} from './floatbutton/floatbutton.mdl';
export {directive as Icon} from './icon/icon'; export {directive as Icon} from './icon/icon';
export {factory as IconMdl} from './icon/icon.mdl'; export {factory as IconMdl} from './icon/icon.mdl';

View File

@ -0,0 +1,19 @@
import {module as _module} from '../module';
import * as resolveFactory from '../resolveDefaultComponents';
import * as util from '../util';
const _NAME = 'floatButton';
export const NAME = util.getName(_NAME);
directive.$inject = [resolveFactory.NAME];
export function directive(resolve) {
return {
restrict: 'E',
template: function(_, attr) {
return resolve.getTemplate(_NAME, attr);
}
};
}
_module.directive(NAME, directive);

View File

@ -0,0 +1,3 @@
<button class="*[className]*">
<vn-icon icon="*[icon]*"></vn-icon>
</button>

View File

@ -0,0 +1,20 @@
import {module as _module} from '../module';
import * as util from '../util';
import * as constant from '../constants';
import template from './floatbutton.mdl.html';
const _NAME = 'floatButton';
const DEFAULT_CLASS = 'mdl-button mdl-js-button mdl-button--fab mdl-js-ripple-effect mdl-button--colored';
export const NAME = util.getFactoryName(_NAME + constant.MATERIAL_DESIGN_FRAMEWORK);
export function factory() {
return {
template: template,
default: {
className: DEFAULT_CLASS
}
};
}
_module.factory(NAME, factory);

View File

@ -1,3 +1,3 @@
<button class="mdl-button mdl-js-button mdl-button--raised *[className]*" *[enabled]*> <button display-block class="mdl-button mdl-js-button mdl-button--raised *[className]*" *[enabled]*>
<vn-icon icon="*[icon]*"></vn-icon>*[label]* <vn-icon display-block icon="*[icon]*"></vn-icon>*[label]*
</button> </button>

View File

@ -1 +1 @@
<i class="material-icons">*[icon]*</i> <i display-block class="material-icons">*[icon]*</i>

View File

@ -27,4 +27,9 @@
.mdl-button--raised:hover { .mdl-button--raised:hover {
background-color: #ffa410; background-color: #ffa410;
}
.mdl-button--fab{
color: white !important;
background-color: #ff9400 !important;
} }

View File

@ -1,31 +1,31 @@
<form name="form" ng-submit="form.$valid && addressData.submit()" pad-medium> <form name="form" ng-submit="form.$valid && addressData.submit()" pad-medium>
<vn-card > <vn-card >
<vn-vertical pad-large> <vn-vertical pad-large>
<vn-title>Consignatario</vn-title> <vn-title>Consignatario</vn-title>
<vn-horizontal> <vn-horizontal>
<vn-check vn-one label="Predeterminado" field="addressData.address.default"></vn-check> <vn-check vn-one label="Predeterminado" field="addressData.address.default"></vn-check>
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <vn-horizontal>
<vn-textfield vn-one label="Consignatario" field="addressData.address.consignee" focus></vn-textfield> <vn-textfield vn-one label="Consignatario" field="addressData.address.consignee" focus></vn-textfield>
<vn-textfield vn-one label="Domicilio" field="addressData.address.street"></vn-textfield> <vn-textfield vn-one label="Domicilio" field="addressData.address.street"></vn-textfield>
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <vn-horizontal>
<vn-textfield vn-one label="Código Postal" field="addressData.address.postcode"></vn-textfield> <vn-textfield vn-one label="Código Postal" field="addressData.address.postcode"></vn-textfield>
<vn-textfield vn-one label="Municipio" field="addressData.address.city"></vn-textfield> <vn-textfield vn-one label="Municipio" field="addressData.address.city"></vn-textfield>
<vn-combo vn-one label="Provincia" field="addressData.address.province"> <vn-combo vn-one label="Provincia" field="addressData.address.province">
<option ng-repeat="p in addressData.provinces | orderBy:'name'" value="{{p.id}}">{{p.name}}</ng-repeat> <option ng-repeat="p in addressData.provinces | orderBy:'name'" value="{{p.id}}">{{p.name}}</ng-repeat>
</vn-combo> </vn-combo>
<vn-textfield vn-one label="Teléfono" field="addressData.address.phone"></vn-textfield> <vn-textfield vn-one label="Teléfono" field="addressData.address.phone"></vn-textfield>
<vn-textfield vn-one label="Móvil" field="addressData.address.mobile"></vn-textfield> <vn-textfield vn-one label="Móvil" field="addressData.address.mobile"></vn-textfield>
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <vn-horizontal>
<vn-combo vn-one label="Agencia" field="addressData.address.agency"> <vn-combo vn-one label="Agencia" field="addressData.address.agency">
<option ng-repeat="a in addressData.agencies | orderBy:'name'" value="{{a.id}}">{{a.name}}</ng-repeat> <option ng-repeat="a in addressData.agencies | orderBy:'name'" value="{{a.id}}">{{a.name}}</ng-repeat>
</vn-combo> </vn-combo>
</vn-horizontal> </vn-horizontal>
<vn-empty> </vn-vertical>
</vn-card>
<vn-empty margin-small-top >
<vn-submit label="Guardar" id="save"></vn-submit> <vn-submit label="Guardar" id="save"></vn-submit>
</vn-empty> </vn-empty>
</vn-vertical>
</vn-card>
</form> </form>

View File

@ -5,7 +5,7 @@ export const NAME = 'vnClientAddressesDataCreate';
export const COMPONENT = { export const COMPONENT = {
template: template, template: template,
controllerAs: 'addressData', controllerAs: 'addressData',
controller: function($http) controller: function($http, $state)
{ {
this.address = {}; this.address = {};
$http.get('/client/api/Agencies').then( $http.get('/client/api/Agencies').then(
@ -16,10 +16,12 @@ export const COMPONENT = {
); );
this.submit = function(){ this.submit = function(){
$http.post('/client/api/Addresses', this.address); $http.post('/client/api/Addresses', this.address).then(
} json => $state.go('clientCard.addresses')
} );
};
}
} }
COMPONENT.controller.$inject = ['$http']; COMPONENT.controller.$inject = ['$http', '$state'];
module.component(NAME, COMPONENT); module.component(NAME, COMPONENT);

View File

@ -1,32 +1,32 @@
<form name="form" ng-submit="form.$valid && addressData.submit()" pad-medium> <form name="form" ng-submit="form.$valid && addressData.submit()" pad-medium>
<vn-card> <vn-card>
<vn-vertical pad-large> <vn-vertical pad-large>
<vn-title>Consignatario</vn-title> <vn-title>Consignatario</vn-title>
<vn-horizontal> <vn-horizontal>
<vn-check vn-one label="Activo" field="addressData.address.enabled"></vn-check> <vn-check vn-one label="Activo" field="addressData.address.enabled"></vn-check>
<vn-check vn-one label="Predeterminado" field="addressData.address.default"></vn-check> <vn-check vn-one label="Predeterminado" field="addressData.address.default"></vn-check>
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <vn-horizontal>
<vn-textfield vn-one label="Consignatario" field="addressData.address.consignee"></vn-textfield> <vn-textfield vn-one label="Consignatario" field="addressData.address.consignee"></vn-textfield>
<vn-textfield vn-one label="Domicilio" field="addressData.address.street"></vn-textfield> <vn-textfield vn-one label="Domicilio" field="addressData.address.street"></vn-textfield>
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <vn-horizontal>
<vn-textfield vn-one label="Código Postal" field="addressData.address.postcode"></vn-textfield> <vn-textfield vn-one label="Código Postal" field="addressData.address.postcode"></vn-textfield>
<vn-textfield vn-one label="Municipio" field="addressData.address.city"></vn-textfield> <vn-textfield vn-one label="Municipio" field="addressData.address.city"></vn-textfield>
<vn-combo vn-one label="Provincia" field="addressData.address.province"> <vn-combo vn-one label="Provincia" field="addressData.address.province">
<option ng-repeat="p in addressData.provinces | orderBy:'name'" value="{{p.id}}">{{p.name}}</ng-repeat> <option ng-repeat="p in addressData.provinces | orderBy:'name'" value="{{p.id}}">{{p.name}}</ng-repeat>
</vn-combo> </vn-combo>
<vn-textfield vn-one label="Teléfono" field="addressData.address.phone"></vn-textfield> <vn-textfield vn-one label="Teléfono" field="addressData.address.phone"></vn-textfield>
<vn-textfield vn-one label="Móvil" field="addressData.address.mobile"></vn-textfield> <vn-textfield vn-one label="Móvil" field="addressData.address.mobile"></vn-textfield>
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <vn-horizontal>
<vn-combo vn-one label="Agencia" field="addressData.address.agency"> <vn-combo vn-one label="Agencia" field="addressData.address.agency">
<option ng-repeat="a in addressData.agencies | orderBy:'name'" value="{{a.id}}">{{a.name}}</ng-repeat> <option ng-repeat="a in addressData.agencies | orderBy:'name'" value="{{a.id}}">{{a.name}}</ng-repeat>
</vn-combo> </vn-combo>
</vn-horizontal> </vn-horizontal>
<vn-empty margin-large-top> </vn-vertical>
</vn-card>
<vn-empty margin-small-top>
<vn-submit label="Guardar" id="save"></vn-submit> <vn-submit label="Guardar" id="save"></vn-submit>
</vn-empty> </vn-empty>
</vn-vertical>
</vn-card>
</form> </form>

View File

@ -1,27 +1,25 @@
<vn-vertical pad-medium> <vn-vertical pad-medium>
<vn-card> <vn-card>
<vn-vertical pad-large> <vn-vertical pad-large>
<vn-horizontal> <vn-horizontal>
<vn-title vn-one>Consignatario</vn-title> <vn-title vn-one>Consignatario</vn-title>
</vn-horizontal>
<vn-horizontal ng-repeat="i in address.addresses" class="pad-medium-top" style="align-items: center;">
<vn-auto style="border-radius: .5em;" class="pad-small border-solid" ng-class="{'bg-dark-item': i.default,'bg-opacity-item': !i.enabled && !i.default}">
<vn-horizontal style="align-items: center;">
<vn-auto>
<div><b>{{i.consignee}}</b></div>
<div>{{i.street}}</div>
<div>{{i.city}}, {{i.province}}</div>
<div>{{i.phone}}, {{i.mobile}}</div>
</vn-auto>
<a vn-empty ui-sref="clientCard.addressDataEdit({ addressId: {{i.id}} })"><vn-icon-button icon="edit"></vn-icon-button></a>
</vn-horizontal> </vn-horizontal>
</vn-auto> <vn-horizontal ng-repeat="i in address.addresses" class="pad-medium-top" style="align-items: center;">
</vn-horizontal> <vn-auto style="border-radius: .5em;" class="pad-small border-solid" ng-class="{'bg-dark-item': i.default,'bg-opacity-item': !i.enabled && !i.default}">
<vn-horizontal margin-large-top> <vn-horizontal style="align-items: center;">
<vn-one> <vn-auto>
<a ui-sref="clientCard.addressDataCreate"><vn-button label="Nuevo"></vn-button></a> <div><b>{{i.consignee}}</b></div>
</vn-one> <div>{{i.street}}</div>
</vn-horizontal> <div>{{i.city}}, {{i.province}}</div>
</vn-vertical> <div>{{i.phone}}, {{i.mobile}}</div>
</vn-card> </vn-auto>
<a vn-empty ui-sref="clientCard.addressDataEdit({ addressId: {{i.id}} })"><vn-icon-button icon="edit"></vn-icon-button></a>
</vn-horizontal>
</vn-auto>
</vn-horizontal>
</vn-vertical>
</vn-card>
<vn-one margin-large-top style="position: fixed; bottom: 2em; right: 2em;">
<a ui-sref="clientCard.addressDataCreate"><vn-float-button icon="add"></vn-float-button></a>
</vn-one>
</vn-vertical> </vn-vertical>

View File

@ -9,15 +9,16 @@
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <vn-horizontal>
<vn-textfield vn-one label="Teléfono" field="basicData.client.phone"></vn-textfield> <vn-textfield vn-one label="Teléfono" field="basicData.client.phone"></vn-textfield>
<vn-textfield vn-one label="Móvil" field="basicData.client.mobile"></vn-textfield>
<vn-textfield vn-one label="Fax" field="basicData.client.fax"></vn-textfield> <vn-textfield vn-one label="Fax" field="basicData.client.fax"></vn-textfield>
<vn-textfield vn-one label="Email" field="basicData.client.email"></vn-textfield>
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <vn-horizontal>
<vn-textfield vn-one label="Email" field="basicData.client.email"></vn-textfield>
<vn-combo vn-one label="Comercial" field="basicData.client.salesPerson"> <vn-combo vn-one label="Comercial" field="basicData.client.salesPerson">
<option value=""></option> <option value=""></option>
<option ng-repeat="p in basicData.sales" value="{{p.id}}">{{p.name}}</ng-repeat> <option ng-repeat="p in basicData.sales" value="{{p.id}}">{{p.name}}</ng-repeat>
</vn-combo> </vn-combo>
<vn-two></vn-two> <vn-one></vn-one>
</vn-horizontal> </vn-horizontal>
</vn-vertical> </vn-vertical>

View File

@ -1,11 +1,14 @@
<vn-vertical full-height style="max-width: 85em; margin: 0 auto;"> <vn-vertical full-height >
<vn-horizontal full-height> <vn-horizontal>
<vn-empty pad-medium-left style="min-width: 18em;"> <vn-horizontal full-height vn-eleven>
<vn-descriptor client="card.client" class="display-block" ></vn-descriptor> <vn-empty pad-medium-left style="min-width: 18em;">
<vn-left-menu items="card.items"></vn-left-menu> <vn-descriptor client="card.client" class="display-block" ></vn-descriptor>
</vn-empty> <vn-left-menu items="card.items"></vn-left-menu>
<vn-auto> </vn-empty>
<vn-vertical ui-view></vn-vertical> <vn-auto>
</vn-auto> <vn-vertical ui-view></vn-vertical>
</vn-auto>
</vn-horizontal>
<vn-one></vn-one>
</vn-horizontal> </vn-horizontal>
</vn-vertical> </vn-vertical>

View File

@ -5,7 +5,7 @@
<i class="material-icons descriptor-icon">person</i> <i class="material-icons descriptor-icon">person</i>
</vn-one> </vn-one>
<vn-vertical vn-two> <vn-vertical vn-two>
<div class="margin-none">{{descriptor.client.clientId}}</div> <div class="margin-none">{{descriptor.client.id}}</div>
<div class="margin-none">{{descriptor.client.name}}</div> <div class="margin-none">{{descriptor.client.name}}</div>
<div class="margin-none">{{descriptor.client.phone}}</div> <div class="margin-none">{{descriptor.client.phone}}</div>
</vn-vertical> </vn-vertical>

View File

@ -4,7 +4,6 @@
<vn-vertical pad-large> <vn-vertical pad-large>
<vn-title>Datos fiscales y de facturación</vn-title> <vn-title>Datos fiscales y de facturación</vn-title>
<vn-horizontal> <vn-horizontal>
<vn-check vn-one label="Cliente activo" field="fiscal.client.active"></vn-check>
<vn-check vn-one label="Facturar" field="fiscal.client.hasToInvoice"></vn-check> <vn-check vn-one label="Facturar" field="fiscal.client.hasToInvoice"></vn-check>
<vn-check vn-one label="Factura impresa" field="invoiceByEmail"></vn-check> <vn-check vn-one label="Factura impresa" field="invoiceByEmail"></vn-check>
</vn-horizontal> </vn-horizontal>
@ -21,12 +20,7 @@
<option ng-repeat="c in fiscal.countries | orderBy:'name'" value="{{c.id}}">{{c.name}}</option> <option ng-repeat="c in fiscal.countries | orderBy:'name'" value="{{c.id}}">{{c.name}}</option>
</vn-combo> </vn-combo>
</vn-horizontal> </vn-horizontal>
<vn-horizontal> </vn-vertical>
<vn-textfield vn-one label="Teléfono Fijo" field="fiscal.client.phone"></vn-textfield>
<vn-textfield vn-one label="Teléfono Movil" field="fiscal.client.mobile"></vn-textfield>
<vn-textfield vn-one label="Correo electrónico" field="fiscal.client.email"></vn-textfield>
</vn-horizontal>
</vn-vertical>
</vn-card> </vn-card>
<vn-card margin-small-bottom> <vn-card margin-small-bottom>
<vn-vertical pad-large> <vn-vertical pad-large>
@ -56,8 +50,8 @@
</vn-horizontal> </vn-horizontal>
</vn-vertical> </vn-vertical>
</vn-card> </vn-card>
<vn-vertical>
<vn-submit label="Guardar"></vn-submit>
</vn-vertical>
<vn-dialog-confirm object="fiscal.client" object-old="fiscal.clientOld" state="fiscal.state"></vn-dialog-confirm>
</form> </form>
<vn-vertical>
<vn-submit label="Guardar"></vn-submit>
</vn-vertical>
<vn-dialog-confirm object="fiscal.client" object-old="fiscal.clientOld" state="fiscal.state"></vn-dialog-confirm>

View File

@ -7,7 +7,8 @@ vn-item-client a {
color: inherit; color: inherit;
} }
vn-item-client a:hover { vn-item-client a:hover {
background-color: rgba(0, 0, 0, .1); color: white;
background-color: #424242;
} }
.vn-item-client-name{ .vn-item-client-name{

View File

@ -43,6 +43,9 @@
"phone": { "phone": {
"type": "string" "type": "string"
}, },
"mobile": {
"type": "string"
},
"fax": { "fax": {
"type": "string" "type": "string"
}, },