Add filters

This commit is contained in:
Ludovic CANDELLIER
2021-11-01 23:42:53 +01:00
parent 459d35e8a1
commit f5716c6530
18 changed files with 148 additions and 35 deletions

View File

@@ -8,7 +8,7 @@
@component('components.card')
@include('components.datatable', ['route' => route('Admin.Shop.Articles.index'), 'model' => 'articles', 'with_filters' => true])
@component('components.layout.modal', ['title' => 'Filtres', 'id' => 'modal-articles-filters'])
@include('Admin.Shop.Articles.partials.filters')
@include('Admin.Shop.Articles.partials.filters', ['model' => 'articles'])
@endcomponent
@endcomponent
@endsection

View File

@@ -1,4 +1,4 @@
<form id="articles-filters">
<form id="{{ $model }}-filters">
<div class="row">
<label class="col-4">{{ __('article_natures.title') }}</label>
<div class="col-8">

View File

@@ -0,0 +1,5 @@
<form id="{{ $model }}-filters">
<div class="row mb-3">
</div>
</form>

View File

@@ -6,6 +6,11 @@
@section('content')
@component('components.card')
@include('components.datatable', ['route' => route('Admin.Shop.Offers.index'), 'model' => 'offers'])
@include('components.datatable', ['route' => route('Admin.Shop.Offers.index'), 'model' => 'offers', 'with_filters' => true])
@component('components.layout.modal', ['title' => 'Filtres', 'id' => 'modal-offers-filters'])
@include('Admin.Shop.Offers.partials.filters', ['model' => 'offers'])
@endcomponent
@endcomponent
@endsection
@include('load.form.select2')

View File

@@ -2,14 +2,17 @@
<div class="col-12">
<div class="row mb-3">
<div class="col-4">
<div class="col-3">
{{ Form::label('ref', 'Référence') }}<br>
{{ $article['ref'] ?? null }}
</div>
<div class="col-8">
<div class="col-5">
{{ Form::label('name', 'Nom') }}<br>
{{ $article['name'] ?? null }}
</div>
<div class="col-3">
{!! $article['image'] !!}
</div>
</div>
<div class="row mb-3">

View File

@@ -0,0 +1,14 @@
<form id="{{ $model }}-filters">
<div class="row mb-3">
<label class="col-4">{{ __('shop.article_natures.title') }}</label>
<div class="col-8">
@include('components.form.select', ['name' => 'article_nature_id', 'list' => $article_natures ?? [], 'value' => $filters['article_nature_id'] ?? null, 'class' => 'form-control-sm select2', 'with_empty' => ''])
</div>
</div>
<div class="row mb-3">
<label class="col-4">{{ __('shop.packages.title') }}</label>
<div class="col-8">
@include('components.form.select', ['name' => 'package_id', 'list' => $packages ?? [], 'value' => $filters['package_id'] ?? null, 'class' => 'form-control-sm select2', 'with_empty' => ''])
</div>
</div>
</form>

View File

@@ -4,23 +4,28 @@
<div class="row">
<div class="col-md-6">
{{ Form::label('name', 'Groupe') }}
@include('components.form.select', ['name' => 'tag_group_id', 'list' => $tag_groups, 'value' => isset($tag_group_id) ? $tag_group_id : null, 'required' => true, 'with_empty' => ''])
@include('components.form.select', ['name' => 'tag_group_id', 'list' => $tag_groups, 'value' => $tag_group_id ?? null, 'required' => true, 'with_empty' => '', 'class' => 'select2'])
</div>
<div class="col-md-6">
{{ Form::label('name', 'Nom') }}
@include('components.form.input', ['name' => 'name', 'value' => isset($name) ? $name : null, 'required' => true])
@include('components.form.input', ['name' => 'name', 'value' => $name ?? null, 'required' => true])
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-8">
<div class="float-right mt-3">
@include('components.form.buttons.button-save')
</div>
</div>
</div>
@include('components.save')
@include('load.form.select2')
@include('load.form.save')
@push('js')
<script>
$(function() {
initSaveForm('#tag-form');
initSelect2();
});
</script>
@endpush