From 37ffaa938b1c2b1b9ec17e9812a3cd1e7f49df09 Mon Sep 17 00:00:00 2001 From: Ludovic CANDELLIER Date: Mon, 22 Mar 2021 00:47:44 +0100 Subject: [PATCH] Update with new price management --- .../Shop/ArticleAttributeValuesDataTable.php | 28 ----- app/DataTables/Shop/UnitiesDataTable.php | 28 +++++ .../Shop/Admin/ArticleAttributeController.php | 86 ------------- .../Admin/ArticleAttributeValueController.php | 64 ---------- .../Shop/Admin/PriceFamilyController.php | 56 --------- .../Shop/Admin/PriceFamilyValueController.php | 64 ---------- .../Shop/Admin/UnityController.php | 32 ++--- app/Models/Shop/ArticleFamily.php | 13 ++ app/Models/Shop/ArticlePrice.php | 8 +- app/Models/Shop/Price.php | 10 +- app/Models/Shop/PriceFamily.php | 30 ----- app/Models/Shop/PriceFamilyValue.php | 22 ---- app/Models/Shop/Unity.php | 12 +- app/Repositories/Shop/Articles.php | 2 +- app/Repositories/Shop/PriceFamilies.php | 55 -------- app/Repositories/Shop/PriceFamilyValues.php | 67 ---------- app/Repositories/Shop/Unities.php | 11 ++ .../views/Shop/Admin/Articles/form.blade.php | 3 +- .../partials/generic_prices.blade.php | 119 ------------------ .../block_generic_price_new.blade.php | 49 +------- .../generic_prices/generic_prices.blade.php | 52 ++++++++ .../Admin/Articles/partials/prices.blade.php | 117 +---------------- .../partials/prices/block_attribute.blade.php | 24 ---- .../prices/block_attribute_new.blade.php | 24 ---- .../partials/prices/block_price.blade.php | 51 ++++---- .../partials/prices/block_price_new.blade.php | 42 ++++--- .../Articles/partials/prices/prices.blade.php | 96 ++++++++++++++ .../partials/table-prices.blade.php | 46 +++---- .../views/components/button-add.blade.php | 2 +- .../views/components/button-cancel.blade.php | 10 +- .../views/components/button-delete.blade.php | 4 +- .../views/components/button-save.blade.php | 4 +- .../views/components/button-submit.blade.php | 3 + .../views/components/datatable.blade.php | 9 +- .../components/datatables/buttons.blade.php | 27 ++++ .../datatables/buttons/add.blade.php | 12 +- .../datatables/buttons/colvis.blade.php | 12 +- .../datatables/buttons/download.blade.php | 2 +- .../datatables/buttons/excel.blade.php | 19 ++- .../datatables/buttons/filters.blade.php | 23 ++-- .../datatables/buttons/mail.blade.php | 10 ++ .../datatables/buttons/pageLength.blade.php | 15 ++- .../datatables/buttons/pdf.blade.php | 8 +- .../datatables/buttons/print.blade.php | 28 ++--- .../components/datatables/header.blade.php | 14 ++- .../datatables/js/datatable.blade.php | 70 +++++++++++ .../components/datatables/search.blade.php | 27 +++- resources/views/load/appender.blade.php | 77 ++++++++++++ resources/views/load/autocomplete.blade.php | 18 +++ resources/views/load/chevron.blade.php | 16 +++ resources/views/load/datatables.blade.php | 38 ++++-- resources/views/load/datepicker.blade.php | 30 +++++ resources/views/load/editor.blade.php | 15 +++ resources/views/load/editor/tinymce.blade.php | 39 ++++++ resources/views/load/fileinput.blade.php | 25 ++++ resources/views/load/handlebars.blade.php | 74 +++++++++++ resources/views/load/modal.blade.php | 114 +++++++++++++++++ resources/views/load/moment.blade.php | 7 ++ resources/views/load/nestable.blade.php | 53 ++++++++ resources/views/load/select2.blade.php | 18 +++ resources/views/load/set_options.blade.php | 25 ++++ resources/views/load/toggle.blade.php | 34 +++++ routes/Shop/Admin/Unities.php | 7 ++ routes/Shop/Admin/route.php | 2 +- 64 files changed, 1118 insertions(+), 984 deletions(-) delete mode 100644 app/DataTables/Shop/ArticleAttributeValuesDataTable.php create mode 100644 app/DataTables/Shop/UnitiesDataTable.php delete mode 100644 app/Http/Controllers/Shop/Admin/ArticleAttributeController.php delete mode 100644 app/Http/Controllers/Shop/Admin/ArticleAttributeValueController.php delete mode 100644 app/Http/Controllers/Shop/Admin/PriceFamilyController.php delete mode 100644 app/Http/Controllers/Shop/Admin/PriceFamilyValueController.php delete mode 100644 app/Models/Shop/PriceFamily.php delete mode 100644 app/Models/Shop/PriceFamilyValue.php delete mode 100644 app/Repositories/Shop/PriceFamilies.php delete mode 100644 app/Repositories/Shop/PriceFamilyValues.php delete mode 100644 resources/views/Shop/Admin/Articles/partials/generic_prices.blade.php create mode 100644 resources/views/Shop/Admin/Articles/partials/generic_prices/generic_prices.blade.php delete mode 100644 resources/views/Shop/Admin/Articles/partials/prices/block_attribute.blade.php delete mode 100644 resources/views/Shop/Admin/Articles/partials/prices/block_attribute_new.blade.php create mode 100644 resources/views/Shop/Admin/Articles/partials/prices/prices.blade.php create mode 100644 resources/views/components/button-submit.blade.php create mode 100644 resources/views/components/datatables/buttons.blade.php create mode 100644 resources/views/components/datatables/buttons/mail.blade.php create mode 100644 resources/views/components/datatables/js/datatable.blade.php create mode 100644 resources/views/load/appender.blade.php create mode 100644 resources/views/load/autocomplete.blade.php create mode 100644 resources/views/load/chevron.blade.php create mode 100644 resources/views/load/datepicker.blade.php create mode 100644 resources/views/load/editor.blade.php create mode 100644 resources/views/load/editor/tinymce.blade.php create mode 100644 resources/views/load/fileinput.blade.php create mode 100644 resources/views/load/handlebars.blade.php create mode 100644 resources/views/load/modal.blade.php create mode 100644 resources/views/load/moment.blade.php create mode 100644 resources/views/load/nestable.blade.php create mode 100644 resources/views/load/select2.blade.php create mode 100644 resources/views/load/set_options.blade.php create mode 100644 resources/views/load/toggle.blade.php create mode 100644 routes/Shop/Admin/Unities.php diff --git a/app/DataTables/Shop/ArticleAttributeValuesDataTable.php b/app/DataTables/Shop/ArticleAttributeValuesDataTable.php deleted file mode 100644 index cbb626e9..00000000 --- a/app/DataTables/Shop/ArticleAttributeValuesDataTable.php +++ /dev/null @@ -1,28 +0,0 @@ -title('Attributs'), - Column::make('article_attribute_family.name')->title('Famille d\'attributs')->sortable(false), - self::makeColumnButtons(), - ]; - } - -} diff --git a/app/DataTables/Shop/UnitiesDataTable.php b/app/DataTables/Shop/UnitiesDataTable.php new file mode 100644 index 00000000..702e240c --- /dev/null +++ b/app/DataTables/Shop/UnitiesDataTable.php @@ -0,0 +1,28 @@ +title('Attributs'), + Column::make('price_family.name')->title('Famille')->orderable(false), + self::makeColumnButtons(), + ]; + } + +} diff --git a/app/Http/Controllers/Shop/Admin/ArticleAttributeController.php b/app/Http/Controllers/Shop/Admin/ArticleAttributeController.php deleted file mode 100644 index 1fda5c36..00000000 --- a/app/Http/Controllers/Shop/Admin/ArticleAttributeController.php +++ /dev/null @@ -1,86 +0,0 @@ -render('Shop.Admin.ArticleAttributeValues.list', $data); - } - - public function getDatatable(Request $request) - { - return ArticleAttributeValues::getTables($request->all()); - } - - public function getOptionsByFamily(Request $request) - { - $id = $request->input('family_id'); - return response()->json(ArticleAttributeValues::getSelectByFamily($id)); - } - - public function create() - { - return view('Shop.Admin.ArticleAttributeValues.create'); - } - - public function store(Request $request) - { - $ret = ArticleAttributeValues::store($request->all()); - return redirect()->route('Shop.Admin.ArticleAttributeValues.index'); - } - - public function show($id) - { - $data = ArticleAttributeValues::get($id); - return view('Shop.Admin.ArticleAttributeValues.view', $data); - } - - public function edit($id) - { - $data = ArticleAttributeValues::get($id); - return view('Shop.Admin.ArticleAttributeValues.edit', $data); - } - - public function update(Request $request) - { - // - } - - public function destroy($id) - { - return ArticleAttributeValues::destroy($id); - } - -} diff --git a/app/Http/Controllers/Shop/Admin/PriceFamilyController.php b/app/Http/Controllers/Shop/Admin/PriceFamilyController.php deleted file mode 100644 index 345d6fd0..00000000 --- a/app/Http/Controllers/Shop/Admin/PriceFamilyController.php +++ /dev/null @@ -1,56 +0,0 @@ -render('Shop.Admin.PriceFamilies.list'); - } - - public function getDatatable(Request $request) - { - return PriceFamilies::getTables($request->all()); - } - - public function create() - { - return view('Shop.Admin.PriceFamilies.create'); - } - - public function store(Request $request) - { - $ret = PriceFamilies::store($request->all()); - return redirect()->route('Shop.Admin.PriceFamilies.index'); - } - - public function show($id) - { - $data = PriceFamilies::get($id); - return view('Shop.Admin.PriceFamilies.view', $data); - } - - public function edit($id) - { - $data = PriceFamilies::get($id); - return view('Shop.Admin.PriceFamilies.edit', $data); - } - - public function update(Request $request) - { - // - } - - public function destroy($id) - { - return PriceFamilies::destroy($id); - } - -} diff --git a/app/Http/Controllers/Shop/Admin/PriceFamilyValueController.php b/app/Http/Controllers/Shop/Admin/PriceFamilyValueController.php deleted file mode 100644 index 62801e47..00000000 --- a/app/Http/Controllers/Shop/Admin/PriceFamilyValueController.php +++ /dev/null @@ -1,64 +0,0 @@ -render('Shop.Admin.PriceFamilyValues.list', $data); - } - - public function getDatatable(Request $request) - { - return PriceFamilyValues::getTables($request->all()); - } - - public function getOptionsByFamily(Request $request) - { - $id = $request->input('family_id'); - return response()->json(PriceFamilyValues::getSelectByFamily($id)); - } - - public function create() - { - return view('Shop.Admin.PriceFamilyValues.create'); - } - - public function store(Request $request) - { - $ret = PriceFamilyValues::store($request->all()); - return redirect()->route('Shop.Admin.PriceFamilyValues.index'); - } - - public function show($id) - { - $data = PriceFamilyValues::get($id); - return view('Shop.Admin.PriceFamilyValues.view', $data); - } - - public function edit($id) - { - $data = PriceFamilyValues::get($id); - return view('Shop.Admin.PriceFamilyValues.edit', $data); - } - - public function update(Request $request) - { - // - } - - public function destroy($id) - { - return PriceFamilyValues::destroy($id); - } - -} diff --git a/app/Http/Controllers/Shop/Admin/UnityController.php b/app/Http/Controllers/Shop/Admin/UnityController.php index d3988574..6e9b733d 100644 --- a/app/Http/Controllers/Shop/Admin/UnityController.php +++ b/app/Http/Controllers/Shop/Admin/UnityController.php @@ -5,50 +5,50 @@ namespace App\Http\Controllers\Shop\Admin; use Illuminate\Http\Request; use App\Http\Controllers\Controller; -use App\Repositories\Shop\PriceFamilies; -use App\Repositories\Shop\UnityValues; -use App\DataTables\Shop\UnityValuesDataTable; +use App\Repositories\Shop\ArticleFamilies; +use App\Repositories\Shop\Unities; +use App\DataTables\Shop\UnitiesDataTable; class UnityValueController extends Controller { - public function index(UnityValuesDataTable $dataTable) + public function index(UnitiesDataTable $dataTable) { - $data['families'] = PriceFamilies::getOptions(); - return $dataTable->render('Shop.Admin.UnityValues.list', $data); + $data['families'] = ArticleFamilies::getOptions(); + return $dataTable->render('Shop.Admin.Unities.list', $data); } public function getDatatable(Request $request) { - return UnityValues::getTables($request->all()); + return Unities::getTables($request->all()); } public function getOptionsByFamily(Request $request) { $id = $request->input('family_id'); - return response()->json(UnityValues::getSelectByFamily($id)); + return response()->json(Unities::getSelectByFamily($id)); } public function create() { - return view('Shop.Admin.UnityValues.create'); + return view('Shop.Admin.Unities.create'); } public function store(Request $request) { - $ret = UnityValues::store($request->all()); - return redirect()->route('Shop.Admin.UnityValues.index'); + $ret = Unities::store($request->all()); + return redirect()->route('Shop.Admin.Unities.index'); } public function show($id) { - $data = UnityValues::get($id); - return view('Shop.Admin.UnityValues.view', $data); + $data = Unities::get($id); + return view('Shop.Admin.Unities.view', $data); } public function edit($id) { - $data = UnityValues::get($id); - return view('Shop.Admin.UnityValues.edit', $data); + $data = Unities::get($id); + return view('Shop.Admin.Unities.edit', $data); } public function update(Request $request) @@ -58,7 +58,7 @@ class UnityValueController extends Controller public function destroy($id) { - return UnityValues::destroy($id); + return Unities::destroy($id); } } diff --git a/app/Models/Shop/ArticleFamily.php b/app/Models/Shop/ArticleFamily.php index b4aa3f60..c3d82cb2 100644 --- a/app/Models/Shop/ArticleFamily.php +++ b/app/Models/Shop/ArticleFamily.php @@ -3,9 +3,12 @@ namespace App\Models\Shop; use Illuminate\Database\Eloquent\Model; +use Staudenmeir\EloquentHasManyDeep\HasRelationships; class ArticleFamily extends Model { + use HasRelationships; + protected $guarded = ['id']; protected $table = 'shop_article_families'; @@ -13,4 +16,14 @@ class ArticleFamily extends Model { return $this->hasMany('App\Models\Shop\Article'); } + + public function prices() + { + return $this->hasMany('App\Models\Shop\Price'); + } + + public function unities() + { + return $this->hasMany('App\Models\Shop\Unity'); + } } \ No newline at end of file diff --git a/app/Models/Shop/ArticlePrice.php b/app/Models/Shop/ArticlePrice.php index b3c12e09..f078e8d6 100644 --- a/app/Models/Shop/ArticlePrice.php +++ b/app/Models/Shop/ArticlePrice.php @@ -17,9 +17,9 @@ class ArticlePrice extends Model return $this->hasOne('App\Models\Price'); } - public function priceFamilyValue() + public function article_family() { - return $this->belongsTo('App\Models\PriceFamilyValue'); + return $this->belongsTo('App\Models\ArticleFamily'); } public function scopeByQuantity($query, $quantity) @@ -27,8 +27,8 @@ class ArticlePrice extends Model return $query->orderBy('quantity', 'desc')->where('quantity', '<', $quantity)->first(); } - public function scopeByPriceFamilyValue($query, $id) + public function scopeByFamily($query, $id) { - return $query->where('price_family_value_id', $id); + return $query->where('article_family_value_id', $id); } } \ No newline at end of file diff --git a/app/Models/Shop/Price.php b/app/Models/Shop/Price.php index 75acd42c..bfda0056 100644 --- a/app/Models/Shop/Price.php +++ b/app/Models/Shop/Price.php @@ -17,9 +17,9 @@ class Price extends Model return $this->belongsTo('App\Models\Shop\Article'); } - public function price_family() + public function article_family() { - return $this->belongsTo('App\Models\Shop\PriceFamily'); + return $this->belongsTo('App\Models\Shop\ArticleFamily'); } public function generic() @@ -29,7 +29,7 @@ class Price extends Model public function generic_prices() { - + } public function scopeByArticle($query, $id) @@ -37,9 +37,9 @@ class Price extends Model return $query->where('article_id', $id); } - public function scopeByPriceFamily($query, $id) + public function scopeByArticleFamily($query, $id) { - return $query->where('price_family_id', $id); + return $query->where('article_family_id', $id); } public function scopeGeneric($query) diff --git a/app/Models/Shop/PriceFamily.php b/app/Models/Shop/PriceFamily.php deleted file mode 100644 index ebe55210..00000000 --- a/app/Models/Shop/PriceFamily.php +++ /dev/null @@ -1,30 +0,0 @@ -hasMany('App\Models\Shop\Price'); - } - - public function values() - { - return $this->hasMany('App\Models\Shop\PriceFamilyValue'); - } - - public function articles() - { - return $this->hasManyThrough('App\Models\Shop\Article','App\Models\Shop\Price'); - } - -} \ No newline at end of file diff --git a/app/Models/Shop/PriceFamilyValue.php b/app/Models/Shop/PriceFamilyValue.php deleted file mode 100644 index 64684d0c..00000000 --- a/app/Models/Shop/PriceFamilyValue.php +++ /dev/null @@ -1,22 +0,0 @@ -belongsTo('App\Models\Shop\PriceFamily'); - } - - public function scopeByFamily($query, $id) - { - return $query->where('price_family_id'); - } - -} \ No newline at end of file diff --git a/app/Models/Shop/Unity.php b/app/Models/Shop/Unity.php index dbdaa5b4..3bdfc5c1 100644 --- a/app/Models/Shop/Unity.php +++ b/app/Models/Shop/Unity.php @@ -6,8 +6,16 @@ use Illuminate\Database\Eloquent\Model; class Unity extends Model { - protected $guarded = ['id']; - protected $table = 'shop_unities'; + protected $guarded = ['id']; + protected $table = 'shop_unities'; + public function article_family() + { + return $this->belongsTo('App\Models\Shop\ArticleFamily'); + } + public function scopeByFamily($query, $id) + { + return $query->where('article_family_id'); + } } diff --git a/app/Repositories/Shop/Articles.php b/app/Repositories/Shop/Articles.php index 7410d705..4102a186 100644 --- a/app/Repositories/Shop/Articles.php +++ b/app/Repositories/Shop/Articles.php @@ -41,7 +41,7 @@ class Articles $data['price_generics'] = PriceGenericCategories::getOptionsWithChildrens(); $data['families_options'] = ArticleFamilies::getOptions(); $data['taxes_options'] = Taxes::getOptions(); - $data['attribute_families_options'] = PriceFamilies::getOptions(); + $data['unities'] = Unities::getSelectByFamily($data['article_family_id']); $data['tags_list'] = TagGroups::getTreeTags(); $data['models_options'] = ['App\Models\Botanic\Specie' => 'Espèces', 'App\Models\Botanic\Variety' => 'Variétés']; return $data; diff --git a/app/Repositories/Shop/PriceFamilies.php b/app/Repositories/Shop/PriceFamilies.php deleted file mode 100644 index d399472f..00000000 --- a/app/Repositories/Shop/PriceFamilies.php +++ /dev/null @@ -1,55 +0,0 @@ -make(true); - } - - public static function getAll() - { - return PriceFamily::orderBy('name','asc')->get(); - } - - public static function get($id) - { - return PriceFamily::find($id); - } - - public static function getOptions() - { - return PriceFamily::get()->pluck('name','id')->toArray(); - } - - public static function store($data) - { - $id = isset($data['id']) ? $data['id'] : false; - $item = $id ? self::update($data) : self::create($data); - return $item->id; - } - - public static function create($data) - { - return PriceFamily::create($data); - } - - public static function update($data) - { - return PriceFamily::find($id)->update($data); - } - - public static function destroy($id) - { - return PriceFamily::destroy($id); - } - -} diff --git a/app/Repositories/Shop/PriceFamilyValues.php b/app/Repositories/Shop/PriceFamilyValues.php deleted file mode 100644 index ecf1140b..00000000 --- a/app/Repositories/Shop/PriceFamilyValues.php +++ /dev/null @@ -1,67 +0,0 @@ -make(true); - } - - public static function getAll() - { - return PriceFamilyValue::orderBy('name','asc')->get(); - } - - public static function get($id) - { - return PriceFamilyValue::find($id); - } - - public static function getOptions() - { - return PriceFamilyValue::get()->pluck('value','id')->toArray(); - } - - public static function getSelectByFamily($family_id) - { - // return PriceFamilyValue::byFamily($attribute_family_id)->get()->pluck('value','id')->toArray(); - $values = PriceFamilyValue::byFamily($family_id)->get(); - $data = []; - foreach ($values as $value) - { - $data[] = ['id' => $value->id, 'text' => $value->value]; - } - return collect($data)->sortBy('text')->values()->all(); - } - - public static function store($data) - { - $id = isset($data['id']) ? $data['id'] : false; - $item = $id ? self::update($data) : self::create($data); - return $item->id; - } - - public static function create($data) - { - return PriceFamilyValue::create($data); - } - - public static function update($data) - { - return PriceFamilyValue::find($id)->update($data); - } - - public static function destroy($id) - { - return PriceFamilyValue::destroy($id); - } - -} diff --git a/app/Repositories/Shop/Unities.php b/app/Repositories/Shop/Unities.php index 0e756f57..3a4dcfde 100644 --- a/app/Repositories/Shop/Unities.php +++ b/app/Repositories/Shop/Unities.php @@ -23,6 +23,17 @@ class Unities return Unity::orderBy('value','asc')->get()->pluck('value','id')->toArray(); } + public static function getSelectByFamily($family_id) + { + $values = Unity::byFamily($family_id)->get(); + $data = []; + foreach ($values as $value) + { + $data[] = ['id' => $value->id, 'text' => $value->value]; + } + return collect($data)->sortBy('text')->values()->all(); + } + public static function getAll() { return Unity::orderBy('value','asc')->get(); diff --git a/resources/views/Shop/Admin/Articles/form.blade.php b/resources/views/Shop/Admin/Articles/form.blade.php index f905711b..64380c3d 100644 --- a/resources/views/Shop/Admin/Articles/form.blade.php +++ b/resources/views/Shop/Admin/Articles/form.blade.php @@ -52,8 +52,7 @@
- @include('Shop.Admin.Articles.partials.prices', ['prices' => $prices['prices'] ?? null]) - @include('Shop.Admin.Articles.partials.generic_prices', ['generics' => $prices['generics'] ?? null]) + @include('Shop.Admin.Articles.partials.prices')
diff --git a/resources/views/Shop/Admin/Articles/partials/generic_prices.blade.php b/resources/views/Shop/Admin/Articles/partials/generic_prices.blade.php deleted file mode 100644 index 8828e3e8..00000000 --- a/resources/views/Shop/Admin/Articles/partials/generic_prices.blade.php +++ /dev/null @@ -1,119 +0,0 @@ -@include('Shop.Admin.Articles.partials.generic_prices.block_generic_price_new') - -
- @include('Shop.Admin.Articles.partials.generic_prices.list-generic_prices') -
- - - - -@include('components.select-tree', ['name' => "article_price_generic_id", 'value' => $price['article_price_generic_id'] ?? null, 'list' => $price_generics ?? null, 'required' => false, 'class' => 'form-control-sm w-100']) - - -@push('js') - -@endpush diff --git a/resources/views/Shop/Admin/Articles/partials/generic_prices/block_generic_price_new.blade.php b/resources/views/Shop/Admin/Articles/partials/generic_prices/block_generic_price_new.blade.php index 69123267..c423fbeb 100644 --- a/resources/views/Shop/Admin/Articles/partials/generic_prices/block_generic_price_new.blade.php +++ b/resources/views/Shop/Admin/Articles/partials/generic_prices/block_generic_price_new.blade.php @@ -1,54 +1,9 @@ -
+
-
-
- -
+ @include('Shop.Admin.PriceGenerics.partials.table-prices', ['generic' => $generic['generic'] ?? null ]) -
- {{ Form::label('price_generic_id', 'Générique') }}
- @include('components.select-tree', ['name' => "prices[0][article_price_generic_id]", 'value' => $price['article_price_generic_id'] ?? null, 'list' => $price_generics ?? null, 'required' => false, 'class' => 'form-control-sm']) -
- -
- {{ Form::label('quantity', 'Quantité') }}
- @include('components.number', ['name' => 'prices[0][quantity]', 'value' => $quantity ?? 1, 'required' => true, 'class' => 'form-control-sm']) -
- -
- @include('Shop.Admin.Articles.partials.prices.block_attribute_new') -
- -
- -
- {{ Form::label('tax_id', 'TVA') }}
- @include('components.select', ['name' => 'prices[0][tax_id]', 'value' => $tax_id ?? null, 'list' => $taxes_options ?? null, 'required' => true, 'class' => 'form-control form-control-sm']) -
- -
- {{ Form::label('price', 'Prix HT') }} - @include('components.money', ['name' => 'prices[0][price]', 'value' => $price ?? 0, 'required' => true, 'class' => 'form-control-sm price-item']) -
- -
- {{ Form::label('price_taxed', 'Prix TTC') }} - @include('components.money', ['name' => 'prices[0][price_taxed]', 'value' => $price_taxed ?? 0, 'required' => true, 'class' => 'form-control-sm price-taxed-item']) -
-
- -
-
- -
- -
- -
\ No newline at end of file diff --git a/resources/views/Shop/Admin/Articles/partials/generic_prices/generic_prices.blade.php b/resources/views/Shop/Admin/Articles/partials/generic_prices/generic_prices.blade.php new file mode 100644 index 00000000..210d73d5 --- /dev/null +++ b/resources/views/Shop/Admin/Articles/partials/generic_prices/generic_prices.blade.php @@ -0,0 +1,52 @@ +@include('Shop.Admin.Articles.partials.generic_prices.block_generic_price_new') + +
+ @include('Shop.Admin.Articles.partials.generic_prices.list-generic_prices') +
+ + + + +@include('components.select-tree', ['name' => "article_price_generic_id", 'value' => $price['article_price_generic_id'] ?? null, 'list' => $price_generics ?? null, 'required' => false, 'class' => 'form-control-sm w-100']) + + +@push('js') + +@endpush diff --git a/resources/views/Shop/Admin/Articles/partials/prices.blade.php b/resources/views/Shop/Admin/Articles/partials/prices.blade.php index 2ba55d6c..154b37ce 100644 --- a/resources/views/Shop/Admin/Articles/partials/prices.blade.php +++ b/resources/views/Shop/Admin/Articles/partials/prices.blade.php @@ -1,115 +1,2 @@ -@include('Shop.Admin.Articles.partials.prices.block_price_new') - -
- @include('Shop.Admin.Articles.partials.prices.list-prices') -
- - - -@push('js') - -@endpush +@include('Shop.Admin.Articles.partials.prices.prices', ['prices' => $prices['prices'] ?? null]) +@include('Shop.Admin.Articles.partials.generic_prices.generic_prices', ['generics' => $prices['generics'] ?? null]) diff --git a/resources/views/Shop/Admin/Articles/partials/prices/block_attribute.blade.php b/resources/views/Shop/Admin/Articles/partials/prices/block_attribute.blade.php deleted file mode 100644 index 734661bc..00000000 --- a/resources/views/Shop/Admin/Articles/partials/prices/block_attribute.blade.php +++ /dev/null @@ -1,24 +0,0 @@ -
- -
- {{ Form::label('attribute_family_id', 'Type') }}
- @include('components.select', [ - 'name' => "prices[$key][price_family_id]", - 'value' => $price['price_family_id'] ?? null, - 'list' => $attribute_families_options, - 'required' => true, - 'class' => 'select2 form-control-sm attributes-family' - ]) -
- -
- {{ Form::label('attribute_value_id', 'Unité') }}
- @include('components.select', [ - 'name' => "prices[$key][unity_id]", - 'value' => $price['unity_id'] ?? null, - 'list' => $unities ?? null, - 'required' => true, - 'class' => 'select2 form-control-sm attributes-value w-100', - ]) -
-
diff --git a/resources/views/Shop/Admin/Articles/partials/prices/block_attribute_new.blade.php b/resources/views/Shop/Admin/Articles/partials/prices/block_attribute_new.blade.php deleted file mode 100644 index 9d22b6cb..00000000 --- a/resources/views/Shop/Admin/Articles/partials/prices/block_attribute_new.blade.php +++ /dev/null @@ -1,24 +0,0 @@ -
- -
- {{ Form::label('attribute_family_id', 'Attributs') }}
- @include('components.select', [ - 'name' => 'prices[][attribute][attribute_family_id]', - 'value' => $attribute_value['article_attribute_family_id'] ?? null, - 'list' => $attribute_families_options, - 'required' => true, - 'class' => 'select2 form-control-sm attributes-family' - ]) -
- -
- {{ Form::label('attribute_value_id', 'Valeur') }}
- @include('components.select', [ - 'name' => 'prices[][attribute][attribute_value_id]', - 'value' => $attribute_value['id'] ?? null, - 'list' => $attribute_values ?? null, - 'required' => true, - 'class' => 'select2 form-control-sm attributes-value' - ]) -
-
diff --git a/resources/views/Shop/Admin/Articles/partials/prices/block_price.blade.php b/resources/views/Shop/Admin/Articles/partials/prices/block_price.blade.php index be546453..1db86b6a 100644 --- a/resources/views/Shop/Admin/Articles/partials/prices/block_price.blade.php +++ b/resources/views/Shop/Admin/Articles/partials/prices/block_price.blade.php @@ -6,35 +6,37 @@
+
+ {{ Form::label('quantity', 'Qté.') }}
+ @include('components.number', ['name' => "prices[$key][quantity]", 'value' => $price['quantity'] ?? 1, 'required' => true, 'class' => 'form-control-sm']) +
-
+
+ {{ Form::label('unity_id', 'Unité') }}
+ @include('components.select', [ + 'name' => "prices[$key][unity_id]", + 'value' => $price['unity_id'] ?? null, + 'list' => $unities ?? null, + 'required' => true, + 'class' => 'select2 form-control-sm unities w-100', + ]) +
+ +
-
- {{ Form::label('quantity', 'Qté.') }}
- @include('components.number', ['name' => "prices[$key][quantity]", 'value' => $price['quantity'] ?? 1, 'required' => true, 'class' => 'form-control-sm']) +
+ {{ Form::label('tax_id', 'TVA') }}
+ @include('components.select', ['name' => "prices[$key][tax_id]", 'value' => $price['tax_id'] ?? null, 'list' => $taxes_options ?? null, 'required' => true, 'class' => 'form-control form-control-sm'])
-
- @include('Shop.Admin.Articles.partials.prices.block_attribute') +
+ {{ Form::label('price', 'Prix HT') }} + @include('components.money', ['name' => "prices[$key][price]", 'value' => $price['price'] ?? 0, 'required' => true, 'class' => 'form-control-sm price-item'])
-
-
-
- {{ Form::label('tax_id', 'TVA') }}
- @include('components.select', ['name' => "prices[$key][tax_id]", 'value' => $price['tax_id'] ?? null, 'list' => $taxes_options ?? null, 'required' => true, 'class' => 'form-control form-control-sm']) -
- -
- {{ Form::label('price', 'Prix HT') }} - @include('components.money', ['name' => "prices[$key][price]", 'value' => $price['price'] ?? 0, 'required' => true, 'class' => 'form-control-sm price-item']) -
- -
- {{ Form::label('price_taxed', 'Prix TTC') }} - @include('components.money', ['name' => "prices[$key][price_taxed]", 'value' => $price['price_taxed'] ?? 0, 'required' => true, 'class' => 'form-control-sm price-taxed-item']) -
-
+
+ {{ Form::label('price_taxed', 'Prix TTC') }} + @include('components.money', ['name' => "prices[$key][price_taxed]", 'value' => $price['price_taxed'] ?? 0, 'required' => true, 'class' => 'form-control-sm price-taxed-item'])
@@ -45,10 +47,7 @@
-
-
-
\ No newline at end of file diff --git a/resources/views/Shop/Admin/Articles/partials/prices/block_price_new.blade.php b/resources/views/Shop/Admin/Articles/partials/prices/block_price_new.blade.php index 69123267..a7f0d32e 100644 --- a/resources/views/Shop/Admin/Articles/partials/prices/block_price_new.blade.php +++ b/resources/views/Shop/Admin/Articles/partials/prices/block_price_new.blade.php @@ -7,35 +7,39 @@
-
- {{ Form::label('price_generic_id', 'Générique') }}
- @include('components.select-tree', ['name' => "prices[0][article_price_generic_id]", 'value' => $price['article_price_generic_id'] ?? null, 'list' => $price_generics ?? null, 'required' => false, 'class' => 'form-control-sm']) -
-
{{ Form::label('quantity', 'Quantité') }}
@include('components.number', ['name' => 'prices[0][quantity]', 'value' => $quantity ?? 1, 'required' => true, 'class' => 'form-control-sm'])
-
- @include('Shop.Admin.Articles.partials.prices.block_attribute_new') +
+ {{ Form::label('unity_id', 'Unité') }}
+ @include('components.select', [ + 'name' => "prices[0][unity_id]", + 'value' => $price['unity_id'] ?? null, + 'list' => $unities ?? null, + 'required' => true, + 'class' => 'select2 form-control-sm unities w-100', + ])
-
+
-
- {{ Form::label('tax_id', 'TVA') }}
- @include('components.select', ['name' => 'prices[0][tax_id]', 'value' => $tax_id ?? null, 'list' => $taxes_options ?? null, 'required' => true, 'class' => 'form-control form-control-sm']) -
+
+
+ {{ Form::label('tax_id', 'TVA') }}
+ @include('components.select', ['name' => 'prices[0][tax_id]', 'value' => $tax_id ?? null, 'list' => $taxes_options ?? null, 'required' => true, 'class' => 'form-control form-control-sm']) +
-
- {{ Form::label('price', 'Prix HT') }} - @include('components.money', ['name' => 'prices[0][price]', 'value' => $price ?? 0, 'required' => true, 'class' => 'form-control-sm price-item']) -
+
+ {{ Form::label('price', 'Prix HT') }} + @include('components.money', ['name' => 'prices[0][price]', 'value' => $price ?? 0, 'required' => true, 'class' => 'form-control-sm price-item']) +
-
- {{ Form::label('price_taxed', 'Prix TTC') }} - @include('components.money', ['name' => 'prices[0][price_taxed]', 'value' => $price_taxed ?? 0, 'required' => true, 'class' => 'form-control-sm price-taxed-item']) +
+ {{ Form::label('price_taxed', 'Prix TTC') }} + @include('components.money', ['name' => 'prices[0][price_taxed]', 'value' => $price_taxed ?? 0, 'required' => true, 'class' => 'form-control-sm price-taxed-item']) +
diff --git a/resources/views/Shop/Admin/Articles/partials/prices/prices.blade.php b/resources/views/Shop/Admin/Articles/partials/prices/prices.blade.php new file mode 100644 index 00000000..468fe90b --- /dev/null +++ b/resources/views/Shop/Admin/Articles/partials/prices/prices.blade.php @@ -0,0 +1,96 @@ +@include('Shop.Admin.Articles.partials.prices.block_price_new') + +
+ @include('Shop.Admin.Articles.partials.prices.list-prices') +
+ + + +@push('js') + +@endpush diff --git a/resources/views/Shop/Admin/PriceGenerics/partials/table-prices.blade.php b/resources/views/Shop/Admin/PriceGenerics/partials/table-prices.blade.php index 6c966b09..2bdc8972 100644 --- a/resources/views/Shop/Admin/PriceGenerics/partials/table-prices.blade.php +++ b/resources/views/Shop/Admin/PriceGenerics/partials/table-prices.blade.php @@ -1,23 +1,25 @@ - +@if (count($generic['prices'] ?? [])) +
- - - @foreach ($generic['prices'] as $price) - - @endforeach - - - - @foreach ($generic['prices'] as $price) - - @endforeach - -
- {{ $generic['category']['name'] ?? null }} - - {{ $price['quantity'] ?? null }} {{ $price['unity_id'] ?? null }} -
- {{ $generic['name'] ?? null }} - - {{ $price['price_taxed'] ?? null }} -
+ + + {{ $generic['category']['name'] ?? null }} + + @foreach ($generic['prices'] as $price) + + {{ $price['quantity'] ?? null }} {{ $price['unity_id'] ?? null }} + + @endforeach + + + + {{ $generic['name'] ?? null }} + + @foreach ($generic['prices'] as $price) + + {{ $price['price_taxed'] ?? null }} + + @endforeach + + +@endif diff --git a/resources/views/components/button-add.blade.php b/resources/views/components/button-add.blade.php index d2dae1f2..28231190 100644 --- a/resources/views/components/button-add.blade.php +++ b/resources/views/components/button-add.blade.php @@ -1 +1 @@ - \ No newline at end of file +@include('components.button', ['class' => 'btn-success ' . ($class ?? ''), 'icon' => 'fa-plus' ]) diff --git a/resources/views/components/button-cancel.blade.php b/resources/views/components/button-cancel.blade.php index ccd68316..96fab2cc 100644 --- a/resources/views/components/button-cancel.blade.php +++ b/resources/views/components/button-cancel.blade.php @@ -1,11 +1,13 @@ - +@include('components.button', ['class' => 'btn-secondary cancel ' . ($class ?? ''), 'icon' => 'fa-ban', 'txt' => __('cancel')]) @push('js') @endpush \ No newline at end of file diff --git a/resources/views/components/button-delete.blade.php b/resources/views/components/button-delete.blade.php index 7b3be035..4d1ea6d6 100644 --- a/resources/views/components/button-delete.blade.php +++ b/resources/views/components/button-delete.blade.php @@ -1,3 +1 @@ - \ No newline at end of file +@include('components.button', ['class' => 'btn-danger ' . ($class ?? ''), 'icon' => ($icon ?? 'fa-trash)']) diff --git a/resources/views/components/button-save.blade.php b/resources/views/components/button-save.blade.php index 5cb4e756..deb88af5 100644 --- a/resources/views/components/button-save.blade.php +++ b/resources/views/components/button-save.blade.php @@ -1,3 +1 @@ - \ No newline at end of file +@include('components.button', ['class' => 'btn-success save ' . ($class ?? ''), 'icon' => 'fa-save', 'txt' => __('save')]) diff --git a/resources/views/components/button-submit.blade.php b/resources/views/components/button-submit.blade.php new file mode 100644 index 00000000..68b1537b --- /dev/null +++ b/resources/views/components/button-submit.blade.php @@ -0,0 +1,3 @@ + diff --git a/resources/views/components/datatable.blade.php b/resources/views/components/datatable.blade.php index cea926e2..823d04c1 100644 --- a/resources/views/components/datatable.blade.php +++ b/resources/views/components/datatable.blade.php @@ -2,9 +2,12 @@
@include('components.datatables.header') - {{$dataTable->table(['class'=>'table table-bordered table-hover table-striped w-100 mb-0'])}} + @if ($dataTable) + {{ $dataTable->table(['class'=>'table table-bordered table-hover table-striped w-100 mb-0']) }} + @endif
@push('js') - @include('components.js.datatable', ['route' => $route, 'model' => $model]) -@endpush \ No newline at end of file + @include('components.datatables.js.datatable') +@endpush + diff --git a/resources/views/components/datatables/buttons.blade.php b/resources/views/components/datatables/buttons.blade.php new file mode 100644 index 00000000..be58dc13 --- /dev/null +++ b/resources/views/components/datatables/buttons.blade.php @@ -0,0 +1,27 @@ +
+ + @if (!isset($with_print) || $with_print) + @include('components.datatables.buttons.print') + @endif + + @if (isset($with_exports) && $with_exports) + @include('components.datatables.buttons.excel') + @endif + + @if (isset($with_mailing) && $with_mailing) + @include('components.datatables.buttons.mail') + @endif + + @if (isset($with_buttons)) + @foreach ($with_buttons as $button) + @include($button) + @endforeach + @endif + + @if (isset($left_buttons)) + @foreach ($left_buttons as $button) + @include('components.button', ['class' => $button['class'] ?? null, 'icon' => $button['icon'] ?? null, 'txt' => $button['txt'] ?? null, 'id' => $button['id'] ?? null ]) + @endforeach + @endif + +
diff --git a/resources/views/components/datatables/buttons/add.blade.php b/resources/views/components/datatables/buttons/add.blade.php index 9ff67c85..cb27bfb4 100644 --- a/resources/views/components/datatables/buttons/add.blade.php +++ b/resources/views/components/datatables/buttons/add.blade.php @@ -1,11 +1,15 @@ - + @push('js') @endpush diff --git a/resources/views/components/datatables/buttons/colvis.blade.php b/resources/views/components/datatables/buttons/colvis.blade.php index a4796586..88f721f8 100644 --- a/resources/views/components/datatables/buttons/colvis.blade.php +++ b/resources/views/components/datatables/buttons/colvis.blade.php @@ -1,5 +1,5 @@ @push('js') @@ -7,14 +7,14 @@ var $colvis = $('#{{ $model }}-table-header .btn-colvis'); $colvis.on( 'click', function () { - var table = window.LaravelDataTables["{{ $model }}-table"]; - console.log(table); + var table = getDatatable("{{ $model }}"); + // console.log(table); - console.log(table.column(1).dataSrc()); + // console.log(table.column(1).dataSrc()); var header = table.column(1).header(); - console.log($(header).html()); + // console.log($(header).html()); var visible = table.column(1).visible(); - console.log(visible); + // console.log(visible); /* // var names = table.columns().names(); diff --git a/resources/views/components/datatables/buttons/download.blade.php b/resources/views/components/datatables/buttons/download.blade.php index eebba1e1..8668215a 100644 --- a/resources/views/components/datatables/buttons/download.blade.php +++ b/resources/views/components/datatables/buttons/download.blade.php @@ -1,6 +1,6 @@
- @include('components.datatables.buttons.exports') + @include('components.datatables.buttons') + @if (isset($add_buttons)) + @include($add_buttons) + @endif
- @include('components.datatables.buttons.add') + @if (isset($right_buttons)) + @foreach ($right_buttons as $button) + @include('components.button', ['class' => $button['class'] ?? null, 'icon' => $button['icon'] ?? null, 'txt' => $button['txt'] ?? null, 'id' => $button['id'] ?? null ]) + @endforeach + @endif + @if (!(isset($with_add) && (!$with_add))) + @include('components.datatables.buttons.add') + @endif
\ No newline at end of file diff --git a/resources/views/components/datatables/js/datatable.blade.php b/resources/views/components/datatables/js/datatable.blade.php new file mode 100644 index 00000000..502bfd86 --- /dev/null +++ b/resources/views/components/datatables/js/datatable.blade.php @@ -0,0 +1,70 @@ + + diff --git a/resources/views/components/datatables/search.blade.php b/resources/views/components/datatables/search.blade.php index 2c44e2f2..b0f783ab 100644 --- a/resources/views/components/datatables/search.blade.php +++ b/resources/views/components/datatables/search.blade.php @@ -1,9 +1,12 @@
+
@include('components.datatables.buttons.pageLength')
- + + + @if ((isset($with_filters) and $with_filters) || (isset($with_colvis) and $with_colvis))
@if (isset($with_filters) && $with_filters) @@ -14,14 +17,26 @@ @endif
@endif +
+@include('load.functions') + @push('js') @endpush \ No newline at end of file diff --git a/resources/views/load/appender.blade.php b/resources/views/load/appender.blade.php new file mode 100644 index 00000000..e6c48f99 --- /dev/null +++ b/resources/views/load/appender.blade.php @@ -0,0 +1,77 @@ +@if(!defined('LOAD_APPENDER')) + @push('js') + + @endpush + @php(define('LOAD_APPENDER', true)) +@endif \ No newline at end of file diff --git a/resources/views/load/autocomplete.blade.php b/resources/views/load/autocomplete.blade.php new file mode 100644 index 00000000..c54e923a --- /dev/null +++ b/resources/views/load/autocomplete.blade.php @@ -0,0 +1,18 @@ +@if(!defined('LOAD_AUTOCOMPLETE')) + @push('js') + + + @endpush + @php(define('LOAD_AUTOCOMPLETE', true)) +@endif \ No newline at end of file diff --git a/resources/views/load/chevron.blade.php b/resources/views/load/chevron.blade.php new file mode 100644 index 00000000..9142c8b0 --- /dev/null +++ b/resources/views/load/chevron.blade.php @@ -0,0 +1,16 @@ +@if(!defined('LOAD_CHEVRON')) + @push('scripts') + + + + @endpush + + @php(define('LOAD_CHEVRON', true)) +@endif \ No newline at end of file diff --git a/resources/views/load/datatables.blade.php b/resources/views/load/datatables.blade.php index 18bdf624..2ec1aa64 100644 --- a/resources/views/load/datatables.blade.php +++ b/resources/views/load/datatables.blade.php @@ -1,23 +1,45 @@ @if(!defined('LOAD_DATATABLES')) - @push('css') - + + @endpush @push('scripts') - + @include('boilerplate::load.moment') + + url: "/assets/plugins/datatables_lang/{{ \App::getLocale() }}.json" + }, + }); + function reloadDatatable(name) { + getDatatable(name).ajax.reload(null,false); + } + + function getDatatable(name) { + if (typeof(window.LaravelDataTables) !== 'undefined') { + return window.LaravelDataTables[name + "-table"]; + } else { + return false; + } + } + + function getDatatableState(name) { + var table = getDatatable("{{ $model }}"); + return table ? table.state.loaded() : false; + } + @endpush @php(define('LOAD_DATATABLES', true)) +@endif -@endif \ No newline at end of file +@push('scripts') + @if ($dataTable) + {{ $dataTable->scripts() }} + @endif +@endpush \ No newline at end of file diff --git a/resources/views/load/datepicker.blade.php b/resources/views/load/datepicker.blade.php new file mode 100644 index 00000000..f49704ca --- /dev/null +++ b/resources/views/load/datepicker.blade.php @@ -0,0 +1,30 @@ +@if(!defined('LOAD_DATEPICKER')) + @push('css') + + @endpush + @push('js') + @include('load.moment') + + + @endpush + @php(define('LOAD_DATEPICKER', true)) +@endif diff --git a/resources/views/load/editor.blade.php b/resources/views/load/editor.blade.php new file mode 100644 index 00000000..6acaca10 --- /dev/null +++ b/resources/views/load/editor.blade.php @@ -0,0 +1,15 @@ +@if(!defined('LOAD_EDITOR')) + + @include('load.editor.tinymce') + + @push('js') + + @endpush + + @php(define('LOAD_EDITOR', true)) +@endif diff --git a/resources/views/load/editor/tinymce.blade.php b/resources/views/load/editor/tinymce.blade.php new file mode 100644 index 00000000..b9b383a6 --- /dev/null +++ b/resources/views/load/editor/tinymce.blade.php @@ -0,0 +1,39 @@ +@if(!defined('LOAD_TINYMCE')) + @push('js') + + + @endpush + @php(define('LOAD_TINYMCE', true)) +@endif diff --git a/resources/views/load/fileinput.blade.php b/resources/views/load/fileinput.blade.php new file mode 100644 index 00000000..52e17d84 --- /dev/null +++ b/resources/views/load/fileinput.blade.php @@ -0,0 +1,25 @@ +@if(!defined('LOAD_FILEINPUT')) + @push('css') + + @endpush + @push('js') + + @if(App::getLocale() !== 'en') + + + @endif + @endpush + + @php(define('LOAD_FILEINPUT', true)) +@endif \ No newline at end of file diff --git a/resources/views/load/handlebars.blade.php b/resources/views/load/handlebars.blade.php new file mode 100644 index 00000000..16794de8 --- /dev/null +++ b/resources/views/load/handlebars.blade.php @@ -0,0 +1,74 @@ +@if(!defined('LOAD_HANDLEBARS')) + @push('scripts') + + @endpush + @php(define('LOAD_HANDLEBARS', true)) +@endif \ No newline at end of file diff --git a/resources/views/load/modal.blade.php b/resources/views/load/modal.blade.php new file mode 100644 index 00000000..e08fdc2a --- /dev/null +++ b/resources/views/load/modal.blade.php @@ -0,0 +1,114 @@ +@if(!defined('LOAD_MODAL')) + + @push('js') + + + @endpush + + @php(define('LOAD_MODAL', true)) +@endif \ No newline at end of file diff --git a/resources/views/load/moment.blade.php b/resources/views/load/moment.blade.php new file mode 100644 index 00000000..ad6a9bad --- /dev/null +++ b/resources/views/load/moment.blade.php @@ -0,0 +1,7 @@ +@if(!defined('LOAD_MOMENT')) + + + @php(define('LOAD_MOMENT', true)) +@endif \ No newline at end of file diff --git a/resources/views/load/nestable.blade.php b/resources/views/load/nestable.blade.php new file mode 100644 index 00000000..54c25a77 --- /dev/null +++ b/resources/views/load/nestable.blade.php @@ -0,0 +1,53 @@ +@if(!defined('LOAD_NESTABLE')) + @push('scripts') + + + + @endpush + @push('css') + + @endpush + @php(define('LOAD_NESTABLE', true)) +@endif \ No newline at end of file diff --git a/resources/views/load/select2.blade.php b/resources/views/load/select2.blade.php new file mode 100644 index 00000000..738a1c08 --- /dev/null +++ b/resources/views/load/select2.blade.php @@ -0,0 +1,18 @@ +@if(!defined('LOAD_SELECT2')) + @push('scripts') + + + + @endpush + @php(define('LOAD_SELECT2', true)) +@endif \ No newline at end of file diff --git a/resources/views/load/set_options.blade.php b/resources/views/load/set_options.blade.php new file mode 100644 index 00000000..e8f4caf1 --- /dev/null +++ b/resources/views/load/set_options.blade.php @@ -0,0 +1,25 @@ +@if(!defined('LOAD_SET_OPTIONS')) + @push('js') + + @endpush + @php(define('LOAD_SET_OPTIONS', true)) +@endif \ No newline at end of file diff --git a/resources/views/load/toggle.blade.php b/resources/views/load/toggle.blade.php new file mode 100644 index 00000000..59bd4f5b --- /dev/null +++ b/resources/views/load/toggle.blade.php @@ -0,0 +1,34 @@ +@if(!defined('LOAD_TOGGLE')) + @push('scripts') + + + + + @endpush + + @push('css') + + @endpush + @php(define('LOAD_TOGGLE', true)) +@endif \ No newline at end of file diff --git a/routes/Shop/Admin/Unities.php b/routes/Shop/Admin/Unities.php new file mode 100644 index 00000000..afede1fc --- /dev/null +++ b/routes/Shop/Admin/Unities.php @@ -0,0 +1,7 @@ +name('Unities.')->group(function () { + Route::any('getOptionsByFamily', 'UnityController@getOptionsByFamily')->name('getOptionsByFamily'); +}); + +Route::resource('Unities', 'UnityController'); diff --git a/routes/Shop/Admin/route.php b/routes/Shop/Admin/route.php index 18178673..4704297f 100644 --- a/routes/Shop/Admin/route.php +++ b/routes/Shop/Admin/route.php @@ -14,8 +14,8 @@ Route::middleware('auth')->prefix('Admin')->namespace('Admin')->name('Admin.')-> include __DIR__ . '/OrderPayments.php'; include __DIR__ . '/Orders.php'; include __DIR__ . '/PriceFamilies.php'; - include __DIR__ . '/PriceFamilyValues.php'; include __DIR__ . '/PriceGenerics.php'; include __DIR__ . '/Tags.php'; include __DIR__ . '/TagGroups.php'; + include __DIR__ . '/Unities.php'; });