little refactoring
This commit is contained in:
@@ -44,9 +44,9 @@ class ProducersDataTable extends DataTable
|
||||
Column::make('thumb')->title('')->searchable(false)->orderable(false)->width(40)->class('text-center'),
|
||||
Column::make('name')->title('Nom'),
|
||||
Column::make('tags2')->title('Tags')->searchable(false)->orderable(false),
|
||||
Column::make('merchandises_count')->title('#Mar')->class('text-right')->searchable(false),
|
||||
Column::make('tags_count')->title('#Tag')->class('text-right')->searchable(false),
|
||||
Column::make('images_count')->title('#Pho')->class('text-right')->searchable(false),
|
||||
Column::make('merchandises_count')->title('#Marchandises')->class('text-right')->searchable(false),
|
||||
// Column::make('tags_count')->title('#Tag')->class('text-right')->searchable(false),
|
||||
// Column::make('images_count')->title('#Pho')->class('text-right')->searchable(false),
|
||||
$this->makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -3,9 +3,8 @@
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use App\Datatables\Admin\Shop\MerchandisesDataTable;
|
||||
use App\Http\Requests\Admin\Shop\StoreMerchandisePost;
|
||||
use App\Repositories\Shop\Merchandises;
|
||||
use App\Repositories\Shop\Producers;
|
||||
use App\Repositories\Shop\TagGroups;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class MerchandiseController extends Controller
|
||||
@@ -17,13 +16,12 @@ class MerchandiseController extends Controller
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data['producers_list'] = Producers::getOptions();
|
||||
$data['tags_list'] = TagGroups::getTreeTags();
|
||||
$data = Merchandises::init();
|
||||
|
||||
return view('Admin.Shop.Merchandises.create', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
public function store(StoreMerchandisePost $request)
|
||||
{
|
||||
$data = $request->all();
|
||||
Merchandises::storeFull($data);
|
||||
@@ -33,14 +31,15 @@ class MerchandiseController extends Controller
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
return view('Admin.Shop.Merchandises.view', Merchandises::get($id));
|
||||
$data = Merchandises::get($id);
|
||||
|
||||
return view('Admin.Shop.Merchandises.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['merchandise'] = Merchandises::getFull($id);
|
||||
$data['producers_list'] = Producers::getOptions();
|
||||
$data['tags_list'] = TagGroups::getTreeTags();
|
||||
$data = Merchandises::init();
|
||||
$data['merchandise'] = Merchandises::getArray($id);
|
||||
|
||||
return view('Admin.Shop.Merchandises.edit', $data);
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ class OfferController extends Controller
|
||||
|
||||
public function previewVariation($id)
|
||||
{
|
||||
$data['variation'] = Variations::get($id)->toArray();
|
||||
$data['variation'] = Variations::getArray($id);
|
||||
|
||||
return view('Admin.Shop.Offers.partials.variation', $data);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ class ProducerController extends Controller
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data['tags_list'] = TagGroups::getTreeTags();
|
||||
$data = Producers::init();
|
||||
|
||||
return view('Admin.Shop.Producers.create', $data);
|
||||
}
|
||||
@@ -31,13 +31,15 @@ class ProducerController extends Controller
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
return view('Admin.Shop.Producers.view', Producers::get($id));
|
||||
$data = Producers::get($id);
|
||||
|
||||
return view('Admin.Shop.Producers.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data = Producers::init();
|
||||
$data['producer'] = Producers::getFull($id);
|
||||
$data['tags_list'] = TagGroups::getTreeTags();
|
||||
|
||||
return view('Admin.Shop.Producers.edit', $data);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use App\Datatables\Admin\Shop\VariationsDataTable;
|
||||
use App\Http\Requests\Admin\Shop\StoreVariationPost;
|
||||
use App\Repositories\Shop\Packages;
|
||||
use App\Repositories\Shop\Unities;
|
||||
use App\Repositories\Shop\Variations;
|
||||
@@ -24,22 +25,20 @@ class VariationController extends Controller
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data['packages'] = Packages::getOptions();
|
||||
$data['unities'] = Unities::getOptions();
|
||||
$data = Variations::init();
|
||||
|
||||
return view('Admin.Shop.Variations.create', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data = Variations::init();
|
||||
$data['variation'] = Variations::get($id);
|
||||
$data['packages'] = Packages::getOptions();
|
||||
$data['unities'] = Unities::getOptions();
|
||||
|
||||
return view('Admin.Shop.Variations.edit', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
public function store(StoreVariationPost $request)
|
||||
{
|
||||
$ret = Variations::store($request->all());
|
||||
|
||||
|
||||
21
app/Http/Requests/Admin/Shop/StoreArticleNaturePost.php
Normal file
21
app/Http/Requests/Admin/Shop/StoreArticleNaturePost.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Admin\Shop;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreArticleNaturePost extends FormRequest
|
||||
{
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'product_type' => 'required',
|
||||
'name' => 'required',
|
||||
];
|
||||
}
|
||||
}
|
||||
21
app/Http/Requests/Admin/Shop/StoreMerchandisesPost.php
Normal file
21
app/Http/Requests/Admin/Shop/StoreMerchandisesPost.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Admin\Shop;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreMerchandisePost extends FormRequest
|
||||
{
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'required',
|
||||
'producer_id' => 'required',
|
||||
];
|
||||
}
|
||||
}
|
||||
21
app/Http/Requests/Admin/Shop/StoreProducerPost.php
Normal file
21
app/Http/Requests/Admin/Shop/StoreProducerPost.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Admin\Shop;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreProducerPost extends FormRequest
|
||||
{
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'required',
|
||||
'alias' => 'required',
|
||||
];
|
||||
}
|
||||
}
|
||||
23
app/Http/Requests/Admin/Shop/StoreVariationPost.php
Normal file
23
app/Http/Requests/Admin/Shop/StoreVariationPost.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Admin\Shop;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreVariationPost extends FormRequest
|
||||
{
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'package_id' => 'required',
|
||||
'quantity' => 'required',
|
||||
'unity_id' => 'required',
|
||||
'weight' => 'required',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -3,12 +3,21 @@
|
||||
namespace App\Repositories\Shop;
|
||||
|
||||
use App\Models\Shop\Merchandise;
|
||||
use App\Traits\Model\Basic;
|
||||
use App\Repositories\Core\Tag;
|
||||
use App\Traits\Repository\Imageable;
|
||||
|
||||
class Merchandises
|
||||
{
|
||||
use Imageable;
|
||||
use Basic, Imageable;
|
||||
|
||||
public static function init()
|
||||
{
|
||||
return [
|
||||
'producers_list' => Producers::getOptions(),
|
||||
'tags_list' => TagGroups::getTreeTags(),
|
||||
];
|
||||
}
|
||||
|
||||
public static function autocomplete($str)
|
||||
{
|
||||
@@ -26,11 +35,6 @@ class Merchandises
|
||||
return Merchandise::with(['price_lists.price_list_values', 'price_lists.sale_channel'])->find($id);
|
||||
}
|
||||
|
||||
public static function getOptions()
|
||||
{
|
||||
return Merchandise::orderBy('name', 'asc')->get()->pluck('name', 'id')->toArray();
|
||||
}
|
||||
|
||||
public static function getStatus($status_id)
|
||||
{
|
||||
return self::getStatuses()[$status_id];
|
||||
@@ -41,36 +45,11 @@ class Merchandises
|
||||
return ['Actif', 'Suspendu', 'Invisible', 'Obsolete'];
|
||||
}
|
||||
|
||||
public static function getAll()
|
||||
{
|
||||
return Merchandise::orderBy('name', 'asc')->get();
|
||||
}
|
||||
|
||||
public static function get($id)
|
||||
{
|
||||
return Merchandise::find($id);
|
||||
}
|
||||
|
||||
public static function getFull($id)
|
||||
{
|
||||
$data = self::get($id)->toArray();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public static function getTags($id)
|
||||
{
|
||||
return self::get($id)->tags;
|
||||
}
|
||||
|
||||
public static function store($data)
|
||||
{
|
||||
$id = isset($data['id']) ? $data['id'] : false;
|
||||
$item = $id ? self::update($data, $id) : self::create($data);
|
||||
|
||||
return $item;
|
||||
}
|
||||
|
||||
public static function storeFull($data)
|
||||
{
|
||||
$images = $data['images'] ?? false;
|
||||
@@ -89,22 +68,9 @@ class Merchandises
|
||||
return Tag::storeTags($merchandise, $tags);
|
||||
}
|
||||
|
||||
public static function create($data)
|
||||
{
|
||||
return Merchandise::create($data);
|
||||
}
|
||||
|
||||
public static function update($data, $id = false)
|
||||
public static function getModel()
|
||||
{
|
||||
$id = $id ? $id : $data['id'];
|
||||
$item = self::get($id);
|
||||
$item->update($data);
|
||||
|
||||
return $item;
|
||||
}
|
||||
|
||||
public static function destroy($id)
|
||||
{
|
||||
return Merchandise::destroy($id);
|
||||
return Merchandise::query();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,11 +4,19 @@ namespace App\Repositories\Shop;
|
||||
|
||||
use App\Models\Shop\Producer;
|
||||
use App\Repositories\Core\Tag;
|
||||
use App\Traits\Model\Basic;
|
||||
use App\Traits\Repository\Imageable;
|
||||
|
||||
class Producers
|
||||
{
|
||||
use Imageable;
|
||||
use Basic, Imageable;
|
||||
|
||||
public static function init()
|
||||
{
|
||||
return [
|
||||
'tags_list' => TagGroups::getTreeTags(),
|
||||
];
|
||||
}
|
||||
|
||||
public static function autocomplete($str)
|
||||
{
|
||||
@@ -31,21 +39,6 @@ class Producers
|
||||
return Tag::storeTags($variety, $tags);
|
||||
}
|
||||
|
||||
public static function getOptions()
|
||||
{
|
||||
return Producer::orderBy('name', 'asc')->get()->pluck('name', 'id')->toArray();
|
||||
}
|
||||
|
||||
public static function getAll()
|
||||
{
|
||||
return Producer::orderBy('name', 'asc')->get();
|
||||
}
|
||||
|
||||
public static function get($id)
|
||||
{
|
||||
return Producer::find($id);
|
||||
}
|
||||
|
||||
public static function getFull($id)
|
||||
{
|
||||
$producer = self::get($id);
|
||||
@@ -73,27 +66,8 @@ class Producers
|
||||
return $producer;
|
||||
}
|
||||
|
||||
public static function store($data)
|
||||
public static function getModel()
|
||||
{
|
||||
return ($data['id'] ?? false) ? self::update($data) : self::create($data);
|
||||
}
|
||||
|
||||
public static function create($data)
|
||||
{
|
||||
return Producer::create($data);
|
||||
}
|
||||
|
||||
public static function update($data, $id = false)
|
||||
{
|
||||
$id = $id ? $id : $data['id'];
|
||||
$item = self::get($id);
|
||||
$item->update($data);
|
||||
|
||||
return $item;
|
||||
}
|
||||
|
||||
public static function destroy($id)
|
||||
{
|
||||
return Producer::destroy($id);
|
||||
return Producer::query();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,10 +3,20 @@
|
||||
namespace App\Repositories\Shop;
|
||||
|
||||
use App\Models\Shop\Variation;
|
||||
use App\Traits\Model\Basic;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class Variations
|
||||
{
|
||||
use Basic;
|
||||
|
||||
public static function init()
|
||||
{
|
||||
return [
|
||||
'packages' => Packages::getOptions(),
|
||||
'unities' => Unities::getOptions(),
|
||||
];
|
||||
}
|
||||
public static function autocomplete($str)
|
||||
{
|
||||
$data = Variation::where('name', 'LIKE', "%${str}%")->orderBy('name')->limit(30)->get()->pluck('name', 'id');
|
||||
@@ -36,7 +46,10 @@ class Variations
|
||||
|
||||
public static function getName($variation)
|
||||
{
|
||||
return $variation->package->value.' '.$variation->quantity.' '.($variation->unity->value ?? null).' '.Str::limit(strip_tags($variation->description), 15, ' (...)');
|
||||
return $variation->package->value.' '.
|
||||
$variation->quantity.' '.
|
||||
($variation->unity->value ?? null).' '.
|
||||
Str::limit(strip_tags($variation->description), 15, ' (...)');
|
||||
}
|
||||
|
||||
public static function buildName($data)
|
||||
@@ -44,29 +57,12 @@ class Variations
|
||||
return Packages::getName($data['package_id']).' '.$data['quantity'].' '.Unities::getName($data['unity_id']);
|
||||
}
|
||||
|
||||
public static function getAll()
|
||||
{
|
||||
return Variation::orderBy('value', 'asc')->get();
|
||||
}
|
||||
|
||||
public static function getFull($id)
|
||||
{
|
||||
return Variation::with(['package', 'unity'])->findOrFail($id);
|
||||
}
|
||||
|
||||
public static function get($id)
|
||||
{
|
||||
return Variation::findOrFail($id);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
$data['name'] = self::buildName($data);
|
||||
@@ -76,7 +72,7 @@ class Variations
|
||||
|
||||
public static function update($data, $id = false)
|
||||
{
|
||||
$id = isset($data['id']) ? $data['id'] : false;
|
||||
$id = $id ? $id : $data['id'];
|
||||
$variation = self::get($id);
|
||||
$data['name'] = self::buildName($data);
|
||||
$variation->update($data);
|
||||
@@ -84,8 +80,8 @@ class Variations
|
||||
return $variation;
|
||||
}
|
||||
|
||||
public static function destroy($id)
|
||||
public static function getModel()
|
||||
{
|
||||
return Variation::destroy($id);
|
||||
return Variation::query();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ return [
|
||||
'article_attribute_families' => [
|
||||
'title' => 'Familles d\'attributs',
|
||||
'description' => 'Gérer les familles d\'attributs',
|
||||
'name' => 'Famille d\'attributs',
|
||||
'add' => 'Ajouter une famille d\'attributs',
|
||||
'edit' => 'Editer une famille d\'attributs',
|
||||
'del' => 'Effacer une famille d\'attributs',
|
||||
@@ -145,6 +146,19 @@ return [
|
||||
'successdel' => 'Le colis a été correctement effacé',
|
||||
'confirmdelete' => 'Confirmez-vous la suppression du colis ?',
|
||||
],
|
||||
'merchandises' => [
|
||||
'title' => 'Marchandises',
|
||||
'name' => 'Marchandise',
|
||||
'description' => 'Gérer les marchandises',
|
||||
'add' => 'Ajouter une marchandise',
|
||||
'edit' => 'Editer une marchandise',
|
||||
'del' => 'Effacer une marchandise',
|
||||
'list' => 'Liste des marchandises',
|
||||
'successadd' => 'La marchandise a été correctement ajoutée',
|
||||
'successmod' => 'La marchandise a été correctement modifiée',
|
||||
'successdel' => 'La marchandise a été correctement effacée',
|
||||
'confirmdelete' => 'Confirmez-vous la suppression de la marchandise ?',
|
||||
],
|
||||
'offers' => [
|
||||
'title' => 'Offres',
|
||||
'name' => 'Offre',
|
||||
@@ -171,9 +185,23 @@ return [
|
||||
'successdel' => 'La déclinaison a été correctement effacée',
|
||||
'confirmdelete' => 'Confirmez-vous la suppression de la déclinaison ?',
|
||||
],
|
||||
'producers' => [
|
||||
'title' => 'Producteurs',
|
||||
'description' => 'Gérer les producteurs',
|
||||
'name' => 'Producteur',
|
||||
'add' => 'Ajouter un producteur',
|
||||
'edit' => 'Editer un producteur',
|
||||
'del' => 'Effacer un producteur',
|
||||
'list' => 'Liste des producteurs',
|
||||
'successadd' => 'Le producteur été correctement ajouté',
|
||||
'successmod' => 'Le producteur a été correctement modifié',
|
||||
'successdel' => 'Le producteur a été correctement effacé',
|
||||
'confirmdelete' => 'Confirmez-vous la suppression du producteur ?',
|
||||
],
|
||||
'prices' => [
|
||||
'title' => 'Prix',
|
||||
'description' => 'Gérer les prix',
|
||||
'name' => 'Prix',
|
||||
'add' => 'Ajouter un prix',
|
||||
'edit' => 'Editer un prix',
|
||||
'del' => 'Effacer un prix',
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
@extends('layout.index', [
|
||||
'title' => __('shop.merchandises.title'),
|
||||
'subtitle' => __('shop.merchandises.add'),
|
||||
'breadcrumb' => [__('shop.merchandises.title'), __('shop.merchandises.add')]
|
||||
'title' => __('shop.merchandises.title'),
|
||||
'subtitle' => __('shop.merchandises.add'),
|
||||
'breadcrumb' => [__('shop.merchandises.title'), __('shop.merchandises.add')],
|
||||
])
|
||||
|
||||
@section('content')
|
||||
{{ Form::open(['route' => 'Admin.Shop.Merchandises.store', 'id' => 'form', 'autocomplete' => 'off', 'files' => true]) }}
|
||||
@include('Admin.Shop.Merchandises.form')
|
||||
</form>
|
||||
@include('Admin.Shop.Merchandises.form')
|
||||
@endsection
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
@extends('layout.index', [
|
||||
'title' => __('Shop.merchandises.title'),
|
||||
'subtitle' => __('Shop.merchandises.edit'),
|
||||
'breadcrumb' => [__('Shop.merchandises.title'), __('Shop.merchandises.edit')]
|
||||
'title' => __('Shop.merchandises.title'),
|
||||
'subtitle' => __('Shop.merchandises.edit'),
|
||||
'breadcrumb' => [__('Shop.merchandises.title'), __('Shop.merchandises.edit')],
|
||||
])
|
||||
|
||||
@section('content')
|
||||
{{ Form::open(['route' => 'Admin.Shop.Merchandises.store', 'id' => 'form', 'autocomplete' => 'off', 'files' => true]) }}
|
||||
<input type="hidden" name="id" id="id" value="{{ $merchandise['id'] }}">
|
||||
@include('Admin.Shop.Merchandises.form')
|
||||
</form>
|
||||
@include('Admin.Shop.Merchandises.form')
|
||||
@endsection
|
||||
|
||||
@@ -1,75 +1,88 @@
|
||||
{{ Form::open([
|
||||
'route' => 'Admin.Shop.Merchandises.store',
|
||||
'id' => 'merchandise-form',
|
||||
'autocomplete' => 'off',
|
||||
'files' => true,
|
||||
]) }}
|
||||
<input type="hidden" name="id" id="id" value="{{ $merchandise['id'] ?? false }}">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="row mb-3">
|
||||
<div class="col-6">
|
||||
{{ Form::label('name', 'Nom') }}
|
||||
@include('components.form.input', ['name' => 'name', 'value' => $merchandise['name'] ?? null, 'required' => true])
|
||||
</div>
|
||||
<div class="col-6">
|
||||
{{ Form::label('producers', 'Producteur') }}
|
||||
@include('components.form.select', [
|
||||
'name' => 'producer_id',
|
||||
'list' => $producers_list ?? [],
|
||||
'value' => $merchandise['provider_id'] ?? null,
|
||||
'class' => 'select2 form-control',
|
||||
'with_empty' => '',
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="row mb-3">
|
||||
<div class="col-6">
|
||||
@include('components.form.input', [
|
||||
'name' => 'name',
|
||||
'value' => $merchandise['name'] ?? null,
|
||||
'required' => true,
|
||||
'label' => 'Nom',
|
||||
])
|
||||
</div>
|
||||
<div class="col-6">
|
||||
@include('components.form.select', [
|
||||
'name' => 'producer_id',
|
||||
'list' => $producers_list ?? [],
|
||||
'value' => $merchandise['provider_id'] ?? null,
|
||||
'class' => 'select2 form-control',
|
||||
'with_empty' => '',
|
||||
'required' => true,
|
||||
'label' => __('Shop.producers.name'),
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-12">
|
||||
{{ Form::label('tags', 'Tags') }}
|
||||
@include('components.form.selects.select-tree', [
|
||||
'name' => 'tags[]',
|
||||
'list' => $tags_list,
|
||||
'values' => $merchandise['tags'] ?? null,
|
||||
'class' => 'select2 form-control',
|
||||
'multiple' => true
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-12">
|
||||
@include('components.form.selects.select-tree', [
|
||||
'name' => 'tags[]',
|
||||
'list' => $tags_list,
|
||||
'values' => $merchandise['tags'] ?? null,
|
||||
'class' => 'select2 form-control',
|
||||
'multiple' => true,
|
||||
'label' => 'Tags',
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-12">
|
||||
{{ Form::label('description', 'Description') }}
|
||||
@include('components.form.textarea', [
|
||||
'name' => 'description',
|
||||
'value' => $merchandise['description'] ?? null,
|
||||
'class' => 'editor',
|
||||
'rows' => 5,
|
||||
'required' => false,
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-12">
|
||||
@include('components.form.textarea', [
|
||||
'name' => 'description',
|
||||
'value' => $merchandise['description'] ?? null,
|
||||
'class' => 'editor',
|
||||
'rows' => 5,
|
||||
'required' => false,
|
||||
'description' => 'Description',
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-12">
|
||||
{{ Form::label('description', 'Son +') }}
|
||||
@include('components.form.textarea', [
|
||||
'name' => 'plus',
|
||||
'value' => $merchandise['plus'] ?? null,
|
||||
'class' => 'editor',
|
||||
'rows' => 5,
|
||||
'required' => false,
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-12">
|
||||
@include('components.form.textarea', [
|
||||
'name' => 'plus',
|
||||
'value' => $merchandise['plus'] ?? null,
|
||||
'class' => 'editor',
|
||||
'rows' => 5,
|
||||
'required' => false,
|
||||
'label' => 'Son +',
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
@include('components.uploader.widget', [
|
||||
'load_url' => route('Admin.Shop.Merchandises.getImages', ['id' => $merchandise['id'] ?? false]),
|
||||
'delete_url' => route('Admin.Botanic.Varieties.deleteImage'),
|
||||
'name' => 'images',
|
||||
])
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
@include('components.uploader.widget', [
|
||||
'load_url' => route('Admin.Shop.Merchandises.getImages', ['id' => $merchandise['id'] ?? false]),
|
||||
'delete_url' => route('Admin.Botanic.Varieties.deleteImage'),
|
||||
'name' => 'images',
|
||||
])
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
|
||||
@include('components.save')
|
||||
|
||||
<x-save />
|
||||
@include('load.form.appender')
|
||||
@include('load.form.editor')
|
||||
@include('load.form.save')
|
||||
@@ -79,12 +92,12 @@
|
||||
@include('boilerplate::load.tinymce')
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
$(function() {
|
||||
initSelect2();
|
||||
initChevron();
|
||||
initEditor();
|
||||
initSaveForm();
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
<script>
|
||||
$(function() {
|
||||
initSelect2();
|
||||
initChevron();
|
||||
initEditor();
|
||||
initSaveForm('merchandise-form');
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{{ Form::open(['route' => 'Admin.Shop.Offers.store', 'id' => 'offer-form', 'autocomplete' => 'off']) }}
|
||||
<input type="hidden" name="id" value="{{ $offer['id'] }}">
|
||||
<input type="hidden" name="id" value="{{ $offer['id'] ?? false }}">
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-8">
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
@extends('layout.index', [
|
||||
'title' => __('shop.producers.title'),
|
||||
'subtitle' => __('shop.producers.add'),
|
||||
'breadcrumb' => [__('shop.producers.title'), __('shop.producers.add')]
|
||||
'title' => __('shop.producers.title'),
|
||||
'subtitle' => __('shop.producers.add'),
|
||||
'breadcrumb' => [__('shop.producers.title'), __('shop.producers.add')],
|
||||
])
|
||||
|
||||
@section('content')
|
||||
{{ Form::open(['route' => 'Admin.Shop.Producers.store', 'id' => 'form', 'autocomplete' => 'off', 'files' => true]) }}
|
||||
@include('Admin.Shop.Producers.form')
|
||||
</form>
|
||||
@include('Admin.Shop.Producers.form')
|
||||
@endsection
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
@extends('layout.index', [
|
||||
'title' => __('Shop.producers.title'),
|
||||
'subtitle' => __('Shop.producers.edit'),
|
||||
'breadcrumb' => [__('Shop.producers.title'), __('Shop.producers.edit')]
|
||||
'title' => __('Shop.producers.title'),
|
||||
'subtitle' => __('Shop.producers.edit'),
|
||||
'breadcrumb' => [__('Shop.producers.title'), __('Shop.producers.edit')],
|
||||
])
|
||||
|
||||
@section('content')
|
||||
{{ Form::open(['route' => 'Admin.Shop.Producers.store', 'id' => 'form', 'autocomplete' => 'off', 'files' => true]) }}
|
||||
<input type="hidden" name="id" id="id" value="{{ $producer['id'] }}">
|
||||
@include('Admin.Shop.Producers.form')
|
||||
</form>
|
||||
@include('Admin.Shop.Producers.form')
|
||||
@endsection
|
||||
|
||||
@@ -1,55 +1,67 @@
|
||||
{{ Form::open(['route' => 'Admin.Shop.Producers.store', 'id' => 'form', 'autocomplete' => 'off', 'files' => true]) }}
|
||||
<input type="hidden" name="id" id="id" value="{{ $producer['id'] ?? false }}">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="row mb-3">
|
||||
<div class="col-6">
|
||||
{{ Form::label('name', 'Nom') }}
|
||||
@include('components.form.input', ['name' => 'name', 'value' => $producer['name'] ?? null, 'required' => true])
|
||||
</div>
|
||||
<div class="col-6">
|
||||
{{ Form::label('name', 'Alias') }}
|
||||
@include('components.form.input', ['name' => 'alias', 'value' => $producer['alias'] ?? null, 'required' => true])
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="row mb-3">
|
||||
<div class="col-6">
|
||||
@include('components.form.input', [
|
||||
'name' => 'name',
|
||||
'value' => $producer['name'] ?? null,
|
||||
'required' => true,
|
||||
'label' => 'Nom',
|
||||
])
|
||||
</div>
|
||||
<div class="col-6">
|
||||
@include('components.form.input', [
|
||||
'name' => 'alias',
|
||||
'value' => $producer['alias'] ?? null,
|
||||
'required' => true,
|
||||
'label' => 'Alias',
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-12">
|
||||
{{ Form::label('tags', 'Tags') }}
|
||||
@include('components.form.selects.select-tree', [
|
||||
'name' => 'tags[]',
|
||||
'list' => $tags_list,
|
||||
'values' => $producer['tags'] ?? null,
|
||||
'class' => 'select2 form-control',
|
||||
'multiple' => true
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-12">
|
||||
@include('components.form.selects.select-tree', [
|
||||
'name' => 'tags[]',
|
||||
'list' => $tags_list,
|
||||
'values' => $producer['tags'] ?? null,
|
||||
'class' => 'select2 form-control',
|
||||
'multiple' => true,
|
||||
'label' => 'Tags',
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-12">
|
||||
{{ Form::label('description', 'Description') }}
|
||||
@include('components.form.textarea', [
|
||||
'name' => 'description',
|
||||
'value' => $producer['description'] ?? null,
|
||||
'class' => 'editor',
|
||||
'rows' => 5,
|
||||
'required' => false,
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-12">
|
||||
@include('components.form.textarea', [
|
||||
'name' => 'description',
|
||||
'value' => $producer['description'] ?? null,
|
||||
'class' => 'editor',
|
||||
'rows' => 5,
|
||||
'required' => false,
|
||||
'label' => 'Description',
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
@include('components.uploader.widget', [
|
||||
'load_url' => route('Admin.Shop.Merchandises.getImages', ['id' => $producer['id'] ?? false]),
|
||||
'delete_url' => route('Admin.Botanic.Varieties.deleteImage'),
|
||||
'name' => 'images',
|
||||
])
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
@include('components.uploader.widget', [
|
||||
'load_url' => route('Admin.Shop.Merchandises.getImages', ['id' => $producer['id'] ?? false]),
|
||||
'delete_url' => route('Admin.Botanic.Varieties.deleteImage'),
|
||||
'name' => 'images',
|
||||
])
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{{ form::close() }}
|
||||
|
||||
@include('components.save')
|
||||
<x-save />
|
||||
|
||||
@include('load.form.appender')
|
||||
@include('load.form.editor')
|
||||
@@ -60,12 +72,12 @@
|
||||
@include('boilerplate::load.tinymce')
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
$(function() {
|
||||
initSelect2();
|
||||
initChevron();
|
||||
initEditor();
|
||||
initSaveForm();
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
<script>
|
||||
$(function() {
|
||||
initSelect2();
|
||||
initChevron();
|
||||
initEditor();
|
||||
initSaveForm();
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
@extends('layout.index', [
|
||||
'title' => __('shop.producers.title'),
|
||||
'subtitle' => __('shop.producers.list'),
|
||||
'breadcrumb' => [__('Shop.producers.title')]
|
||||
'title' => __('shop.producers.title'),
|
||||
'subtitle' => __('shop.producers.list'),
|
||||
'breadcrumb' => [__('Shop.producers.title')],
|
||||
])
|
||||
|
||||
@section('content')
|
||||
@component('components.card')
|
||||
@include('components.datatable', ['route' => route('Admin.Shop.Producers.index'), 'model' => 'producers'])
|
||||
@endcomponent
|
||||
@component('components.card')
|
||||
@include('components.datatable', [
|
||||
'route' => route('Admin.Shop.Producers.index'),
|
||||
'model' => 'producers',
|
||||
])
|
||||
@endcomponent
|
||||
@endsection
|
||||
|
||||
|
||||
@@ -1,15 +1,9 @@
|
||||
@extends('layout.index', [
|
||||
'title' => __('shop.variations.title'),
|
||||
'subtitle' => __('shop.variations.add'),
|
||||
'breadcrumb' => [__('shop.variations.title'), __('shop.variations.index')]
|
||||
'title' => __('shop.variations.title'),
|
||||
'subtitle' => __('shop.variations.add'),
|
||||
'breadcrumb' => [__('shop.variations.title'), __('shop.variations.index')],
|
||||
])
|
||||
|
||||
@include('boilerplate::load.fileinput')
|
||||
|
||||
@section('content')
|
||||
|
||||
{{ Form::open(['route' => 'Admin.Shop.Variations.store', 'id' => 'variation-form', 'autocomplete' => 'off']) }}
|
||||
@include('Admin.Shop.Variations.form')
|
||||
</form>
|
||||
|
||||
@include('Admin.Shop.Variations.form')
|
||||
@endsection
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
@extends('layout.index', [
|
||||
'title' => __('shop.variations.title'),
|
||||
'subtitle' => __('shop.variations.edit'),
|
||||
'breadcrumb' => [__('shop.variations.title'), __('shop.variations.index')]
|
||||
'title' => __('shop.variations.title'),
|
||||
'subtitle' => __('shop.variations.edit'),
|
||||
'breadcrumb' => [__('shop.variations.title'), __('shop.variations.index')],
|
||||
])
|
||||
|
||||
@section('content')
|
||||
{{ Form::open(['route' => 'Admin.Shop.Variations.store', 'id' => 'variation-form', 'autocomplete' => 'off']) }}
|
||||
<input type="hidden" name="id" value="{{ $variation['id'] }}">
|
||||
@include('Admin.Shop.Variations.form')
|
||||
</form>
|
||||
@include('Admin.Shop.Variations.form')
|
||||
@endsection
|
||||
|
||||
@@ -1,43 +1,73 @@
|
||||
{{ Form::open(['route' => 'Admin.Shop.Variations.store', 'id' => 'variation-form', 'autocomplete' => 'off']) }}
|
||||
<input type="hidden" name="id" value="{{ $variation['id'] ?? false }}">
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-6">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
{{ Form::label('package_id', 'Package') }}
|
||||
@include('components.form.select', ['name' => 'package_id', 'list' => $packages ?? [], 'value' => $variation['package_id'] ?? false, 'required' => true, 'with_empty' => ''])
|
||||
</div>
|
||||
<div class="col-2">
|
||||
{{ Form::label('quantity', 'Quantité') }}
|
||||
@include('components.form.input', ['name' => 'quantity', 'value' => $variation['quantity'] ?? false, 'required' => true])
|
||||
</div>
|
||||
<div class="col-4">
|
||||
{{ Form::label('unity_id', 'Unité') }}
|
||||
@include('components.form.select', ['name' => 'unity_id', 'list' => $unities ?? [], 'value' => $variation['unity_id'] ?? false, 'required' => false, 'with_empty' => ''])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-1">
|
||||
{{ Form::label('weight', 'Poids') }}
|
||||
@include('components.form.input', ['name' => 'weight', 'value' => $variation['weight'] ?? false, 'required' => true])
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
@include('components.form.select', [
|
||||
'name' => 'package_id',
|
||||
'list' => $packages ?? [],
|
||||
'value' => $variation['package_id'] ?? false,
|
||||
'required' => true,
|
||||
'with_empty' => '',
|
||||
'label' => 'Package',
|
||||
])
|
||||
</div>
|
||||
<div class="col-2">
|
||||
@include('components.form.input', [
|
||||
'name' => 'quantity',
|
||||
'value' => $variation['quantity'] ?? false,
|
||||
'required' => true,
|
||||
'label' => 'Quantité',
|
||||
])
|
||||
</div>
|
||||
<div class="col-4">
|
||||
@include('components.form.select', [
|
||||
'name' => 'unity_id',
|
||||
'list' => $unities ?? [],
|
||||
'value' => $variation['unity_id'] ?? false,
|
||||
'required' => true,
|
||||
'with_empty' => '',
|
||||
'label' => 'Unité',
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-1">
|
||||
@include('components.form.input', [
|
||||
'name' => 'weight',
|
||||
'value' => $variation['weight'] ?? false,
|
||||
'required' => true,
|
||||
'label' => 'Poids',
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-12">
|
||||
{{ Form::label('description', 'Description') }}
|
||||
@include('components.form.textarea', ['name' => 'description', 'value' => isset($variation['description']) ? $variation['description'] : null, 'class' => 'editor', 'required' => false])
|
||||
</div>
|
||||
<div class="col-12">
|
||||
@include('components.form.textarea', [
|
||||
'name' => 'description',
|
||||
'value' => $variation['description'] ?? null,
|
||||
'class' => 'editor',
|
||||
'required' => false,
|
||||
'label' => 'Description',
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
{{ form::close() }}
|
||||
|
||||
@include('components.save')
|
||||
<x-save />>
|
||||
|
||||
@include('load.form.editor')
|
||||
@include('load.form.save')
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
$(function() {
|
||||
initEditor();
|
||||
initSaveForm('#variation-form')
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
{!! JsValidator::formRequest('App\Http\Requests\Admin\Shop\StoreVariationPost', '#variation-form') !!}
|
||||
<script>
|
||||
$(function() {
|
||||
initEditor();
|
||||
initSaveForm('#variation-form')
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
Reference in New Issue
Block a user