From 1dc8cafc73f5858dccdcd70bb7c2a69b5e0da0d0 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Wed, 30 Jan 2019 23:47:06 +0100 Subject: [PATCH] Style & translation fixes --- e2e/helpers/selectors.js | 8 +- front/core/components/input-number/index.html | 8 +- front/salix/components/app/app.html | 14 +- front/salix/components/app/app.js | 37 ++-- front/salix/components/app/style.scss | 63 +++--- front/salix/locale/es.yml | 2 + modules/agency/front/card/index.html | 2 +- modules/agency/front/create/index.html | 8 +- modules/agency/front/index/index.html | 2 +- modules/claim/front/card/index.html | 2 +- modules/claim/front/index/index.html | 2 +- modules/client/front/card/index.html | 2 +- modules/client/front/create/index.html | 8 +- modules/client/front/index/index.html | 2 +- modules/item/front/card/index.html | 2 +- modules/item/front/create/index.html | 8 +- modules/item/front/index/index.html | 2 +- modules/order/front/card/index.html | 2 +- modules/order/front/catalog/index.html | 190 +++++++++--------- modules/order/front/catalog/index.js | 2 +- modules/order/front/catalog/style.scss | 9 +- modules/order/front/create/index.html | 4 +- modules/order/front/filter/index.html | 186 ++++++++--------- modules/order/front/filter/index.js | 16 +- modules/order/front/filter/index.spec.js | 2 +- modules/order/front/filter/style.scss | 51 +++-- modules/order/front/index/index.html | 2 +- modules/ticket/front/card/index.html | 2 +- modules/ticket/front/create/index.html | 4 +- modules/ticket/front/index/index.html | 2 +- modules/ticket/front/summary/index.html | 58 +++--- modules/travel/front/index/index.html | 2 +- modules/worker/front/card/index.html | 2 +- modules/worker/front/index/index.html | 2 +- 34 files changed, 372 insertions(+), 336 deletions(-) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 4f8a5410d..ede784f6f 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -270,11 +270,11 @@ export default { warehouseAutocomplete: 'vn-item-diary vn-autocomplete[field="$ctrl.warehouseFk"]', }, ticketSummary: { - sale: 'vn-ticket-summary [name="sales"] table > tbody > tr', - firstSaleItemId: 'vn-ticket-summary [name="sales"] table > tbody > tr > td:nth-child(2) > span', + sale: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr', + firstSaleItemId: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(2) > span', popoverDiaryButton: 'vn-ticket-summary vn-item-descriptor-popover vn-item-descriptor vn-icon[icon="icon-transaction"]', - firstSaleQuantity: 'vn-ticket-summary [name="sales"] table > tbody > tr > td:nth-child(4)', - firstSaleDiscount: 'vn-ticket-summary [name="sales"] table > tbody > tr > td:nth-child(6)' + firstSaleQuantity: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(4)', + firstSaleDiscount: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(6)' }, ticketsIndex: { newTicketButton: 'vn-ticket-index > a', diff --git a/front/core/components/input-number/index.html b/front/core/components/input-number/index.html index 1eb20fda3..894844375 100644 --- a/front/core/components/input-number/index.html +++ b/front/core/components/input-number/index.html @@ -5,8 +5,8 @@ + tabindex="-1" + translate-attr="{title: 'Remove'}">
@@ -28,8 +28,8 @@ + tabindex="-1" + translate-attr="{title: 'Add'}"> + ng-click="$ctrl.showLeftMenu()">
{{$ctrl.$state.current.description}}
+ +
+ ng-class="{shown: $ctrl.leftMenuShown || $ctrl.rightMenuShown}" + ng-click="$ctrl.hideMenus()">
\ No newline at end of file diff --git a/front/salix/components/app/app.js b/front/salix/components/app/app.js index 4ed4f6948..6a8ecb247 100644 --- a/front/salix/components/app/app.js +++ b/front/salix/components/app/app.js @@ -12,8 +12,8 @@ export default class App { $transitions.onStart({}, transition => { let state = transition.targetState().name(); - this.showMenuButton = state.split('.').length >= 3; - if (this.menuShown) this.hideMenu(); + this.showLeftMenuButton = state.split('.').length >= 3; + this.hideMenus(); }); } @@ -30,22 +30,31 @@ export default class App { return state && state != 'login'; } - get leftBlock() { - return this.$element[0].querySelector('.left-block'); + get leftMenu() { + return this.$element[0].querySelector('.left-menu'); } - showMenu() { - let leftBlock = this.leftBlock; - if (!leftBlock) return; - leftBlock.classList.add('shown'); - this.menuShown = true; + showLeftMenu() { + if (!this.leftMenu) return; + this.leftMenu.classList.add('shown'); + this.leftMenuShown = true; } - hideMenu() { - this.menuShown = false; - let leftBlock = this.leftBlock; - if (!leftBlock) return; - leftBlock.classList.remove('shown'); + showRightMenu() { + if (!this.rightMenu) return; + this.rightMenu.classList.add('shown'); + this.rightMenuShown = true; + } + + hideMenus() { + if (this.leftMenuShown) { + this.leftMenu.classList.remove('shown'); + this.leftMenuShown = false; + } + if (this.rightMenuShown) { + this.rightMenu.classList.remove('shown'); + this.rightMenuShown = false; + } } showMessage(message) { diff --git a/front/salix/components/app/style.scss b/front/salix/components/app/style.scss index ee2bca6bc..ddf4211f6 100644 --- a/front/salix/components/app/style.scss +++ b/front/salix/components/app/style.scss @@ -27,7 +27,7 @@ vn-app { padding: .3em; } & > .logo > img { - height: 1.6em; + height: 1.4em; display: block; } & > .show-menu { @@ -58,19 +58,24 @@ vn-app { &.padding { padding-top: $topbar-height; } - .index-block { + .content-block { @extend .margin-medium; + + form vn-horizontal { + & > * { + padding: .2em; + } + } } vn-main-block { display: block; margin: 0 auto; padding-left: $menu-width; - - .left-block { + + %side-menu { + display: block; position: fixed; z-index: 5; - top: $topbar-height; - left: 0; bottom: 0; width: $menu-width; min-width: $menu-width; @@ -78,21 +83,16 @@ vn-app { box-shadow: 0 .1em .2em rgba(1, 1, 1, .2); overflow: auto; } - .content-block { - @extend .margin-medium; - - form vn-horizontal { - & > * { - padding: .2em; - } - } + .left-menu { + @extend %side-menu; + top: $topbar-height; + left: 0; } - .right-block { - width: $menu-width; - min-width: $menu-width; - padding-left: 1em; + .right-menu { + @extend %side-menu; + top: $topbar-height; + right: 0; } - } } & > .background { @@ -118,29 +118,32 @@ vn-app { } } & > .main-view { - .index-block { + .content-block { margin-left: 0; margin-right: 0; + + form vn-horizontal { + flex-direction: column; + } } vn-main-block { padding-left: 0; - .left-block { + %side-menu-mobile { top: 0; - transform: translateZ(0) translateX(-$menu-width); transition: transform 200ms ease-out; - + &.shown { transform: translateZ(0) translateX(0); } } - .content-block { - margin-left: 0; - margin-right: 0; - - form vn-horizontal { - flex-direction: column; - } + .left-menu { + @extend %side-menu-mobile; + transform: translateZ(0) translateX(-$menu-width); + } + .right-menu { + @extend %side-menu-mobile; + transform: translateZ(0) translateX($menu-width); } } } diff --git a/front/salix/locale/es.yml b/front/salix/locale/es.yml index 3e17d36c7..9c299c040 100644 --- a/front/salix/locale/es.yml +++ b/front/salix/locale/es.yml @@ -28,6 +28,8 @@ Order by: Ordenar por Order: Orden Ascendant: Ascendente Descendant: Descendente +Add: Añadir +Remove: Quitar # Modules diff --git a/modules/agency/front/card/index.html b/modules/agency/front/card/index.html index 7e2f11a72..2b981bf29 100644 --- a/modules/agency/front/card/index.html +++ b/modules/agency/front/card/index.html @@ -1,5 +1,5 @@ -
+
diff --git a/modules/agency/front/create/index.html b/modules/agency/front/create/index.html index c9630b236..43575d179 100644 --- a/modules/agency/front/create/index.html +++ b/modules/agency/front/create/index.html @@ -5,8 +5,8 @@ form="form" save="post"> -
-
+
+ -
- + +
diff --git a/modules/agency/front/index/index.html b/modules/agency/front/index/index.html index cf9c651f1..17b978b70 100644 --- a/modules/agency/front/index/index.html +++ b/modules/agency/front/index/index.html @@ -6,7 +6,7 @@ data="zones" auto-load="false"> -
+
-
+
diff --git a/modules/claim/front/index/index.html b/modules/claim/front/index/index.html index 0c7a821bb..99149ed81 100644 --- a/modules/claim/front/index/index.html +++ b/modules/claim/front/index/index.html @@ -6,7 +6,7 @@ data="claims" auto-load="false"> -
+
-
+
diff --git a/modules/client/front/create/index.html b/modules/client/front/create/index.html index 1e9b18e99..dc80af713 100644 --- a/modules/client/front/create/index.html +++ b/modules/client/front/create/index.html @@ -5,8 +5,8 @@ form="form" save="post"> -
-
+
+ @@ -87,5 +87,5 @@ -
- + +
diff --git a/modules/client/front/index/index.html b/modules/client/front/index/index.html index c6aa4d110..07b394073 100644 --- a/modules/client/front/index/index.html +++ b/modules/client/front/index/index.html @@ -6,7 +6,7 @@ data="clients" auto-load="false"> -
+
-
+
diff --git a/modules/item/front/create/index.html b/modules/item/front/create/index.html index 544a10848..7cb96a024 100644 --- a/modules/item/front/create/index.html +++ b/modules/item/front/create/index.html @@ -5,8 +5,8 @@ form="form" save="post"> -
-
+
+ Cancel -
- + +
diff --git a/modules/item/front/index/index.html b/modules/item/front/index/index.html index 50930d493..e2d2df6e5 100644 --- a/modules/item/front/index/index.html +++ b/modules/item/front/index/index.html @@ -6,7 +6,7 @@ data="items" auto-load="false"> -
+
-
+
diff --git a/modules/order/front/catalog/index.html b/modules/order/front/catalog/index.html index 6542ea976..c4ba3e49a 100644 --- a/modules/order/front/catalog/index.html +++ b/modules/order/front/catalog/index.html @@ -5,105 +5,101 @@ limit="50" data="items" on-data-change="$ctrl.onDataChange()" > - - - - - - - More than {{model.limit}} results - - - - - - - - +
+ + + + More than {{model.limit}} results + + + + + + + - -
- - - - - - - -

- {{::item.name}} -

- - {{::item.subName}} - - - - - - - - - - - - - - {{::item.available}} - from - {{::item.price | currency: ' €': 2}} - - - - - - - -
-
-
+
+ + +
+ + + + -
-
- - - No results - - - - - - - - - - - - + + +

+ {{::item.name}} +

+ + {{::item.subName}} + + + + + + + + + + + + + + {{::item.available}} + from + {{::item.price | currency: ' €': 2}} + + + + + + + +
+
+ + +
+
+ + + No results + + +
+ +
+ + diff --git a/modules/order/front/catalog/index.js b/modules/order/front/catalog/index.js index 2585c19f5..ec28df420 100644 --- a/modules/order/front/catalog/index.js +++ b/modules/order/front/catalog/index.js @@ -125,5 +125,5 @@ ngModule.component('vnOrderCatalog', { controller: Controller, bindings: { order: '<', - }, + } }); diff --git a/modules/order/front/catalog/style.scss b/modules/order/front/catalog/style.scss index 3849ff78b..84c6a6c74 100644 --- a/modules/order/front/catalog/style.scss +++ b/modules/order/front/catalog/style.scss @@ -8,13 +8,18 @@ vn-order-catalog { vn-one:first-child { padding-top: 2em; } - vn-one:nth-child(2) { padding-top: 0.5em; } - span { color: $secondary-font-color } } + & > .items { + padding-right: 16em; + + @media screen and (max-width: 800px) { + padding-right: 0; + } + } } \ No newline at end of file diff --git a/modules/order/front/create/index.html b/modules/order/front/create/index.html index fd76ed156..0f52e18ac 100644 --- a/modules/order/front/create/index.html +++ b/modules/order/front/create/index.html @@ -1,5 +1,5 @@ -
-
+
+
diff --git a/modules/order/front/filter/index.html b/modules/order/front/filter/index.html index ebfa682c9..f4949c88a 100644 --- a/modules/order/front/filter/index.html +++ b/modules/order/front/filter/index.html @@ -1,101 +1,93 @@ + data="categories" + auto-load="true"> - - - - - - - - - - - - - - search - - - - keyboard_arrow_down - - - - - - - - - - search - - - - keyboard_arrow_down - - - - - - - - - - - - - {{$ctrl.category.value}} - - - - {{$ctrl.type.value}} - - - - {{::tag.value}} - - - - - - \ No newline at end of file +
+ + + + + + + + + + search + + + + keyboard_arrow_down + + + + + + + + search + + + + keyboard_arrow_down + + + + + + + + + + {{$ctrl.category.value}} + + + {{$ctrl.type.value}} + + + {{::tag.value}} + + +
\ No newline at end of file diff --git a/modules/order/front/filter/index.js b/modules/order/front/filter/index.js index 724f8ebb3..aa3f3cc3d 100644 --- a/modules/order/front/filter/index.js +++ b/modules/order/front/filter/index.js @@ -2,7 +2,8 @@ import ngModule from '../module'; import './style.scss'; class Controller { - constructor($http, $scope, $state, $compile, $transitions, $window) { + constructor($element, $http, $scope, $state, $compile, $transitions) { + this.$element = $element; this.$http = $http; this.$scope = $scope; this.$state = $state; @@ -13,6 +14,14 @@ class Controller { this.tags = []; } + $onInit() { + this.app.rightMenu = this.$element[0]; + } + + $onDestroy() { + this.app.rightMenu = null; + } + get order() { return this._order; } @@ -159,15 +168,16 @@ class Controller { } } -Controller.$inject = ['$http', '$scope', '$state', '$compile', '$transitions', '$window']; +Controller.$inject = ['$element', '$http', '$scope', '$state', '$compile', '$transitions']; ngModule.component('vnCatalogFilter', { template: require('./index.html'), controller: Controller, require: { catalog: '^vnOrderCatalog', + app: '^vnApp' }, bindings: { order: '<', - }, + } }); diff --git a/modules/order/front/filter/index.spec.js b/modules/order/front/filter/index.spec.js index 4be996ac8..3d9888c57 100644 --- a/modules/order/front/filter/index.spec.js +++ b/modules/order/front/filter/index.spec.js @@ -17,7 +17,7 @@ describe('Order', () => { $state.params.category = '{"id": 1, "value": "My Category"}'; $state.params.type = '{"id": 1, "value": "My type"}'; $state.current.name = 'my.current.state'; - controller = $componentController('vnCatalogFilter', {$scope, $state}); + controller = $componentController('vnCatalogFilter', {$element: null, $scope, $state}); controller.catalog = { $scope: $scope, getOrderBy: () => { diff --git a/modules/order/front/filter/style.scss b/modules/order/front/filter/style.scss index bb3857662..26c2324a5 100644 --- a/modules/order/front/filter/style.scss +++ b/modules/order/front/filter/style.scss @@ -1,31 +1,44 @@ @import "colors"; +@import "padding"; -vn-catalog-filter { +vn-catalog-filter > div { + & > .input { + @extend .pad-medium-h; + border-color: $lines; + border-bottom: 1px solid rgba($lines, 0.5); + } .item-category { + @extend .pad-small; justify-content: flex-start; align-items: flex-start; flex-wrap: wrap; - vn-icon { - background-color: $secondary-font-color; - border-radius: 50%; - cursor: pointer; + & > vn-one { + @extend .pad-small; + min-width: 33.33%; + text-align: center; + box-sizing: border-box; - i:before { - font-size: 32pt; - width: 1em; - height: 1em; + & > vn-icon { + @extend .pad-small; + background-color: $secondary-font-color; + border-radius: 50%; + cursor: pointer; + + &.active { + background-color: $main-01; + color: #FFF + } + & > i:before { + font-size: 32pt; + width: 1em; + height: 1em; + } } } - - vn-icon.active { - background-color: $main-01; - color: #FFF - } - - & > vn-one { - width: 33.33%; - text-align: center - } + } + .chips { + flex-wrap: wrap; + @extend .pad-medium; } } \ No newline at end of file diff --git a/modules/order/front/index/index.html b/modules/order/front/index/index.html index 2151e44db..887a599a1 100644 --- a/modules/order/front/index/index.html +++ b/modules/order/front/index/index.html @@ -5,7 +5,7 @@ limit="20" data="orders" auto-load="false"> -
+
-
+
diff --git a/modules/ticket/front/create/index.html b/modules/ticket/front/create/index.html index 0ae0aa588..81c04a7b1 100644 --- a/modules/ticket/front/create/index.html +++ b/modules/ticket/front/create/index.html @@ -1,5 +1,5 @@ -
-
+
+
diff --git a/modules/ticket/front/index/index.html b/modules/ticket/front/index/index.html index 8c741932b..2f788df41 100644 --- a/modules/ticket/front/index/index.html +++ b/modules/ticket/front/index/index.html @@ -6,7 +6,7 @@ order="shipped ASC" auto-load="false"> -
+
diff --git a/modules/ticket/front/summary/index.html b/modules/ticket/front/summary/index.html index 0a1b1f4f1..508cb8928 100644 --- a/modules/ticket/front/summary/index.html +++ b/modules/ticket/front/summary/index.html @@ -52,21 +52,21 @@

Sale

- - - - - - - - - - - - - - - - - - - - - - - - - - -
ItemDescriptionQuantityPriceDiscountAmount
+ + + + + Item + Description + Quantity + Price + Discount + Amount + + + + + - + + {{sale.itemFk | zeroFill:6}} - {{::sale.quantity}}{{::sale.price | currency:'€':2}}{{::sale.discount}} %{{::sale.quantity * sale.price | currency:'€':2}}
No results
+ + + {{::sale.quantity}} + {{::sale.price | currency:'€':2}} + {{::sale.discount}} % + {{::sale.quantity * sale.price | currency:'€':2}} + + + No results + + +

Packages

diff --git a/modules/travel/front/index/index.html b/modules/travel/front/index/index.html index d32e9a58f..0b4f19362 100644 --- a/modules/travel/front/index/index.html +++ b/modules/travel/front/index/index.html @@ -6,7 +6,7 @@ data="travels" auto-load="false"> -
+
-
+
diff --git a/modules/worker/front/index/index.html b/modules/worker/front/index/index.html index e3853083b..f06c0ce4c 100644 --- a/modules/worker/front/index/index.html +++ b/modules/worker/front/index/index.html @@ -5,7 +5,7 @@ limit="20" data="workers"> -
+