fix on new tariff_unities
This commit is contained in:
@@ -14,20 +14,11 @@ class TariffUnityController extends Controller
|
||||
{
|
||||
public function index(TariffUnitiesDataTable $dataTable)
|
||||
{
|
||||
$data['families'] = ArticleNatures::getOptions();
|
||||
$data['packages'] = Packages::getOptions();
|
||||
return $dataTable->render('Admin.Shop.TariffUnities.list', $data);
|
||||
}
|
||||
|
||||
public function getOptionsByPackage(Request $request)
|
||||
{
|
||||
$id = $request->input('package_id');
|
||||
return response()->json(TariffUnities::getOptionsByPackage($id));
|
||||
return $dataTable->render('Admin.Shop.TariffUnities.list', $data ?? []);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data['packages'] = Packages::getOptions();
|
||||
return view('Admin.Shop.TariffUnities.create');
|
||||
}
|
||||
|
||||
@@ -45,8 +36,7 @@ class TariffUnityController extends Controller
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['packages'] = Packages::getOptions();
|
||||
$data['unity'] = TariffUnities::get($id)->toArray();
|
||||
$data['tariff_unity'] = TariffUnities::get($id)->toArray();
|
||||
return view('Admin.Shop.TariffUnities.edit', $data);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,20 +14,16 @@ class UnityController extends Controller
|
||||
{
|
||||
public function index(UnitiesDataTable $dataTable)
|
||||
{
|
||||
$data['families'] = ArticleNatures::getOptions();
|
||||
$data['packages'] = Packages::getOptions();
|
||||
return $dataTable->render('Admin.Shop.Unities.list', $data);
|
||||
return $dataTable->render('Admin.Shop.Unities.list', $data ?? []);
|
||||
}
|
||||
|
||||
public function getOptionsByPackage(Request $request)
|
||||
{
|
||||
$id = $request->input('package_id');
|
||||
return response()->json(Unities::getOptionsByPackage($id));
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data['packages'] = Packages::getOptions();
|
||||
return view('Admin.Shop.Unities.create');
|
||||
}
|
||||
|
||||
@@ -45,7 +41,6 @@ class UnityController extends Controller
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['packages'] = Packages::getOptions();
|
||||
$data['unity'] = Unities::get($id)->toArray();
|
||||
return view('Admin.Shop.Unities.edit', $data);
|
||||
}
|
||||
|
||||
@@ -6,11 +6,7 @@
|
||||
|
||||
@section('content')
|
||||
@component('components.card')
|
||||
@include('components.datatable', ['route' => route('Admin.Shop.TariffUnities.index'), 'model' => 'tariff_unities','with_filters' => true])
|
||||
@endcomponent
|
||||
|
||||
@component('components.layout.modal', ['title' => 'Filtres', 'id' => 'modal-tariff_unities-filters'])
|
||||
@include('Admin.Shop.TariffUnities.partials.filters')
|
||||
@include('components.datatable', ['route' => route('Admin.Shop.TariffUnities.index'), 'model' => 'tariff_unities', 'with_filters' => false])
|
||||
@endcomponent
|
||||
|
||||
@endsection
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
@extends('layout.index', [
|
||||
'title' => __('shop.unities.title'),
|
||||
'subtitle' => __('shop.unities.list'),
|
||||
'breadcrumb' => [__('shop.unities.title')]
|
||||
])
|
||||
|
||||
@include('boilerplate::load.select2')
|
||||
|
||||
@section('content')
|
||||
|
||||
<nav>
|
||||
<div class="nav nav-tabs">
|
||||
<a href="#families" data-toggle="tab" class="nav-item nav-link" role="tab" aria-controls="families" aria-selected="true">
|
||||
{{ __('shop.unities.title') }}
|
||||
</a>
|
||||
<a href="#values" data-toggle="tab" class="nav-item nav-link active" role="tab" aria-controls="values" aria-selected="false">
|
||||
{{ __('shop.unities.title') }}
|
||||
</a>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="tab-content mb-0">
|
||||
|
||||
<div class="tab-pane fade" id="families">
|
||||
@section('content')
|
||||
@include('components.datatable', ['route' => route('Admin.Shop.Unities.index'), 'model' => 'ArticleAttributefamilies'])
|
||||
@endsection
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade show active" id="values">
|
||||
@section('content')
|
||||
@component('components.card')
|
||||
@include('components.datatable', ['route' => route('Admin.Shop.ArticleAttributeValues.index'), 'model' => 'Unities', 'with_filters' => true])
|
||||
@endcomponent
|
||||
|
||||
@component('components.layout.modal', ['title' => 'Filtres', 'id' => 'modal-filters'])
|
||||
@include('Admin.Shop.Unities.partials.filters')
|
||||
@endcomponent
|
||||
@endsection
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
@include('components.js.datatable', ['route' => route('Admin.Shop.Unities.index'), 'model' => 'Unities'])
|
||||
@endpush
|
||||
@@ -6,11 +6,7 @@
|
||||
|
||||
@section('content')
|
||||
@component('components.card')
|
||||
@include('components.datatable', ['route' => route('Admin.Shop.Unities.index'), 'model' => 'unities','with_filters' => true])
|
||||
@endcomponent
|
||||
|
||||
@component('components.layout.modal', ['title' => 'Filtres', 'id' => 'modal-unities-filters'])
|
||||
@include('Admin.Shop.Unities.partials.filters')
|
||||
@include('components.datatable', ['route' => route('Admin.Shop.Unities.index'), 'model' => 'unities', 'with_filters' => false])
|
||||
@endcomponent
|
||||
|
||||
@endsection
|
||||
|
||||
@@ -1,14 +1,2 @@
|
||||
<form id="unities-filters">
|
||||
<div class="row">
|
||||
<label class="col-4">Familles d'articles</label>
|
||||
<div class="col-8">
|
||||
@include('components.form.select', ['name' => 'family_id', 'list' => (isset($families)) ? $families : [], 'value' => (isset($filters['family_id'])) ? $filters['family_id'] : null, 'class' => 'form-control-sm select2', 'with_empty' => ' '])
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<label class="col-4">Packages</label>
|
||||
<div class="col-8">
|
||||
@include('components.form.select', ['name' => 'package_id', 'list' => (isset($packages)) ? $packages : [], 'value' => (isset($filters['package_id'])) ? $filters['package_id'] : null, 'class' => 'form-control-sm select2', 'with_empty' => ' '])
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user