modify filter calculation

This commit is contained in:
Ludovic CANDELLIER
2022-05-09 22:33:18 +02:00
parent 8c898bf63b
commit 3370b8061c
5 changed files with 43 additions and 27 deletions

View File

@@ -8,20 +8,22 @@
</div>
@foreach ($tags as $tag_group_id => $group)
@component('components.layout.box-collapse', [
'title' => $group['name'],
'id' => 'tag_group_' . $tag_group_id,
])
@foreach ($group['tags'] as $tag)
<div>
@include('components.form.checkbox', [
'name' => 'tag[]',
'val' => $tag['id'],
])
{{ $tag['name'] }} ({{ $tag['count'] }})
</div>
@endforeach
@endcomponent
@if ($group['tags'] ?? false)
@component('components.layout.box-collapse', [
'title' => $group['name'],
'id' => 'tag_group_' . $tag_group_id,
])
@foreach ($group['tags'] as $tag)
<div>
@include('components.form.checkbox', [
'name' => 'tag[]',
'val' => $tag['id'],
])
{{ $tag['name'] }} ({{ $tag['count'] }})
</div>
@endforeach
@endcomponent
@endif
@endforeach
</section>
@@ -33,7 +35,9 @@
<script>
$('#filters').click(function() {
$('#sidebar').toggleClass('d-none');
})
$('#filter-on').toggleClass('d-none');
$('#filter-off').toggleClass('d-none');
});
initChevron();
</script>
@endpush

View File

@@ -59,8 +59,6 @@
<script>
function refreshBasketTop() {
$.get("{{ route('Shop.Basket.getSummary') }}", function(response) {
console.log("refreshBasketTop()");
console.log(response);
$('#count-basket').html(response.data.quantity);
$('#total-basket').html(response.data.total);
});

View File

@@ -2,7 +2,15 @@
<div class="col-3 form-inline">
<a href="/"><img src="/img/logo.jpg" class="img-responvive"></a>
<a id="filters" href="#" class="text-white pl-3"><i class="fa fa-2x fa-bars"></i></a>
<a id="filters" href="#" class="text-white pl-3">
<span id="filter-on" class="fa-stack fa-2x">
<i class="fa fa-stack-1x fa-filter"></i>
</span>
<span id="filter-off" class="fa-stack fa-2x d-none">
<i class="fa fa-stack-1x fa-filter"></i>
<i class="fa fa-stack-2x fa-ban" style="color:Tomato"></i>
</span>
</a>
</div>
<div class="col-5 form-inline">

View File

@@ -2,9 +2,11 @@
<div class="col-12 text-right p-2">
<button type="button" class="btn bg-green-dark light" data-toggle="dropdown">
<i class="fa fa-2x fa-fw fa-user mr-2"></i>
<span id="username" class="ml-2 badge bg-yellow green-dark">
{{ App\Repositories\Shop\Customers::getName() }}
</span>
@if (App\Repositories\Shop\Customers::getName())
<span id="username" class="ml-2 badge bg-yellow green-dark">
{{ App\Repositories\Shop\Customers::getName() }}
</span>
@endif
</button>
<ul class="dropdown-menu" aria-labelledby="dLabel">