toggle visibility of categories on dashboard
This commit is contained in:
parent
1afd6e435a
commit
19541dfce8
|
@ -2,7 +2,7 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="category-listing" ng-repeat="c in categories">
|
<div class="category-listing" ng-repeat="c in categories">
|
||||||
|
|
||||||
<h2>
|
<h2 ng-class="{'hidden':c.hidden}">
|
||||||
{{ c.name }}
|
{{ c.name }}
|
||||||
</h2>
|
</h2>
|
||||||
<span ng-repeat="p in c.products track by p.id"
|
<span ng-repeat="p in c.products track by p.id"
|
||||||
|
|
|
@ -83,5 +83,17 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="choice-categories">
|
||||||
|
<h2>
|
||||||
|
Visibilité des catégories
|
||||||
|
</h2>
|
||||||
|
<div class="btn"
|
||||||
|
ng-class="{'btn-success': !c.hidden}"
|
||||||
|
ng-repeat="c in categories"
|
||||||
|
>
|
||||||
|
<div ng-click="c.hidden = !c.hidden">
|
||||||
|
{{ c.name }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
.hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
|
@ -122,8 +122,14 @@ angular
|
||||||
$http.get('get-my-products').then((rep) => {
|
$http.get('get-my-products').then((rep) => {
|
||||||
|
|
||||||
console.log('ok', rep);
|
console.log('ok', rep);
|
||||||
$scope.categories = rep.data.categories;
|
customCategories = [];
|
||||||
$scope.productsFromDB = rep.data.categories;
|
for (let c of rep.data.categories) {
|
||||||
|
c.hidden = false;
|
||||||
|
customCategories.push(c);
|
||||||
|
}
|
||||||
|
console.log('customCategories', customCategories);
|
||||||
|
$scope.categories = customCategories;
|
||||||
|
$scope.productsFromDB = customCategories;
|
||||||
// $scope.recentSellings = rep.data.history;
|
// $scope.recentSellings = rep.data.history;
|
||||||
// festoche
|
// festoche
|
||||||
$scope.activeFestival.id = rep.data.lastFestival.id;
|
$scope.activeFestival.id = rep.data.lastFestival.id;
|
||||||
|
@ -136,7 +142,7 @@ angular
|
||||||
$scope.activeFestival.clientsCount = rep.data.lastFestival.clientsCount;
|
$scope.activeFestival.clientsCount = rep.data.lastFestival.clientsCount;
|
||||||
// stat count for items
|
// stat count for items
|
||||||
$scope.countProductsSoldForActiveFestival = rep.data.lastFestival.sold;
|
$scope.countProductsSoldForActiveFestival = rep.data.lastFestival.sold;
|
||||||
console.log(' $scope.countProductsSoldForActiveFestival', $scope.countProductsSoldForActiveFestival)
|
console.log(' $scope.countProductsSoldForActiveFestival', $scope.countProductsSoldForActiveFestival);
|
||||||
//done
|
//done
|
||||||
$scope.initLoadDone = true;
|
$scope.initLoadDone = true;
|
||||||
}, (err) => {
|
}, (err) => {
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue