Add toggle by rows/by cards

This commit is contained in:
Ludovic CANDELLIER
2022-01-23 23:16:56 +01:00
parent 52019357ba
commit 3e26bf368b
5 changed files with 33 additions and 11 deletions

View File

@@ -15,9 +15,31 @@
<div class="row">
<div class="col-12">
Il y a {{ count($articles) ?? 0 }} article(s) dans la liste
</div>
</div>
<div class="row">
<div class="col-6">
@include('components.form.button', ['id' => 'by_cards', 'icon' => 'fa-th', 'class' => 'btn-success'])
@include('components.form.button', ['id' => 'by_rows', 'icon' => 'fa-list', 'class' => 'btn-success'])
</div>
<div class="col-6">
<form name="product_sorting">
<label>Trier par</label>
@include('components.form.select', ['name' => 'sorting', 'list' => ['Pertinence']])
</form>
</div>
</div>
</div>
@push('js')
<script>
$('#by_rows').click(function() {
var url = "{{ url()->current() }}" + '?by_rows=1';
window.location = url;
})
$('#by_cards').click(function() {
var url = "{{ url()->current() }}";
window.location = url;
})
</script>
@endpush

View File

@@ -1,7 +1,7 @@
<div class="row bg-green">
<div class="col-4 col-md-2 form-inline pl-4">
<img src="/img/logo.jpg" class="img-responvive pull-left">
<a href="/"><img src="/img/logo.jpg" class="img-responvive pull-left"></a>
</div>
<div class="col-8 col-md-6 form-inline">