Merge branch 'issue-235' into 'develop'
add order on front for product and recipes See merge request ldc-web/projets/le-gaulois-pro!236
This commit is contained in:
commit
c24d2f7360
4 changed files with 3 additions and 26 deletions
|
|
@ -62,7 +62,7 @@ class ProductsController extends Controller
|
||||||
$productsQuery = !empty($search) ? $this->getProductQuery($search) : Product::query();
|
$productsQuery = !empty($search) ? $this->getProductQuery($search) : Product::query();
|
||||||
$productsQuery->with('subrange.range');
|
$productsQuery->with('subrange.range');
|
||||||
$productsQuery->where('published', true);
|
$productsQuery->where('published', true);
|
||||||
$productsQuery->orderBy('order', 'ASC');
|
$productsQuery->orderBy('priority_order', 'ASC');
|
||||||
|
|
||||||
// * Range filter (obligatoire).
|
// * Range filter (obligatoire).
|
||||||
$productsQuery->whereHas('subrange', function (Builder $q) use ($range) {
|
$productsQuery->whereHas('subrange', function (Builder $q) use ($range) {
|
||||||
|
|
@ -85,7 +85,6 @@ class ProductsController extends Controller
|
||||||
if ($request->vip) {
|
if ($request->vip) {
|
||||||
$productsQuery->where('is_vip', $request->vip);
|
$productsQuery->where('is_vip', $request->vip);
|
||||||
}
|
}
|
||||||
|
|
||||||
return \response()->json(new ProductPaginatedCollectionResource($productsQuery->paginate(6)));
|
return \response()->json(new ProductPaginatedCollectionResource($productsQuery->paginate(6)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ class RecipesController extends Controller
|
||||||
])
|
])
|
||||||
);
|
);
|
||||||
|
|
||||||
$recipes = $query->orderBy('slug', 'ASC')->paginate(9);
|
$recipes = $query->orderBy('priority_order', 'ASC')->paginate(9);
|
||||||
|
|
||||||
return view('fo.pages.ideas.recipes', compact(
|
return view('fo.pages.ideas.recipes', compact(
|
||||||
'ranges',
|
'ranges',
|
||||||
|
|
|
||||||
|
|
@ -52,14 +52,6 @@
|
||||||
'model' => $adviceModel,
|
'model' => $adviceModel,
|
||||||
])
|
])
|
||||||
<td class="text-center align-middle"><span class="badge bg-secondary">{{ $adviceModel->updated_at }}</span></td>
|
<td class="text-center align-middle"><span class="badge bg-secondary">{{ $adviceModel->updated_at }}</span></td>
|
||||||
@if (empty(request()->search) && request()->range)
|
|
||||||
@php $routeName = request()->route()->getName(); @endphp
|
|
||||||
@include('bo.modules.change-model-order', [
|
|
||||||
'routeName' => 'advice',
|
|
||||||
'models' => $adviceModels,
|
|
||||||
'model' => $adviceModel,
|
|
||||||
])
|
|
||||||
@endif
|
|
||||||
<td class="text-end align-middle">
|
<td class="text-end align-middle">
|
||||||
<form class="btn-group confirmDeleteTS" action="{{ route('bo.advice.destroy', $adviceModel->id) }}"
|
<form class="btn-group confirmDeleteTS" action="{{ route('bo.advice.destroy', $adviceModel->id) }}"
|
||||||
method="POST" novalidate>
|
method="POST" novalidate>
|
||||||
|
|
|
||||||
|
|
@ -40,11 +40,6 @@
|
||||||
'published' => __('validation.attributes.published'),
|
'published' => __('validation.attributes.published'),
|
||||||
'updated_at' => __('validation.attributes.updated_at'),
|
'updated_at' => __('validation.attributes.updated_at'),
|
||||||
]);
|
]);
|
||||||
if (request()->range) {
|
|
||||||
$cols = array_merge($cols, [
|
|
||||||
'order' => Str::ucfirst(__('validation.attributes.order'))
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
@endphp
|
@endphp
|
||||||
@include('bo.modules.table-col-sorter', [
|
@include('bo.modules.table-col-sorter', [
|
||||||
'cols' => $cols,
|
'cols' => $cols,
|
||||||
|
|
@ -69,16 +64,7 @@
|
||||||
'model' => $productModel,
|
'model' => $productModel,
|
||||||
])
|
])
|
||||||
<td class="text-center align-middle"><span class="badge bg-secondary">{{ $productModel->updated_at }}</span></td>
|
<td class="text-center align-middle"><span class="badge bg-secondary">{{ $productModel->updated_at }}</span></td>
|
||||||
@php
|
|
||||||
$routeName = request()->route()->getName();
|
|
||||||
@endphp
|
|
||||||
@if (empty(request()->search) && request()->range)
|
|
||||||
@include('bo.modules.change-model-order', [
|
|
||||||
'routeName' => 'products',
|
|
||||||
'models' => $productModels,
|
|
||||||
'model' => $productModel,
|
|
||||||
])
|
|
||||||
@endif
|
|
||||||
<td class="text-end align-middle">
|
<td class="text-end align-middle">
|
||||||
<form class="btn-group confirmDeleteTS" action="{{ route('bo.products.destroy', $productModel->id) }}"
|
<form class="btn-group confirmDeleteTS" action="{{ route('bo.products.destroy', $productModel->id) }}"
|
||||||
method="POST" novalidate>
|
method="POST" novalidate>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue