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