diff --git a/app/Http/Controllers/Shop/Admin/ArticleAttributeValueController.php b/app/Http/Controllers/Shop/Admin/ArticleAttributeValueController.php index 76057079..b42469d3 100644 --- a/app/Http/Controllers/Shop/Admin/ArticleAttributeValueController.php +++ b/app/Http/Controllers/Shop/Admin/ArticleAttributeValueController.php @@ -5,6 +5,7 @@ namespace App\Http\Controllers\Shop\Admin; use Illuminate\Http\Request; use App\Http\Controllers\Controller; +use App\Repositories\Shop\ArticleAttributeFamilies; use App\Repositories\Shop\ArticleAttributeValues; use App\DataTables\Shop\ArticleAttributeValuesDataTable; @@ -12,7 +13,8 @@ class ArticleAttributeValueController extends Controller { public function index(ArticleAttributeValuesDataTable $dataTable) { - return $dataTable->render('Shop.Admin.ArticleAttributeValues.list'); + $data['families'] = ArticleAttributeFamilies::getOptions(); + return $dataTable->render('Shop.Admin.ArticleAttributeValues.list', $data); } public function getDatatable(Request $request) @@ -26,7 +28,6 @@ class ArticleAttributeValueController extends Controller return response()->json(ArticleAttributeValues::getSelectByFamily($id)); } - public function create() { return view('Shop.Admin.ArticleAttributeValues.create'); diff --git a/app/Repositories/Shop/ArticleAttributes.php b/app/Repositories/Shop/ArticleAttributes.php index 6c8fdb0f..8af8bdb0 100644 --- a/app/Repositories/Shop/ArticleAttributes.php +++ b/app/Repositories/Shop/ArticleAttributes.php @@ -54,8 +54,6 @@ class ArticleAttributes public static function update($data, $id = false) { - dump($data); - exit; $id = isset($data['id']) ? $id : $data['id']; return ArticleAttribute::find($id)->update($data); } diff --git a/resources/views/Shop/Admin/ArticleAttributeValues/create.blade.php b/resources/views/Shop/Admin/ArticleAttributeValues/create.blade.php index 95ecc6e6..c6df45b6 100644 --- a/resources/views/Shop/Admin/ArticleAttributeValues/create.blade.php +++ b/resources/views/Shop/Admin/ArticleAttributeValues/create.blade.php @@ -22,7 +22,7 @@ - @include('Shop.Admin.ArticleAttributes.form') + @include('Shop.Admin.ArticleAttributeValues.form') @endsection diff --git a/resources/views/Shop/Admin/ArticleAttributeValues/edit.blade.php b/resources/views/Shop/Admin/ArticleAttributeValues/edit.blade.php index b7ac35b9..ac7a4833 100644 --- a/resources/views/Shop/Admin/ArticleAttributeValues/edit.blade.php +++ b/resources/views/Shop/Admin/ArticleAttributeValues/edit.blade.php @@ -8,11 +8,11 @@ @section('content') - {{ Form::open(['route' => 'Shop.Admin.ArticleAttributes.update', 'id' => 'article-attribute-form', 'autocomplete' => 'off', 'files' => true]) }} + {{ Form::open(['route' => 'Shop.Admin.ArticleAttributeValues.update', 'id' => 'article-attribute-form', 'autocomplete' => 'off', 'files' => true]) }}
- + {{ __('article_attributes.list.title') }} @@ -23,7 +23,7 @@
- @include('Shop.Admin.ArticleAttributes.form') + @include('Shop.Admin.ArticleAttributeValues.form') @endsection diff --git a/resources/views/Shop/Admin/ArticleAttributeValues/list.blade.php b/resources/views/Shop/Admin/ArticleAttributeValues/list.blade.php index 9fabff85..4a189a34 100644 --- a/resources/views/Shop/Admin/ArticleAttributeValues/list.blade.php +++ b/resources/views/Shop/Admin/ArticleAttributeValues/list.blade.php @@ -5,9 +5,16 @@ ]) @section('content') - @include('components.datatable', ['route' => route('Shop.Admin.ArticleAttributeValues.index'), 'model' => 'articleattributes']) + @component('components.card') + @include('components.datatable', ['route' => route('Shop.Admin.ArticleAttributeValues.index'), 'model' => 'articleattributevalues']) + @endcomponent + + @component('components.layout.modal', ['title' => 'Filtres', 'id' => 'modal-filters']) + @include('Shop.Admin.ArticleAttributeValues.partials.filters') + @endcomponent + @endsection @push('scripts') - @include('components.js.datatable', ['route' => route('Shop.Admin.ArticleAttributeValues.index'), 'model' => 'articleattributes']) + @include('components.js.datatable', ['route' => route('Shop.Admin.ArticleAttributeValues.index'), 'model' => 'articleattributevalues']) @endpush \ No newline at end of file diff --git a/resources/views/Shop/Admin/ArticleAttributeValues/partials/filters.blade.php b/resources/views/Shop/Admin/ArticleAttributeValues/partials/filters.blade.php new file mode 100644 index 00000000..16ce4981 --- /dev/null +++ b/resources/views/Shop/Admin/ArticleAttributeValues/partials/filters.blade.php @@ -0,0 +1,9 @@ +
+
+ +
+ @include('components.select', ['name' => 'article_attribute_family_id', 'list' => (isset($families)) ? $families : [], 'value' => (isset($filters['article_attribute_family_id'])) ? $filters['article_attribute_family_id'] : null, 'class' => 'form-control-sm select2', 'with_empty' => ' ']) +
+
+ +
diff --git a/resources/views/components/datatables/buttons/exports.blade.php b/resources/views/components/datatables/buttons/exports.blade.php index 7621b429..8be3f8fc 100644 --- a/resources/views/components/datatables/buttons/exports.blade.php +++ b/resources/views/components/datatables/buttons/exports.blade.php @@ -1,4 +1,4 @@ -
+
+@push('js') + +@endpush \ No newline at end of file diff --git a/resources/views/components/datatables/buttons/pageLength.blade.php b/resources/views/components/datatables/buttons/pageLength.blade.php new file mode 100644 index 00000000..265903cb --- /dev/null +++ b/resources/views/components/datatables/buttons/pageLength.blade.php @@ -0,0 +1,2 @@ +@include('components.select', ['name' => 'pager', 'list' => ['5', '10','25', '50', '100']]) +   diff --git a/resources/views/components/datatables/header.blade.php b/resources/views/components/datatables/header.blade.php index 4fd7642a..728d5033 100644 --- a/resources/views/components/datatables/header.blade.php +++ b/resources/views/components/datatables/header.blade.php @@ -1,11 +1,11 @@
-
+
@include('components.datatables.search')
-
+
@include('components.datatables.buttons.exports')
-
+
@include('components.datatables.buttons.add')
\ No newline at end of file diff --git a/resources/views/components/js/datatable.blade.php b/resources/views/components/js/datatable.blade.php index 8160c49c..fca832f4 100644 --- a/resources/views/components/js/datatable.blade.php +++ b/resources/views/components/js/datatable.blade.php @@ -1,4 +1,4 @@ -