diff --git a/app/Console/Commands/checkdb.php b/app/Console/Commands/checkdb.php deleted file mode 100644 index 7fc6851b..00000000 --- a/app/Console/Commands/checkdb.php +++ /dev/null @@ -1,132 +0,0 @@ -get(); - foreach ($varieties as $variety) { - $specie_name = trim($variety->specie_name); - /* - $specie = Specie::firstOrCreate(['name' => $specie_name]); - if ($specie) { - $variety->specie_id = $specie->id; - $variety->save(); - } - */ - dump($specie_name); - } -/* - - $species = Specie::all(); - foreach ($species as $specie) { - $specie->name = trim($specie->name); - $specie->save(); - } - - $varieties = Variety::all(); - foreach ($varieties as $variety) { - $variety->name = trim($variety->name); - $variety->save(); - } -*/ -/* - $varieties = Variety::all(); - foreach ($varieties as $variety) { - $specie_name = $variety->specie; - dump($specie_name); - if (!empty($specie_name)) { - $specie = Specie::byName($specie_name)->first(); - if (isset($specie->name)) - { - dump($specie->name); - $variety->specie_id = $specie->id; - $variety->save(); - } else { - dump("non trouvé"); - } - } else { - dump("Aucune espèce"); - } - } -*/ -/* - $species = Specie::all(); - foreach ($species as $specie) { - $genre_name = $specie->genre; - dump($genre_name); - if (!empty($genre_name)) { - $genre = Genre::byName($genre_name)->first(); - if (isset($genre->name)) - { - dump($genre->name); - $specie->genre_id = $genre->id; - $specie->save(); - } else { - dump("non trouvé"); - } - } else { - dump("Aucun genre"); - } - } -*/ -/* - $genres = Genre::all(); - foreach ($genres as $genre) { - $family_name = $genre->family; - dump($family_name); - if (!empty($family_name)) { - $family = Family::byName($family_name)->first(); - if (isset($family->name)) - { - dump($family->name); - $genre->family_id = $family->id; - $genre->save(); - } else { - dump("non trouvé"); - } - } else { - dump("Aucune famille"); - } - } - */ - } -} diff --git a/app/Console/Commands/migrate.php b/app/Console/Commands/migrate.php deleted file mode 100644 index 773a786c..00000000 --- a/app/Console/Commands/migrate.php +++ /dev/null @@ -1,117 +0,0 @@ -name = trim($specie->name); - $specie->save(); - } - - $varieties = Variety::all(); - foreach ($varieties as $variety) { - $variety->name = trim($variety->name); - $variety->save(); - } - -/* - $varieties = Variety::all(); - foreach ($varieties as $variety) { - $specie_name = $variety->specie; - dump($specie_name); - if (!empty($specie_name)) { - $specie = Specie::byName($specie_name)->first(); - if (isset($specie->name)) - { - dump($specie->name); - $variety->specie_id = $specie->id; - $variety->save(); - } else { - dump("non trouvé"); - } - } else { - dump("Aucune espèce"); - } - } -*/ -/* - $species = Specie::all(); - foreach ($species as $specie) { - $genre_name = $specie->genre; - dump($genre_name); - if (!empty($genre_name)) { - $genre = Genre::byName($genre_name)->first(); - if (isset($genre->name)) - { - dump($genre->name); - $specie->genre_id = $genre->id; - $specie->save(); - } else { - dump("non trouvé"); - } - } else { - dump("Aucun genre"); - } - } -*/ -/* - $genres = Genre::all(); - foreach ($genres as $genre) { - $family_name = $genre->family; - dump($family_name); - if (!empty($family_name)) { - $family = Family::byName($family_name)->first(); - if (isset($family->name)) - { - dump($family->name); - $genre->family_id = $family->id; - $genre->save(); - } else { - dump("non trouvé"); - } - } else { - dump("Aucune famille"); - } - } - */ - } -} diff --git a/app/Exports/Botanic/Families.php b/app/Exports/Botanic/FamiliesExport.php similarity index 100% rename from app/Exports/Botanic/Families.php rename to app/Exports/Botanic/FamiliesExport.php diff --git a/app/Exports/Botanic/Genres.php b/app/Exports/Botanic/GenresExport.php similarity index 100% rename from app/Exports/Botanic/Genres.php rename to app/Exports/Botanic/GenresExport.php diff --git a/app/Exports/Botanic/Species.php b/app/Exports/Botanic/SpeciesExport.php similarity index 100% rename from app/Exports/Botanic/Species.php rename to app/Exports/Botanic/SpeciesExport.php diff --git a/app/Exports/Botanic/Varieties.php b/app/Exports/Botanic/VarietiesExport.php similarity index 100% rename from app/Exports/Botanic/Varieties.php rename to app/Exports/Botanic/VarietiesExport.php diff --git a/app/Http/Controllers/Shop/Admin/ArticleAttributeFamilyController.php b/app/Http/Controllers/Shop/Admin/ArticleAttributeFamilyController.php deleted file mode 100644 index 98a0a7bb..00000000 --- a/app/Http/Controllers/Shop/Admin/ArticleAttributeFamilyController.php +++ /dev/null @@ -1,56 +0,0 @@ -render('Shop.Admin.ArticleAttributeFamilies.list'); - } - - public function getDatatable(Request $request) - { - return ArticleAttributeFamilies::getTables($request->all()); - } - - public function create() - { - return view('Shop.Admin.ArticleAttributeFamilies.create'); - } - - public function store(Request $request) - { - $ret = ArticleAttributeFamilies::store($request->all()); - return redirect()->route('Shop.Admin.ArticleAttributeFamilies.index'); - } - - public function show($id) - { - $data = ArticleAttributeFamilies::get($id); - return view('Shop.Admin.ArticleAttributeFamilies.view', $data); - } - - public function edit($id) - { - $data = ArticleAttributeFamilies::get($id); - return view('Shop.Admin.ArticleAttributeFamilies.edit', $data); - } - - public function update(Request $request) - { - // - } - - public function destroy($id) - { - return ArticleAttributeFamilies::destroy($id); - } - -} diff --git a/app/Http/Controllers/Shop/Admin/HomeController.php b/app/Http/Controllers/Shop/Admin/HomeController.php index 9d7a6ccb..9507f89b 100644 --- a/app/Http/Controllers/Shop/Admin/HomeController.php +++ b/app/Http/Controllers/Shop/Admin/HomeController.php @@ -1,6 +1,6 @@ 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 new file mode 100644 index 00000000..62801e47 --- /dev/null +++ b/app/Http/Controllers/Shop/Admin/PriceFamilyValueController.php @@ -0,0 +1,64 @@ +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/PriceGenericController.php b/app/Http/Controllers/Shop/Admin/PriceGenericController.php index 283df252..a4252822 100644 --- a/app/Http/Controllers/Shop/Admin/PriceGenericController.php +++ b/app/Http/Controllers/Shop/Admin/PriceGenericController.php @@ -9,49 +9,52 @@ use App\Models\Shop\PriceGeneric; use App\Repositories\Shop\PriceGenerics; use App\Repositories\Shop\PriceGenericCategories; use App\Repositories\Shop\Taxes; +use App\Repositories\Shop\Unities; use App\DataTables\Shop\PriceGenericsDataTable; class PriceGenericController extends Controller { - public function index(PriceGenericsDataTable $dataTable) - { - return $dataTable->render('Shop.Admin.PriceGenerics.list'); - } + public function index(PriceGenericsDataTable $dataTable) + { + return $dataTable->render('Shop.Admin.PriceGenerics.list'); + } - public function getDatatable(Request $request) - { - return PriceGenerics::getTables($request->all()); - } + public function getDatatable(Request $request) + { + return PriceGenerics::getTables($request->all()); + } - public function create() - { - $data['taxes'] = Taxes::getOptions(); - $data['categories'] = PriceGenericCategories::getOptions(); - return view('Shop.Admin.PriceGenerics.create',$data); - } + public function create() + { + $data['unities'] = Unities::getOptions(); + $data['taxes'] = Taxes::getOptions(); + $data['categories'] = PriceGenericCategories::getOptions(); + return view('Shop.Admin.PriceGenerics.create',$data); + } - public function edit($id) - { - $data['generic'] = PriceGenerics::get($id)->toArray(); - $data['taxes'] = Taxes::getOptions(); - $data['categories'] = PriceGenericCategories::getOptions(); - return view('Shop.Admin.PriceGenerics.edit', $data); - } + public function edit($id) + { + $data['generic'] = PriceGenerics::get($id)->toArray(); + $data['unities'] = Unities::getOptions(); + $data['taxes'] = Taxes::getOptions(); + $data['categories'] = PriceGenericCategories::getOptions(); + return view('Shop.Admin.PriceGenerics.edit', $data); + } - public function store(Request $request) - { - $ret = PriceGenerics::store($request->all()); - return redirect()->route('Shop.Admin.PriceGenerics.index'); - } + public function store(Request $request) + { + $ret = PriceGenerics::store($request->all()); + return redirect()->route('Shop.Admin.PriceGenerics.index'); + } - public function show($id) - { - $data = PriceGenerics::get($id); - return view('Shop.Admin.PriceGenerics.view', $data); - } + public function show($id) + { + $data = PriceGenerics::get($id); + return view('Shop.Admin.PriceGenerics.view', $data); + } - public function destroy($id) - { - return PriceGenerics::destroy($id); - } + public function destroy($id) + { + return PriceGenerics::destroy($id); + } } diff --git a/app/Http/Controllers/Shop/Admin/UnityController.php b/app/Http/Controllers/Shop/Admin/UnityController.php new file mode 100644 index 00000000..d3988574 --- /dev/null +++ b/app/Http/Controllers/Shop/Admin/UnityController.php @@ -0,0 +1,64 @@ +render('Shop.Admin.UnityValues.list', $data); + } + + public function getDatatable(Request $request) + { + return UnityValues::getTables($request->all()); + } + + public function getOptionsByFamily(Request $request) + { + $id = $request->input('family_id'); + return response()->json(UnityValues::getSelectByFamily($id)); + } + + public function create() + { + return view('Shop.Admin.UnityValues.create'); + } + + public function store(Request $request) + { + $ret = UnityValues::store($request->all()); + return redirect()->route('Shop.Admin.UnityValues.index'); + } + + public function show($id) + { + $data = UnityValues::get($id); + return view('Shop.Admin.UnityValues.view', $data); + } + + public function edit($id) + { + $data = UnityValues::get($id); + return view('Shop.Admin.UnityValues.edit', $data); + } + + public function update(Request $request) + { + // + } + + public function destroy($id) + { + return UnityValues::destroy($id); + } + +} diff --git a/app/Menu/Shop.php b/app/Menu/Shop.php index 1e35c72f..ec30e15c 100644 --- a/app/Menu/Shop.php +++ b/app/Menu/Shop.php @@ -19,14 +19,14 @@ class Shop ->activeIfRoute(['Shop.Admin.Categories.*'])->order(2); $menu->addTo('shop', 'Familles d\'articles', [ 'route' => 'Shop.Admin.ArticleFamilies.index', 'permission' => 'backend_access' ]) ->activeIfRoute(['Shop.Admin.ArticleFamilies.*'])->order(3); - $menu->addTo('shop', 'Familles d\'attributs', [ 'route' => 'Shop.Admin.ArticleAttributeFamilies.index', 'permission' => 'backend_access' ]) - ->activeIfRoute(['Shop.Admin.ArticleAttributeFamilies.*'])->order(4); +/* $menu->addTo('shop', 'Attributs', [ 'route' => 'Shop.Admin.ArticleAttributeValues.index', 'permission' => 'backend_access' ]) - ->activeIfRoute(['Shop.Admin.ArticleAttributeValues.*'])->order(5); + ->activeIfRoute(['Shop.Admin.ArticleAttributeValues.*'])->order(4); +*/ $menu->addTo('shop', 'Familles de tags', [ 'route' => 'Shop.Admin.TagGroups.index', 'permission' => 'backend_access' ]) - ->activeIfRoute(['Shop.Admin.TagGroups.*'])->order(6); + ->activeIfRoute(['Shop.Admin.TagGroups.*'])->order(5); $menu->addTo('shop', 'Tags', [ 'route' => 'Shop.Admin.Tags.index', 'permission' => 'backend_access' ]) - ->activeIfRoute(['Shop.Admin.Tags.*'])->order(7); + ->activeIfRoute(['Shop.Admin.Tags.*'])->order(6); /* $menu->addTo('shop', 'Réductions', [ 'route' => 'Shop.Admin.ArticleAttributeValues.index', 'permission' => 'backend_access' ]) diff --git a/app/Models/Shop/Price.php b/app/Models/Shop/Price.php index b6758c1d..75acd42c 100644 --- a/app/Models/Shop/Price.php +++ b/app/Models/Shop/Price.php @@ -22,9 +22,14 @@ class Price extends Model return $this->belongsTo('App\Models\Shop\PriceFamily'); } - public function price() + public function generic() { - return $this->morphTo(); + return $this->belongsTo('App\Models\Shop\PriceGeneric', 'price_generic_id'); + } + + public function generic_prices() + { + } public function scopeByArticle($query, $id) @@ -37,4 +42,14 @@ class Price extends Model return $query->where('price_family_id', $id); } + public function scopeGeneric($query) + { + return $query->whereNotNull('price_generic_id'); + } + + public function scopeNotGeneric($query) + { + return $query->whereNull('price_generic_id'); + } + } \ No newline at end of file diff --git a/app/Models/Shop/PriceFamilyValue.php b/app/Models/Shop/PriceFamilyValue.php index b5446b63..64684d0c 100644 --- a/app/Models/Shop/PriceFamilyValue.php +++ b/app/Models/Shop/PriceFamilyValue.php @@ -7,7 +7,7 @@ use Illuminate\Database\Eloquent\Model; class PriceFamilyValue extends Model { protected $guarded = ['id']; - protected $table = 'shop_price_familiy_values'; + protected $table = 'shop_price_family_values'; public function price_family() { diff --git a/app/Models/Shop/PriceGeneric.php b/app/Models/Shop/PriceGeneric.php index 0ae25e7e..82a96dfa 100644 --- a/app/Models/Shop/PriceGeneric.php +++ b/app/Models/Shop/PriceGeneric.php @@ -7,39 +7,34 @@ use Znck\Eloquent\Traits\BelongsToThrough; class PriceGeneric extends Model { - use BelongsToThrough; + use BelongsToThrough; - protected $guarded = ['id']; - protected $table = 'shop_price_generics'; + protected $guarded = ['id']; + protected $table = 'shop_price_generics'; - public function category() - { - return $this->hasOne('App\Models\Shop\PriceGenericCategory','id','category_id'); - } + public function category() + { + return $this->hasOne('App\Models\Shop\PriceGenericCategory','id','category_id'); + } public function prices() { - return $this->hasMany('App\Models\Shop\Price','price_id')->where('price_type','App\Models\Shop\PriceGeneric'); + return $this->hasMany('App\Models\Shop\PriceGenericValue','price_generic_id')->whereNotNull('price_generic_id'); } - public function values() - { - return $this->hasMany('App\Models\Shop\PriceGenericValue'); - } + public function priceByUnit() + { + return $this->hasOne('App\Models\Shop\PriceGenericValue')->orderBy('quantity','asc'); + } - public function priceByUnit() - { - return $this->hasOne('App\Models\Shop\PriceGenericValue')->orderBy('quantity','asc'); - } + public function articles() + { + return $this->hasManyThrough('App\Models\Shop\Article','App\Models\Shop\Price'); + } - public function articles() - { - return $this->hasManyThrough('App\Models\Shop\Article','App\Models\Shop\Price'); - } - - public function scopeByCategory($query, $id) - { - return $query->where('category_id', $id); - } + public function scopeByCategory($query, $id) + { + return $query->where('category_id', $id); + } } \ No newline at end of file diff --git a/app/Models/Shop/Tag.php b/app/Models/Shop/Tag.php index cc884350..e69a78a4 100644 --- a/app/Models/Shop/Tag.php +++ b/app/Models/Shop/Tag.php @@ -6,21 +6,21 @@ use Illuminate\Database\Eloquent\Model; class Tag extends Model { - protected $guarded = ['id']; + protected $guarded = ['id']; - public function group() - { + public function group() + { return $this->hasOne('App\Models\Shop\TagGroup','id','tag_group_id'); - } + } - public function scopeByGroup($query, $id) - { - return $query->where('tag_group_id', $id); - } + public function scopeByGroup($query, $id) + { + return $query->where('tag_group_id', $id); + } - public function getNameAttribute($value) - { - return json_decode($value)->fr; - } + public function getNameAttribute($value) + { + return json_decode($value)->fr; + } } diff --git a/app/Models/Shop/TagGroup.php b/app/Models/Shop/TagGroup.php index 01e07219..c478345b 100644 --- a/app/Models/Shop/TagGroup.php +++ b/app/Models/Shop/TagGroup.php @@ -6,12 +6,11 @@ use Illuminate\Database\Eloquent\Model; class TagGroup extends Model { - protected $guarded = ['id']; - protected $table = 'tag_groups'; + protected $guarded = ['id']; + protected $table = 'tag_groups'; public function tags() - { - return $this->hasMany('App\Models\Shop\Tag'); - } - + { + return $this->hasMany('App\Models\Shop\Tag'); + } } diff --git a/app/Models/Shop/Unity.php b/app/Models/Shop/Unity.php new file mode 100644 index 00000000..dbdaa5b4 --- /dev/null +++ b/app/Models/Shop/Unity.php @@ -0,0 +1,13 @@ +with('price')->get()->toArray(); - $data = []; - foreach ($prices as $price) - { - if ($price['price_type'] == 'App\Models\Shop\ArticlePrice') - { - $data[] = $price['price']; - } else { - $values = PriceGenericValues::getByPriceGeneric($price['price']['id'])->toArray(); - foreach ($values as $value) - { - $data[] = $value; - } - } - } - return $data; - } + public static function getByArticle($id) + { + $data['prices'] = Price::byArticle($id)->notGeneric()->get()->toArray(); + $data['generics'] = Price::byArticle($id)->generic()->with(['generic.prices','generic.category'])->get()->toArray(); + return $data; + } - public static function getDatatable() - { - $model = Price::orderBy('name'); - return Datatables::of($model)->make(true); - } + public static function getDatatable() + { + $model = Price::orderBy('name'); + return Datatables::of($model)->make(true); + } - public static function getAll() - { - return Price::orderBy('name','asc')->get(); - } + public static function getAll() + { + return Price::orderBy('name','asc')->get(); + } - public static function get($id) - { - return Price::find($id); - } + public static function get($id) + { + return Price::find($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 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 Price::create($data); - } + public static function create($data) + { + return Price::create($data); + } - public static function update($data) - { - return Price::find($id)->update($data); - } + public static function update($data) + { + return Price::find($id)->update($data); + } - public static function destroy($id) - { - return Price::destroy($id); - } + public static function destroy($id) + { + return Price::destroy($id); + } } diff --git a/app/Repositories/Shop/Unities.php b/app/Repositories/Shop/Unities.php new file mode 100644 index 00000000..0e756f57 --- /dev/null +++ b/app/Repositories/Shop/Unities.php @@ -0,0 +1,58 @@ +make(true); + } + + public static function getOptions() + { + return Unity::orderBy('value','asc')->get()->pluck('value','id')->toArray(); + } + + public static function getAll() + { + return Unity::orderBy('value','asc')->get(); + } + + public static function get($id) + { + return Unity::find($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) + { + return Unity::create($data); + } + + public static function update($data) + { + return Unity::find($id)->update($data); + } + + public static function destroy($id) + { + return Unity::destroy($id); + } + +} diff --git a/app/Twiggy.php b/app/Twiggy.php deleted file mode 100644 index f79f51db..00000000 --- a/app/Twiggy.php +++ /dev/null @@ -1,111 +0,0 @@ -get('menu_admin')->asUl(); - } - - public function pretty_date($date) - { - $time = strtotime($date); - $now = time(); - $ago = $now - $time; - $futur = 0; - - if ($ago < 0) { - $ago = (-1 * $ago); - $futur = 1; - } - - if ($ago < 60) { - $when = round($ago); - $s = ($when == 1) ? "seconde" : "secondes"; - $txt = "$when $s"; - } elseif ($ago < 3600) { - $when = round($ago / 60); - $m = ($when == 1) ? "minute" : "minutes"; - $txt = "$when $m"; - } elseif ($ago >= 3600 && $ago < 86400) { - $when = round($ago / 60 / 60); - $h = ($when == 1) ? "heure" : "heures"; - $txt = "$when $h"; - } elseif ($ago >= 86400 && $ago < 2629743.83) { - $when = round($ago / 60 / 60 / 24); - $d = ($when == 1) ? "jour" : "jours"; - $txt = "$when $d"; - } elseif ($ago >= 2629743.83 && $ago < 31556926) { - $when = round($ago / 60 / 60 / 24 / 30.4375); - $m = "mois"; - $txt = "$when $m"; - } else { - $when = round($ago / 60 / 60 / 24 / 365); - $y = ($when == 1) ? "an" : "ans"; - $txt = "$when $y"; - } - - if ($futur) { - $txt = "dans " . $txt; - } else { - $txt = "il y a " . $txt; - } - return $txt; - } -} diff --git a/composer.json b/composer.json index 9fd56af1..c2050e37 100644 --- a/composer.json +++ b/composer.json @@ -44,6 +44,7 @@ "laravel/scout": "^7.2", "laravel/ui": "^1.0", "laravelcollective/html": "^6.0", + "lavary/laravel-menu": "1.8.1", "league/climate": "^3.5", "league/period": "^4.9", "lorisleiva/laravel-deployer": "^0.3.2", @@ -74,7 +75,7 @@ "smajohusic/laravel-mail-logger": "^1.0", "soved/laravel-gdpr": "^1.5", "spatie/laravel-activitylog": "^3.6", - "spatie/laravel-backup": "^6.2", + "spatie/laravel-backup": "^6.7", "spatie/laravel-medialibrary": "^7.0", "staudenmeir/belongs-to-through": "^2.5", "staudenmeir/eloquent-has-many-deep": "^1.8", @@ -102,7 +103,6 @@ "nunomaduro/larastan": "^0.5.2", "nunomaduro/phpinsights": "^1.13", "phpunit/phpunit": "^8.0", - "sayeed/custom-migrate": "^1.0", "theseer/phpdox": "^0.12.0", "wnx/laravel-stats": "^2.0" }, diff --git a/resources/views/Shop/Admin/ArticleAttributeFamilies/create.blade.php b/resources/views/Shop/Admin/ArticleAttributeFamilies/create.blade.php deleted file mode 100644 index 78075320..00000000 --- a/resources/views/Shop/Admin/ArticleAttributeFamilies/create.blade.php +++ /dev/null @@ -1,28 +0,0 @@ -@extends('layout.index', [ - 'title' => __('article_attribute_families.title'), - 'subtitle' => __('article_attribute_families.create.title'), - 'breadcrumb' => [__('article_attribute_families.title'), __('article_attribute_families.create.title')] -]) - -@include('boilerplate::load.fileinput') - -@section('content') - - {{ Form::open(['route' => 'Shop.Admin.ArticleAttributeFamilies.store', 'id' => 'article-attribute-family-form', 'autocomplete' => 'off']) }} - -
-
- - {{ __('article_attribute_families.title') }} - - - - @include('components.button-save') - -
-
- - @include('Shop.Admin.ArticleAttributeFamilies.form') - - -@endsection diff --git a/resources/views/Shop/Admin/ArticleAttributeFamilies/edit.blade.php b/resources/views/Shop/Admin/ArticleAttributeFamilies/edit.blade.php deleted file mode 100644 index ab132b06..00000000 --- a/resources/views/Shop/Admin/ArticleAttributeFamilies/edit.blade.php +++ /dev/null @@ -1,29 +0,0 @@ -@extends('layout.index', [ - 'title' => 'Famille d\'articles', - 'subtitle' => 'Edition d\'une famille d\'article', - 'breadcrumb' => ['Articles'] -]) - -@include('boilerplate::load.fileinput') - -@section('content') - - {{ Form::open(['route' => 'Shop.Admin.ArticleFamilies.update', 'id' => 'article-family-form', 'autocomplete' => 'off', 'files' => true]) }} - -
-
- - {{ __('article_families.list.title') }} - - - - @include('components.button-save') - -
-
- - - @include('Shop.Admin.ArticleFamilies.form') - - -@endsection diff --git a/resources/views/Shop/Admin/ArticleAttributeFamilies/index.blade.php b/resources/views/Shop/Admin/ArticleAttributeFamilies/index.blade.php deleted file mode 100644 index 526a0781..00000000 --- a/resources/views/Shop/Admin/ArticleAttributeFamilies/index.blade.php +++ /dev/null @@ -1,39 +0,0 @@ -@extends('layout.index', [ - 'title' => __('Shop.article_attributes.title'), - 'subtitle' => __('Shop.article_attributes.list'), - 'breadcrumb' => [__('Shop.article_attributes.title')] -]) - -@include('boilerplate::load.select2') - -@section('content') - - - -
- -
- @component('components.card') - @include('components.datatable', ['route' => route('Shop.Admin.ArticleAttributeFamilies.index'), 'model' => 'ArticleAttributeFamilies']) - @endcomponent -
- -
- @component('components.card') - @include('components.datatable', ['route' => route('Shop.Admin.ArticleAttributeValues.index'), 'model' => 'ArticleAttributeValues']) - @endcomponent - -
- -
- -@endsection diff --git a/resources/views/Shop/Admin/ArticleAttributeFamilies/list.blade.php b/resources/views/Shop/Admin/ArticleAttributeFamilies/list.blade.php deleted file mode 100644 index 3ca9b116..00000000 --- a/resources/views/Shop/Admin/ArticleAttributeFamilies/list.blade.php +++ /dev/null @@ -1,9 +0,0 @@ -@extends('layout.index', [ - 'title' => __('Shop.article_attribute_families.title'), - 'subtitle' => __('Shop.article_attribute_families.list'), - 'breadcrumb' => [__('Shop.article_attribute_families.title')] -]) - -@section('content') - @include('components.datatable', ['route' => route('Shop.Admin.ArticleAttributeFamilies.index'), 'model' => 'ArticleAttributefamilies']) -@endsection diff --git a/resources/views/Shop/Admin/Articles/form.blade.php b/resources/views/Shop/Admin/Articles/form.blade.php index 64380c3d..f905711b 100644 --- a/resources/views/Shop/Admin/Articles/form.blade.php +++ b/resources/views/Shop/Admin/Articles/form.blade.php @@ -52,7 +52,8 @@
- @include('Shop.Admin.Articles.partials.prices') + @include('Shop.Admin.Articles.partials.prices', ['prices' => $prices['prices'] ?? null]) + @include('Shop.Admin.Articles.partials.generic_prices', ['generics' => $prices['generics'] ?? null])
diff --git a/resources/views/Shop/Admin/Articles/partials/generic_prices.blade.php b/resources/views/Shop/Admin/Articles/partials/generic_prices.blade.php new file mode 100644 index 00000000..8828e3e8 --- /dev/null +++ b/resources/views/Shop/Admin/Articles/partials/generic_prices.blade.php @@ -0,0 +1,119 @@ +@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/attributes.blade.php b/resources/views/Shop/Admin/Articles/partials/generic_prices/attributes.blade.php new file mode 100644 index 00000000..622b50fe --- /dev/null +++ b/resources/views/Shop/Admin/Articles/partials/generic_prices/attributes.blade.php @@ -0,0 +1,4 @@ +
+ @include('Shop.Admin.Articles.partials.prices.block_attribute_new') +
+
diff --git a/resources/views/Shop/Admin/Articles/partials/generic_prices/block_attribute.blade.php b/resources/views/Shop/Admin/Articles/partials/generic_prices/block_attribute.blade.php new file mode 100644 index 00000000..6fbf1557 --- /dev/null +++ b/resources/views/Shop/Admin/Articles/partials/generic_prices/block_attribute.blade.php @@ -0,0 +1,28 @@ +
+ + + + +
+ {{ Form::label('attribute_family_id', 'Attributs') }}
+ @include('components.select', [ + 'name' => "prices[$key][attribute][attribute_family_id]", + 'value' => $attribute['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[$key][attribute][attribute_value_id]", + 'value' => $attribute['article_attribute_value_id'] ?? null, + 'list' => $attribute_values ?? null, + 'required' => true, + 'class' => 'select2 form-control-sm attributes-value w-100', + 'meta' => (isset($attribute['article_attribute_value_id'])) ? 'data-id="' . $attribute['article_attribute_value_id'] . '"' : '' + ]) +
+
diff --git a/resources/views/Shop/Admin/Articles/partials/generic_prices/block_attribute_new.blade.php b/resources/views/Shop/Admin/Articles/partials/generic_prices/block_attribute_new.blade.php new file mode 100644 index 00000000..9d22b6cb --- /dev/null +++ b/resources/views/Shop/Admin/Articles/partials/generic_prices/block_attribute_new.blade.php @@ -0,0 +1,24 @@ +
+ +
+ {{ 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/generic_prices/block_generic_price.blade.php b/resources/views/Shop/Admin/Articles/partials/generic_prices/block_generic_price.blade.php new file mode 100644 index 00000000..8705dc4a --- /dev/null +++ b/resources/views/Shop/Admin/Articles/partials/generic_prices/block_generic_price.blade.php @@ -0,0 +1,12 @@ +
+ + + + + + + @include('Shop.Admin.PriceGenerics.partials.table-prices', ['generic' => $generic['generic'] ?? null ]) +
+ 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 new file mode 100644 index 00000000..69123267 --- /dev/null +++ b/resources/views/Shop/Admin/Articles/partials/generic_prices/block_generic_price_new.blade.php @@ -0,0 +1,54 @@ +
+ + + +
+
+ +
+ +
+ {{ 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/list-generic_prices.blade.php b/resources/views/Shop/Admin/Articles/partials/generic_prices/list-generic_prices.blade.php new file mode 100644 index 00000000..3ceab359 --- /dev/null +++ b/resources/views/Shop/Admin/Articles/partials/generic_prices/list-generic_prices.blade.php @@ -0,0 +1,14 @@ +@if (isset($generics) && (count($generics))) + @foreach ($generics as $generic) + @include('Shop.Admin.Articles.partials.generic_prices.block_generic_price') + @endforeach +@endif + +@push('js') + +@endpush + 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 index 6de41053..734661bc 100644 --- a/resources/views/Shop/Admin/Articles/partials/prices/block_attribute.blade.php +++ b/resources/views/Shop/Admin/Articles/partials/prices/block_attribute.blade.php @@ -1,13 +1,10 @@
- - -
- {{ Form::label('attribute_family_id', 'Attributs') }}
+ {{ Form::label('attribute_family_id', 'Type') }}
@include('components.select', [ - 'name' => "prices[$key][attribute][attribute_family_id]", - 'value' => $attribute['attribute_value']['article_attribute_family_id'] ?? null, + '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' @@ -15,14 +12,13 @@
- {{ Form::label('attribute_value_id', 'Valeur') }}
+ {{ Form::label('attribute_value_id', 'Unité') }}
@include('components.select', [ - 'name' => "prices[$key][attribute][attribute_value_id]", - 'value' => $attribute['article_attribute_value_id'] ?? null, - 'list' => $attribute_values ?? null, + 'name' => "prices[$key][unity_id]", + 'value' => $price['unity_id'] ?? null, + 'list' => $unities ?? null, 'required' => true, - 'class' => 'select2 form-control-sm attributes-value', - 'meta' => (isset($attribute['article_attribute_value_id'])) ? 'data-id="' . $attribute['article_attribute_value_id'] . '"' : '' + 'class' => 'select2 form-control-sm attributes-value w-100', ])
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 2c0d4389..be546453 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 @@ -7,12 +7,7 @@
-
- {{ Form::label('price_generic_id', 'Générique') }}
- @include('components.select-tree', ['name' => "prices[$key][article_price_generic_id]", 'value' => $price['article_price_generic_id'] ?? null, 'list' => $price_generics ?? null, 'required' => false, 'class' => 'form-control-sm']) -
- -
+
{{ Form::label('quantity', 'Qté.') }}
@@ -20,7 +15,7 @@
- @include('Shop.Admin.Articles.partials.prices.block_attribute', ['attribute' => $price['article_attribute'] ?? null]) + @include('Shop.Admin.Articles.partials.prices.block_attribute')
diff --git a/resources/views/Shop/Admin/ArticleAttributeValues/create.blade.php b/resources/views/Shop/Admin/PriceFamilyValues/create.blade.php similarity index 100% rename from resources/views/Shop/Admin/ArticleAttributeValues/create.blade.php rename to resources/views/Shop/Admin/PriceFamilyValues/create.blade.php diff --git a/resources/views/Shop/Admin/ArticleAttributeValues/edit.blade.php b/resources/views/Shop/Admin/PriceFamilyValues/edit.blade.php similarity index 100% rename from resources/views/Shop/Admin/ArticleAttributeValues/edit.blade.php rename to resources/views/Shop/Admin/PriceFamilyValues/edit.blade.php diff --git a/resources/views/Shop/Admin/ArticleAttributeFamilies/form.blade.php b/resources/views/Shop/Admin/PriceFamilyValues/form.blade.php similarity index 100% rename from resources/views/Shop/Admin/ArticleAttributeFamilies/form.blade.php rename to resources/views/Shop/Admin/PriceFamilyValues/form.blade.php diff --git a/resources/views/Shop/Admin/ArticleAttributeValues/index.blade.php b/resources/views/Shop/Admin/PriceFamilyValues/index.blade.php similarity index 100% rename from resources/views/Shop/Admin/ArticleAttributeValues/index.blade.php rename to resources/views/Shop/Admin/PriceFamilyValues/index.blade.php diff --git a/resources/views/Shop/Admin/ArticleAttributeValues/list.blade.php b/resources/views/Shop/Admin/PriceFamilyValues/list.blade.php similarity index 100% rename from resources/views/Shop/Admin/ArticleAttributeValues/list.blade.php rename to resources/views/Shop/Admin/PriceFamilyValues/list.blade.php diff --git a/resources/views/Shop/Admin/ArticleAttributeValues/partials/filters.blade.php b/resources/views/Shop/Admin/PriceFamilyValues/partials/filters.blade.php similarity index 100% rename from resources/views/Shop/Admin/ArticleAttributeValues/partials/filters.blade.php rename to resources/views/Shop/Admin/PriceFamilyValues/partials/filters.blade.php diff --git a/resources/views/Shop/Admin/ArticleAttributeFamilies/show.blade.php b/resources/views/Shop/Admin/PriceFamilyValues/show.blade.php similarity index 100% rename from resources/views/Shop/Admin/ArticleAttributeFamilies/show.blade.php rename to resources/views/Shop/Admin/PriceFamilyValues/show.blade.php diff --git a/resources/views/Shop/Admin/PriceGenerics/partials/block_price.blade.php b/resources/views/Shop/Admin/PriceGenerics/partials/block_price.blade.php index d94589e5..a153e94d 100644 --- a/resources/views/Shop/Admin/PriceGenerics/partials/block_price.blade.php +++ b/resources/views/Shop/Admin/PriceGenerics/partials/block_price.blade.php @@ -1,4 +1,4 @@ -
+
@@ -13,16 +13,21 @@
+ {{ Form::label('unity_id', 'Unité') }}
+ @include('components.select', ['name' => 'prices[0][unity_id]', 'value' => $unity_id ?? null, 'list' => $unities ?? null, '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 ?? null, 'required' => true, 'class' => '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'])
diff --git a/resources/views/Shop/Admin/PriceGenerics/partials/block_price_new.blade.php b/resources/views/Shop/Admin/PriceGenerics/partials/block_price_new.blade.php index a109880e..30b73df3 100644 --- a/resources/views/Shop/Admin/PriceGenerics/partials/block_price_new.blade.php +++ b/resources/views/Shop/Admin/PriceGenerics/partials/block_price_new.blade.php @@ -1,4 +1,4 @@ -
+
@@ -12,18 +12,22 @@ @include('components.number', ['name' => 'prices[0][quantity]', 'value' => $quantity ?? 1, 'required' => true, 'class' => 'form-control-sm'])
-
+ {{ Form::label('unity_id', 'Unité') }}
+ @include('components.select', ['name' => 'prices[0][unity_id]', 'value' => $unity_id ?? null, 'list' => $unities ?? null, 'required' => true, 'class' => 'form-control-sm']) +
+ +
{{ Form::label('tax_id', 'TVA') }}
@include('components.select', ['name' => 'prices[0][tax_id]', 'value' => $tax_id ?? null, 'list' => $taxes ?? null, 'required' => true, 'class' => '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'])
diff --git a/resources/views/Shop/Admin/PriceGenerics/partials/table-prices.blade.php b/resources/views/Shop/Admin/PriceGenerics/partials/table-prices.blade.php new file mode 100644 index 00000000..6c966b09 --- /dev/null +++ b/resources/views/Shop/Admin/PriceGenerics/partials/table-prices.blade.php @@ -0,0 +1,23 @@ + + + + + @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 }} +
diff --git a/resources/views/Shop/Admin/Unities/create.blade.php b/resources/views/Shop/Admin/Unities/create.blade.php new file mode 100644 index 00000000..c6df45b6 --- /dev/null +++ b/resources/views/Shop/Admin/Unities/create.blade.php @@ -0,0 +1,28 @@ +@extends('layout.index', [ + 'title' => __('article_attributes.title'), + 'subtitle' => __('article_attributes.create.title'), + 'breadcrumb' => [__('article_attributes.title'), __('article_attributes.create.title')] +]) + +@include('boilerplate::load.fileinput') + +@section('content') + + {{ Form::open(['route' => 'Shop.Admin.ArticleAttributes.store', 'id' => 'article-attribute-form', 'autocomplete' => 'off', 'files' => true]) }} + +
+
+ + {{ __('article_attributes.list.title') }} + + + + @include('components.button-save') + +
+
+ + @include('Shop.Admin.ArticleAttributeValues.form') + + +@endsection diff --git a/resources/views/Shop/Admin/Unities/edit.blade.php b/resources/views/Shop/Admin/Unities/edit.blade.php new file mode 100644 index 00000000..ac7a4833 --- /dev/null +++ b/resources/views/Shop/Admin/Unities/edit.blade.php @@ -0,0 +1,29 @@ +@extends('layout.index', [ + 'title' => 'Attributs d\'articles', + 'subtitle' => 'Edition d\'un attribut d\'article', + 'breadcrumb' => ['Articles'] +]) + +@include('boilerplate::load.fileinput') + +@section('content') + + {{ Form::open(['route' => 'Shop.Admin.ArticleAttributeValues.update', 'id' => 'article-attribute-form', 'autocomplete' => 'off', 'files' => true]) }} + +
+
+ + {{ __('article_attributes.list.title') }} + + + + @include('components.button-save') + +
+
+ + + @include('Shop.Admin.ArticleAttributeValues.form') + + +@endsection diff --git a/resources/views/Shop/Admin/ArticleAttributeValues/form.blade.php b/resources/views/Shop/Admin/Unities/form.blade.php similarity index 100% rename from resources/views/Shop/Admin/ArticleAttributeValues/form.blade.php rename to resources/views/Shop/Admin/Unities/form.blade.php diff --git a/resources/views/Shop/Admin/Unities/index.blade.php b/resources/views/Shop/Admin/Unities/index.blade.php new file mode 100644 index 00000000..6fd47eb0 --- /dev/null +++ b/resources/views/Shop/Admin/Unities/index.blade.php @@ -0,0 +1,48 @@ +@extends('layout.index', [ + 'title' => __('Shop.unities.title'), + 'subtitle' => __('Shop.unities.list'), + 'breadcrumb' => [__('Shop.unities.title')] +]) + +@include('boilerplate::load.select2') + +@section('content') + + + +
+ +
+ @section('content') + @include('components.datatable', ['route' => route('Shop.Admin.Unities.index'), 'model' => 'ArticleAttributefamilies']) + @endsection +
+ +
+ @section('content') + @component('components.card') + @include('components.datatable', ['route' => route('Shop.Admin.ArticleAttributeValues.index'), 'model' => 'Unities']) + @endcomponent + + @component('components.layout.modal', ['title' => 'Filtres', 'id' => 'modal-filters']) + @include('Shop.Admin.Unities.partials.filters') + @endcomponent + @endsection +
+ +
+ +@endsection + +@push('scripts') + @include('components.js.datatable', ['route' => route('Shop.Admin.Unities.index'), 'model' => 'Unities']) +@endpush \ No newline at end of file diff --git a/resources/views/Shop/Admin/Unities/list.blade.php b/resources/views/Shop/Admin/Unities/list.blade.php new file mode 100644 index 00000000..75982115 --- /dev/null +++ b/resources/views/Shop/Admin/Unities/list.blade.php @@ -0,0 +1,16 @@ +@extends('layout.index', [ + 'title' => __('Shop.article_attribute_values.title'), + 'subtitle' => __('Shop.article_attribute_values.list'), + 'breadcrumb' => [__('Shop.article_attribute_values.title')] +]) + +@section('content') + @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 diff --git a/resources/views/Shop/Admin/Unities/partials/filters.blade.php b/resources/views/Shop/Admin/Unities/partials/filters.blade.php new file mode 100644 index 00000000..16ce4981 --- /dev/null +++ b/resources/views/Shop/Admin/Unities/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/Shop/Admin/ArticleAttributeValues/show.blade.php b/resources/views/Shop/Admin/Unities/show.blade.php similarity index 100% rename from resources/views/Shop/Admin/ArticleAttributeValues/show.blade.php rename to resources/views/Shop/Admin/Unities/show.blade.php diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index dff71eb4..4db56fa0 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -4,7 +4,6 @@ ]) @section('content') - @component('auth.loginbox') {!! Form::open(['route' => 'boilerplate.login', 'method' => 'post', 'autocomplete'=> 'off']) !!}
@@ -38,5 +37,4 @@ @if(config('boilerplate.auth.register')) {{ __('boilerplate::auth.login.register') }} @endif - @endcomponent @endsection diff --git a/resources/views/components/button.blade.php b/resources/views/components/button.blade.php new file mode 100644 index 00000000..7cfd9399 --- /dev/null +++ b/resources/views/components/button.blade.php @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/resources/views/components/card.blade.php b/resources/views/components/card.blade.php index 9a570564..a990090f 100644 --- a/resources/views/components/card.blade.php +++ b/resources/views/components/card.blade.php @@ -1,4 +1,4 @@ -
+
@if($title ?? $header ?? false)
@isset($header) @@ -13,7 +13,7 @@ @endisset
@endif -
+
{{ $slot }}
@isset($footer) diff --git a/resources/views/components/form/autocomplete.blade.php b/resources/views/components/form/autocomplete.blade.php new file mode 100644 index 00000000..0d76a6d5 --- /dev/null +++ b/resources/views/components/form/autocomplete.blade.php @@ -0,0 +1,4 @@ +@include('load.autocomplete') + + + diff --git a/resources/views/components/form/checkbox.blade.php b/resources/views/components/form/checkbox.blade.php new file mode 100644 index 00000000..e731003e --- /dev/null +++ b/resources/views/components/form/checkbox.blade.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/resources/views/components/form/color.blade.php b/resources/views/components/form/color.blade.php new file mode 100644 index 00000000..05b2bb46 --- /dev/null +++ b/resources/views/components/form/color.blade.php @@ -0,0 +1,4 @@ +@include('load.form.color') + +@include('components.input', ['class' => 'color']) + diff --git a/resources/views/components/form/datepicker.blade.php b/resources/views/components/form/datepicker.blade.php new file mode 100644 index 00000000..a32bcbd9 --- /dev/null +++ b/resources/views/components/form/datepicker.blade.php @@ -0,0 +1,8 @@ +@include('load.datepicker') + +
+ @include('components.input', ['class' => 'datepicker', 'meta' => 'data-target="#'.str_slug($name).'"', 'placeholder' => App\Repositories\Core\DateTime::getLocaleFormatDate() ]) +
+
+
+
diff --git a/resources/views/components/form/datetimepicker.blade.php b/resources/views/components/form/datetimepicker.blade.php new file mode 100644 index 00000000..d5e8a2bf --- /dev/null +++ b/resources/views/components/form/datetimepicker.blade.php @@ -0,0 +1,13 @@ +@include('components.input', ['class' => 'datetimepicker']) + +@if(!defined('LOAD_DATETIMEPICKER')) + @include('boilerplate::load.datetimepicker') + @push('js') + + @endpush +@endif + diff --git a/resources/views/components/form/editor.blade.php b/resources/views/components/form/editor.blade.php new file mode 100644 index 00000000..c5a2b646 --- /dev/null +++ b/resources/views/components/form/editor.blade.php @@ -0,0 +1,19 @@ + + + +@if(!defined('LOAD_EDITOR')) + @include('load.editor') + @push('js') + + @endpush +@endif + diff --git a/resources/views/components/form/password.blade.php b/resources/views/components/form/password.blade.php new file mode 100644 index 00000000..d32df32a --- /dev/null +++ b/resources/views/components/form/password.blade.php @@ -0,0 +1,13 @@ +
+ + @include('components.input') + +
+ + +
+
diff --git a/resources/views/components/form/percent.blade.php b/resources/views/components/form/percent.blade.php new file mode 100644 index 00000000..548f778e --- /dev/null +++ b/resources/views/components/form/percent.blade.php @@ -0,0 +1,10 @@ +
+ + @include('components.input', ['type' => 'number', 'meta' => "step = '.01'"]) + +
+ +
+
diff --git a/resources/views/components/form/radios.blade.php b/resources/views/components/form/radios.blade.php new file mode 100644 index 00000000..de4e8074 --- /dev/null +++ b/resources/views/components/form/radios.blade.php @@ -0,0 +1,12 @@ +
+ @foreach ($list as $key => $item) +
+ + @if ($with_label ?? true) + + @else + + @endif +
+ @endforeach +
diff --git a/resources/views/components/form/select-multiple-duallist.blade.php b/resources/views/components/form/select-multiple-duallist.blade.php new file mode 100644 index 00000000..61547e8d --- /dev/null +++ b/resources/views/components/form/select-multiple-duallist.blade.php @@ -0,0 +1 @@ +@include('components.select', ['class' => 'duallist', 'multiple' => true]) diff --git a/resources/views/components/form/tags.blade.php b/resources/views/components/form/tags.blade.php new file mode 100644 index 00000000..4568d417 --- /dev/null +++ b/resources/views/components/form/tags.blade.php @@ -0,0 +1,19 @@ + + +@if(!defined('LOAD_SELECT2')) + @include('load.select2') +@endif diff --git a/resources/views/components/form/toggle.blade.php b/resources/views/components/form/toggle.blade.php new file mode 100644 index 00000000..e5df7967 --- /dev/null +++ b/resources/views/components/form/toggle.blade.php @@ -0,0 +1,3 @@ + + +@include('load.toggle') \ No newline at end of file diff --git a/resources/views/components/form/toggle_yesno.blade.php b/resources/views/components/form/toggle_yesno.blade.php new file mode 100644 index 00000000..2af6b105 --- /dev/null +++ b/resources/views/components/form/toggle_yesno.blade.php @@ -0,0 +1 @@ +@include('components.form.toggle') diff --git a/resources/views/components/form/url.blade.php b/resources/views/components/form/url.blade.php new file mode 100644 index 00000000..9543c88b --- /dev/null +++ b/resources/views/components/form/url.blade.php @@ -0,0 +1,11 @@ +
+ @include('components.input', ['class' => 'url']) +
+ @if (isset($with_download) && $with_download) +
+ @endif + @if (isset($with_web) && $with_web) +
+ @endif +
+
diff --git a/resources/views/components/layout/box-collapse.blade.php b/resources/views/components/layout/box-collapse.blade.php index 91e3c0cb..ad9843d1 100644 --- a/resources/views/components/layout/box-collapse.blade.php +++ b/resources/views/components/layout/box-collapse.blade.php @@ -1,12 +1,25 @@ -
+
- - {{ $title }} @if(isset($required) && $required)*@endif - +
+
+ + {!! $title !!} + @if (isset($required) && $required) + * + @endif + + {!! $collapse_left ?? '' !!} + + +
+
+ {!! $collapse_right ?? '' !!} +
+
-
+
{{ $slot }}
diff --git a/resources/views/components/layout/modal-filters.blade.php b/resources/views/components/layout/modal-filters.blade.php new file mode 100644 index 00000000..0125b3d9 --- /dev/null +++ b/resources/views/components/layout/modal-filters.blade.php @@ -0,0 +1,20 @@ + diff --git a/resources/views/components/layout/modal.blade.php b/resources/views/components/layout/modal.blade.php index 3bc5cbb8..7bf58043 100644 --- a/resources/views/components/layout/modal.blade.php +++ b/resources/views/components/layout/modal.blade.php @@ -11,6 +11,9 @@ {{ $slot }}
diff --git a/routes/Shop/Admin/ArticleAttributeFamilies.php b/routes/Shop/Admin/ArticleAttributeFamilies.php deleted file mode 100644 index c8431639..00000000 --- a/routes/Shop/Admin/ArticleAttributeFamilies.php +++ /dev/null @@ -1,4 +0,0 @@ -name('ArticleAttributeValues.')->group(function () { - Route::post('getOptionsByFamily', 'ArticleAttributeValueController@getOptionsByFamily')->name('getOptionsByFamily'); -}); \ No newline at end of file diff --git a/routes/Shop/Admin/PriceFamilyValues.php b/routes/Shop/Admin/PriceFamilyValues.php index 2847759c..335ec76d 100644 --- a/routes/Shop/Admin/PriceFamilyValues.php +++ b/routes/Shop/Admin/PriceFamilyValues.php @@ -1,7 +1,7 @@ name('PriceFamilyValues.')->group(function () { - Route::post('getOptionsByFamily', 'PriceFamilyValueController@getOptionsByFamily')->name('getOptionsByFamily'); -}); \ No newline at end of file + Route::any('getOptionsByFamily', 'PriceFamilyValueController@getOptionsByFamily')->name('getOptionsByFamily'); +}); + +Route::resource('PriceFamilyValues', 'PriceFamilyValueController'); diff --git a/routes/Shop/Admin/route.php b/routes/Shop/Admin/route.php index ad8b36ff..18178673 100644 --- a/routes/Shop/Admin/route.php +++ b/routes/Shop/Admin/route.php @@ -2,9 +2,6 @@ Route::middleware('auth')->prefix('Admin')->namespace('Admin')->name('Admin.')->group(function () { Route::get('dashboard', 'DashboardController@index')->name('dashboard'); - include __DIR__ . '/ArticleAttributeFamilies.php'; - include __DIR__ . '/ArticleAttributeValues.php'; - include __DIR__ . '/ArticleAttributes.php'; include __DIR__ . '/ArticleFamilies.php'; include __DIR__ . '/ArticlePrices.php'; include __DIR__ . '/Articles.php';