Add filters
This commit is contained in:
@@ -6,13 +6,15 @@ use Illuminate\Http\Request;
|
|||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
use App\Repositories\Shop\Articles;
|
use App\Repositories\Shop\Articles;
|
||||||
|
use App\Repositories\Shop\ArticleFamilies;
|
||||||
use App\DataTables\Shop\ArticlesDataTable;
|
use App\DataTables\Shop\ArticlesDataTable;
|
||||||
|
|
||||||
class ArticleController extends Controller
|
class ArticleController extends Controller
|
||||||
{
|
{
|
||||||
public function index(ArticlesDataTable $dataTable)
|
public function index(ArticlesDataTable $dataTable)
|
||||||
{
|
{
|
||||||
return $dataTable->render('Shop.Admin.Articles.list');
|
$data['families'] = ArticleFamilies::getOptions();
|
||||||
|
return $dataTable->render('Shop.Admin.Articles.list', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDatatable(Request $request)
|
public function getDatatable(Request $request)
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ class PriceGenericController extends Controller
|
|||||||
{
|
{
|
||||||
public function index(PriceGenericsDataTable $dataTable)
|
public function index(PriceGenericsDataTable $dataTable)
|
||||||
{
|
{
|
||||||
return $dataTable->render('Shop.Admin.PriceGenerics.list');
|
$data['categories'] = PriceGenericCategories::getOptions();
|
||||||
|
return $dataTable->render('Shop.Admin.PriceGenerics.list', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDatatable(Request $request)
|
public function getDatatable(Request $request)
|
||||||
|
|||||||
@@ -5,5 +5,11 @@
|
|||||||
])
|
])
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
@include('components.datatable', ['route' => route('Shop.Admin.Articles.index'), 'model' => 'articles'])
|
@include('components.datatable', ['route' => route('Shop.Admin.Articles.index'), 'model' => 'articles', 'with_filters' => true])
|
||||||
|
|
||||||
|
@component('components.layout.modal', ['title' => 'Filtres', 'id' => 'modal-articles-filters'])
|
||||||
|
@include('Shop.Admin.Articles.partials.filters')
|
||||||
|
@endcomponent
|
||||||
|
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<form id="articles-filters">
|
||||||
|
<div class="row">
|
||||||
|
<label class="col-4">Familles d'articles</label>
|
||||||
|
<div class="col-8">
|
||||||
|
@include('components.select', ['name' => 'family_id', 'list' => (isset($families)) ? $families : [], 'value' => (isset($filters['family_id'])) ? $filters['family_id'] : null, 'class' => 'form-control-sm select2', 'with_empty' => ' '])
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
@@ -4,5 +4,10 @@
|
|||||||
'breadcrumb' => [__('price_generics.title')]
|
'breadcrumb' => [__('price_generics.title')]
|
||||||
])
|
])
|
||||||
@section('content')
|
@section('content')
|
||||||
@include('components.datatable', ['route' => route('Shop.Admin.PriceGenerics.index'), 'model' => 'price-generics'])
|
@include('components.datatable', ['route' => route('Shop.Admin.PriceGenerics.index'), 'model' => 'price-generics', 'with_filters' => true])
|
||||||
|
|
||||||
|
@component('components.layout.modal', ['title' => 'Filtres', 'id' => 'modal-price-generics-filters'])
|
||||||
|
@include('Shop.Admin.PriceGenerics.partials.filters')
|
||||||
|
@endcomponent
|
||||||
|
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<form id="price_generics-filters">
|
||||||
|
<div class="row">
|
||||||
|
<label class="col-4">Catégories</label>
|
||||||
|
<div class="col-8">
|
||||||
|
@include('components.select', ['name' => 'category_id', 'list' => (isset($categories)) ? $categories : [], 'value' => (isset($filters['category_id'])) ? $filters['category_id'] : null, 'class' => 'form-control-sm select2', 'with_empty' => ' '])
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
Reference in New Issue
Block a user