From 22817ec55347cfebe1567529049a839f687bc84a Mon Sep 17 00:00:00 2001 From: ty kayn Date: Sat, 6 Jul 2019 12:24:50 +0200 Subject: [PATCH] split templates on dashboard --- .../views/logged/angular/current.html.twig | 3 + .../logged/angular/listing-products.html.twig | 2 +- .../logged/angular/loaded-caisse.html.twig | 5 +- .../views/logged/caisse-main.html.twig | 11 +- app/Resources/views/logged/customer.html.twig | 25 +++ .../views/logged/dashboard.html.twig | 152 ++++-------------- .../views/logged/festival-infos.html.twig | 24 +++ .../views/logged/listing-options.html.twig | 46 ++++++ assets/css/pages/_dashboard.scss | 1 + assets/js/parts/main.js | 18 +-- 10 files changed, 145 insertions(+), 142 deletions(-) create mode 100644 app/Resources/views/logged/customer.html.twig create mode 100644 app/Resources/views/logged/festival-infos.html.twig create mode 100644 app/Resources/views/logged/listing-options.html.twig diff --git a/app/Resources/views/logged/angular/current.html.twig b/app/Resources/views/logged/angular/current.html.twig index 24cf1949..345eef71 100755 --- a/app/Resources/views/logged/angular/current.html.twig +++ b/app/Resources/views/logged/angular/current.html.twig @@ -5,6 +5,9 @@
+ +
+
+ + +
+{% endverbatim %} diff --git a/app/Resources/views/logged/dashboard.html.twig b/app/Resources/views/logged/dashboard.html.twig index e3e28b1d..f9531a3f 100755 --- a/app/Resources/views/logged/dashboard.html.twig +++ b/app/Resources/views/logged/dashboard.html.twig @@ -1,131 +1,41 @@ {% extends 'base.html.twig' %} {% block body %} {% verbatim %} -
-
- -
- - Sauvegardé! WOHOOOOOO +{{recentSellings[recentSellings.length -1].amount}} € {{sellingComment}} -
-
- - Problème de sauvegarde (pas de réseau ?) -
- -
- +
+
+ +
+ -
-
-
- - - - -
-
{% endverbatim %} - - - - Festival - : + {% include 'logged/listing-options.html.twig' %} {% verbatim %} - - - - - {{ activeFestival.fondDeCaisseAvant + activeFestival.chiffreAffaire}} € - - - CA {{ activeFestival.chiffreAffaire }} € - - - - - {{ activeFestival.clientsCount }} -
+ {% endverbatim %} + {% include 'logged/festival-infos.html.twig' %} + {% verbatim %} +
+
+ {% endverbatim %} + {% include 'logged/customer.html.twig' %} + {% verbatim %} +
+
+ +
+ + Sauvegardé! WOHOOOOOO +{{recentSellings[recentSellings.length -1].amount}} € +
+
+ + Problème de sauvegarde (pas de réseau ?) +
+{% endverbatim %} + {% include 'logged/caisse-main.html.twig' %} + {% verbatim %} + {% endverbatim %} -
-
-
- -
- - - - - ( {{sellingComment}} ) - -
- - - -
-
-
- - {% endverbatim %} - -
- {% include 'logged/caisse-main.html.twig' %} -
-
-

Catégories

-
-
-

Produits

-
-
-

Historique

-
- - - - {#
#} - {#
#} {% endblock %} diff --git a/app/Resources/views/logged/festival-infos.html.twig b/app/Resources/views/logged/festival-infos.html.twig new file mode 100644 index 00000000..30d32446 --- /dev/null +++ b/app/Resources/views/logged/festival-infos.html.twig @@ -0,0 +1,24 @@ +
+ + + Festival: + + +{% verbatim %} + + + + + {{ activeFestival.fondDeCaisseAvant + activeFestival.chiffreAffaire}} € + + + CA {{ activeFestival.chiffreAffaire }} € + + + + + + {{ activeFestival.clientsCount }} + +{% endverbatim %} +
diff --git a/app/Resources/views/logged/listing-options.html.twig b/app/Resources/views/logged/listing-options.html.twig new file mode 100644 index 00000000..8f2b5e52 --- /dev/null +++ b/app/Resources/views/logged/listing-options.html.twig @@ -0,0 +1,46 @@ +
+ {% verbatim %} + +
+ +
+
+
+ + + + +{% endverbatim %} +
diff --git a/assets/css/pages/_dashboard.scss b/assets/css/pages/_dashboard.scss index 58ae3ff8..6d69f4de 100755 --- a/assets/css/pages/_dashboard.scss +++ b/assets/css/pages/_dashboard.scss @@ -1,4 +1,5 @@ #caisse-now { + border: solid 3px green; .product-box { display: inline-block; margin-right: 1rem; diff --git a/assets/js/parts/main.js b/assets/js/parts/main.js index 81f26c99..fcdcab0d 100755 --- a/assets/js/parts/main.js +++ b/assets/js/parts/main.js @@ -87,7 +87,7 @@ angular }); $scope.activeSellingFiltered = soldObjectsIdsCount; $scope.setRightAmountPaid(); - } + }; /** * get the sum of products prices @@ -193,7 +193,7 @@ angular $scope.clearSellingComment = function () { console.log(' $scope.sellingComment', $scope.sellingComment); - $scope.sellingComment = ''; + // $scope.sellingComment = ''; // document.querySelector('.client-now input').focus(); document.querySelector('.client-now input').select(); }; @@ -250,16 +250,16 @@ angular }; $scope.recentId = 0; $scope.logger = function (stuff) { - console.log('logger', stuff); + console.log('logger #####', stuff); }; $scope.sendForm = function () { + let sellingComment = $scope.sellingComment; + $scope.sellingComment = sellingComment; + console.log('########### SEND FORM'); console.log('$scope.sellingComment', $scope.sellingComment); - console.log('$rootScope.sellingComment', $rootScope.sellingComment); - console.log('$scope.sellingComment done'); - console.log("$scope.activeSelling", $scope.activeSelling); let lesParams = { paidByClient : $scope.paidAmount, - sellingComment: $scope.activeFestival.productComment, + sellingComment: $scope.sellingComment, activeSelling : $scope.activeSelling, activeFestival: $scope.activeFestival }; @@ -271,8 +271,6 @@ angular angular .copy($scope.activeSelling) }); - console.log('lesParams sellingComment', lesParams.sellingComment); - console.log('$scope.recentSellings', $scope.recentSellings); $scope.lesParams = lesParams; $http({ method : 'POST', @@ -283,7 +281,7 @@ angular data : lesParams // pass in data as strings }).then(function (rep) { - + console.log('########### OK form',rep); // if successful, bind success message to message $scope.successMessage = rep.data.message; $scope.activeFestival.chiffreAffaire = rep.data.newChiffreAffaire;