Merge branch 'le-gaulois-2024' into trunk
This commit is contained in:
commit
eaf7694374
143 changed files with 2801 additions and 902 deletions
|
|
@ -41,7 +41,7 @@ enum MenuNodeType: int
|
|||
private const ROUTENAMES = [
|
||||
// FIXME: Change this when adding routes.
|
||||
self::ourProducts->name => 'fo.contact.show',
|
||||
self::ourRecipes->name => 'fo.contact.show',
|
||||
self::ourRecipes->name => 'fo.recipes.index',
|
||||
self::ourCommitments->name => 'fo.contact.show',
|
||||
self::siteLogo->name => '',
|
||||
self::breedings->name => 'fo.contact.show',
|
||||
|
|
|
|||
|
|
@ -13,7 +13,8 @@ enum SettingsType: int
|
|||
|
||||
case mainMenu = 1;
|
||||
case hotNews = 2;
|
||||
case recipe = 3;
|
||||
case recipes = 3;
|
||||
case recipe = 4;
|
||||
|
||||
/**
|
||||
* Optionnal labels definition.
|
||||
|
|
@ -23,6 +24,7 @@ enum SettingsType: int
|
|||
private const LABELS = [
|
||||
self::mainMenu->name => 'Menu principal',
|
||||
self::hotNews->name => 'Infos chaudes',
|
||||
self::recipe->name => 'Page recette',
|
||||
self::recipes->name => 'Page des recettes',
|
||||
self::recipe->name => 'Page d\'une recette',
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ enum StaticPageType: int
|
|||
self::legals->name => 'Mentions légales',
|
||||
self::confidentiality->name => 'Confidentialité',
|
||||
self::recruitment->name => 'Recrutement',
|
||||
self::story->name => 'Qui sommes nous ?',
|
||||
self::story->name => 'Qui sommes-nous ?',
|
||||
self::saga->name => 'Saga publicitaire',
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,14 +96,18 @@ class ApproachController extends Controller
|
|||
return redirect()->route('bo.approaches.edit', $approach)
|
||||
->with('success', trans('crud.messages.has_been_created', [
|
||||
'model' => Str::ucfirst(
|
||||
trans_choice($approach->type ? 'validation.custom.demarche' : 'validation.custom.label', 1)
|
||||
trans(ApproachTypeEnum::demarche->equals($approach->type)
|
||||
? 'validation.custom.demarche'
|
||||
: 'validation.custom.label')
|
||||
)
|
||||
]));
|
||||
}
|
||||
return redirect()->back()
|
||||
->with('error', trans('crud.messages.cannot_be_created', [
|
||||
'model' => Str::ucfirst(
|
||||
trans_choice($approach->type ? 'validation.custom.demarche' : 'validation.custom.label', 1)
|
||||
trans(ApproachTypeEnum::demarche->equals($approach->type)
|
||||
? 'validation.custom.demarche'
|
||||
: 'validation.custom.label')
|
||||
)
|
||||
]));
|
||||
});
|
||||
|
|
@ -136,14 +140,18 @@ class ApproachController extends Controller
|
|||
return redirect()->route('bo.approaches.edit', $approach)
|
||||
->with('success', trans('crud.messages.has_been_updated', [
|
||||
'model' => Str::ucfirst(
|
||||
trans_choice($approach->type ? 'validation.custom.demarche' : 'validation.custom.label', 1)
|
||||
trans(ApproachTypeEnum::demarche->equals($approach->type)
|
||||
? 'validation.custom.demarche'
|
||||
: 'validation.custom.label')
|
||||
)
|
||||
]));
|
||||
}
|
||||
return redirect()->route('bo.approaches.edit', $approach)
|
||||
->with('error', trans('crud.messages.cannot_be_updated', [
|
||||
'model' => Str::ucfirst(
|
||||
trans_choice($approach->type ? 'validation.custom.demarche' : 'validation.custom.label', 1)
|
||||
trans(ApproachTypeEnum::demarche->equals($approach->type)
|
||||
? 'validation.custom.demarche'
|
||||
: 'validation.custom.label')
|
||||
)
|
||||
]));
|
||||
});
|
||||
|
|
@ -166,14 +174,18 @@ class ApproachController extends Controller
|
|||
$previousQueries
|
||||
))->with('success', trans('crud.messages.has_been_deleted', [
|
||||
'model' => Str::ucfirst(
|
||||
trans_choice($approach->type ? 'validation.custom.demarche' : 'validation.custom.label', 1)
|
||||
trans(ApproachTypeEnum::demarche->equals($approach->type)
|
||||
? 'validation.custom.demarche'
|
||||
: 'validation.custom.label')
|
||||
)
|
||||
]));
|
||||
}
|
||||
return redirect()->back()
|
||||
->with('error', trans('crud.messages.cannot_be_deleted', [
|
||||
'model' => Str::ucfirst(
|
||||
trans_choice($approach->type ? 'validation.custom.demarche' : 'validation.custom.label', 1)
|
||||
trans(ApproachTypeEnum::demarche->equals($approach->type)
|
||||
? 'validation.custom.demarche'
|
||||
: 'validation.custom.label')
|
||||
)
|
||||
]));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,12 +91,12 @@ class ConsumptionMomentController extends Controller
|
|||
if ($consumptionMoment->saveOrFail()) {
|
||||
return redirect()->route('bo.consumption_moments.edit', $consumptionMoment)
|
||||
->with('success', __('crud.messages.has_been_created', [
|
||||
'model' => Str::ucfirst(__('models.classes.consumption_moment'))
|
||||
'model' => Str::ucfirst(trans_choice('models.classes.consumption_moment', 1))
|
||||
]));
|
||||
}
|
||||
return redirect()->back()
|
||||
->with('error', __('crud.messages.cannot_be_created', [
|
||||
'model' => Str::ucfirst(__('models.classes.consumption_moment'))
|
||||
'model' => Str::ucfirst(trans_choice('models.classes.consumption_moment', 1))
|
||||
]));
|
||||
});
|
||||
}
|
||||
|
|
@ -129,12 +129,12 @@ class ConsumptionMomentController extends Controller
|
|||
if ($consumptionMoment->saveOrFail()) {
|
||||
return redirect()->route('bo.consumption_moments.edit', $consumptionMoment)
|
||||
->with('success', __('crud.messages.has_been_updated', [
|
||||
'model' => Str::ucfirst(__('models.classes.consumption_moment'))
|
||||
'model' => Str::ucfirst(trans_choice('models.classes.consumption_moment', 1))
|
||||
]));
|
||||
}
|
||||
return redirect()->route('bo.consumption_moments.edit', $consumptionMoment)
|
||||
->with('error', __('crud.messages.cannot_be_updated', [
|
||||
'model' => Str::ucfirst(__('models.classes.consumption_moment'))
|
||||
'model' => Str::ucfirst(trans_choice('models.classes.consumption_moment', 1))
|
||||
]));
|
||||
});
|
||||
}
|
||||
|
|
@ -153,12 +153,12 @@ class ConsumptionMomentController extends Controller
|
|||
if ($consumptionMoment->deleteOrFail()) {
|
||||
return redirect()->route('bo.consumption_moments.index', $previousQueries)
|
||||
->with('success', __('crud.messages.has_been_deleted', [
|
||||
'model' => Str::ucfirst(__('models.classes.consumption_moment'))
|
||||
'model' => Str::ucfirst(trans_choice('models.classes.consumption_moment', 1))
|
||||
]));
|
||||
}
|
||||
return redirect()->back()
|
||||
->with('error', __('crud.messages.cannot_be_deleted', [
|
||||
'model' => Str::ucfirst(__('models.classes.consumption_moment'))
|
||||
'model' => Str::ucfirst(trans_choice('models.classes.consumption_moment', 1))
|
||||
]));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,8 +7,6 @@ use App\Http\Controllers\Controller;
|
|||
use App\Http\Requests\Bo\GeneralSettings\UpdateGeneralSettingRequest;
|
||||
use App\Lib\Helpers\FileStorageHelper;
|
||||
use App\Models\GeneralSetting;
|
||||
use Illuminate\Database\Query\Builder;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
|
|
@ -22,42 +20,6 @@ class GeneralSettingController extends Controller
|
|||
$this->authorizeResource(GeneralSetting::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
*/
|
||||
public function index(Request $request): \Illuminate\Contracts\View\View
|
||||
{
|
||||
/** @var \Illuminate\Database\Eloquent\Builder $query */
|
||||
$query = GeneralSetting::query();
|
||||
|
||||
/** @var string $search Search field */
|
||||
$search = $request->search;
|
||||
if ($search) {
|
||||
$this->searchQuery(
|
||||
$query,
|
||||
$search,
|
||||
fn (Builder $q) => $q->whereIn('type', collect(SettingsType::all())
|
||||
->filter(fn (SettingsType $type) => str($type->label())->contains($search) or
|
||||
str($type->value())->contains($search))),
|
||||
'type',
|
||||
);
|
||||
}
|
||||
$searchFields = \implode(', ', [
|
||||
trans('validation.custom.general_setting_type'),
|
||||
]);
|
||||
|
||||
/** Sort columns with a query */
|
||||
$this->sortQuery($query);
|
||||
|
||||
/** Custom pagination */
|
||||
$generalSettingsModelList = $this->paginate($query);
|
||||
|
||||
return view('bo.pages.general_settings.index', compact('generalSettingsModelList', 'search', 'searchFields'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
|
|
@ -82,7 +44,7 @@ class GeneralSettingController extends Controller
|
|||
): \Illuminate\Http\RedirectResponse {
|
||||
return DB::transaction(function () use ($request, $general_setting) {
|
||||
if ($general_setting->type === SettingsType::hotNews) {
|
||||
collect($request->only(['value->picture', 'value->text', 'value->picture_alt', 'value->picture_title']))
|
||||
collect($request->only(['value->text', 'value->picture', 'value->picture_alt', 'value->picture_title']))
|
||||
->each(fn (string|\Illuminate\Http\UploadedFile|null $value, string $attribute) =>
|
||||
$general_setting->setAttribute(
|
||||
$attribute,
|
||||
|
|
@ -90,9 +52,12 @@ class GeneralSettingController extends Controller
|
|||
FileStorageHelper::storeFile($general_setting, $value, true) :
|
||||
$value ?? json_decode(collect($general_setting->value))->picture
|
||||
));
|
||||
} elseif ($general_setting->type === SettingsType::recipes) {
|
||||
collect($request->only(['value->subtitle', 'value->text']))
|
||||
->each(fn (string $value, string $attribute) => $general_setting->setAttribute($attribute, $value));
|
||||
} elseif ($general_setting->type === SettingsType::recipe) {
|
||||
collect($request->only(['value->tips_title', 'value->recipes_title', 'value->text']))
|
||||
->each(fn (string $value, string $attribute) => $general_setting->setAttribute($attribute, $value));
|
||||
->each(fn (string $value, string $attribute) => $general_setting->setAttribute($attribute, $value));
|
||||
} else {
|
||||
$general_setting->fill($request->only('value'));
|
||||
} //end if
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ namespace App\Http\Controllers\Bo;
|
|||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\Bo\StaticPages\UpdateStaticPageRequest;
|
||||
use App\Models\StaticPage;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
|
|
@ -19,40 +18,6 @@ class StaticPageController extends Controller
|
|||
$this->authorizeResource(StaticPage::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
*/
|
||||
public function index(Request $request): \Illuminate\Contracts\View\View
|
||||
{
|
||||
/** @var \Illuminate\Database\Eloquent\Builder $query */
|
||||
$query = StaticPage::query();
|
||||
|
||||
/** @var string $search Search field */
|
||||
$search = $request->search;
|
||||
if ($search) {
|
||||
$this->searchQuery(
|
||||
$query,
|
||||
$search,
|
||||
null,
|
||||
'title',
|
||||
);
|
||||
}
|
||||
$searchFields = \implode(', ', [
|
||||
trans('validation.attributes.title'),
|
||||
]);
|
||||
|
||||
/** Sort columns with a query */
|
||||
$this->sortQuery($query);
|
||||
|
||||
/** Custom pagination */
|
||||
$staticPageModelList = $this->paginate($query);
|
||||
|
||||
return view('bo.pages.static_pages.index', compact('staticPageModelList', 'search', 'searchFields'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ use App\Models\MainSlide;
|
|||
use App\Models\Product;
|
||||
use App\Models\GeneralSetting;
|
||||
use App\Models\Recipe;
|
||||
use App\Models\Video;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use LDC\LDCCRM\Enums\ApiError;
|
||||
use LDC\LDCCRM\Exceptions\ApiErrorException;
|
||||
|
|
@ -40,13 +41,15 @@ class HomeController extends Controller
|
|||
'products.submeats',
|
||||
'consumptionMoment'
|
||||
])->limit(9)->get();
|
||||
$videoModels = Video::query()->where('published', true)->where('is_on_homepage', true)->orderBy('order', 'ASC')->with('product')->limit(9)->get();
|
||||
return view('fo.pages.home', compact(
|
||||
'mainSlideModels',
|
||||
'demarcheSlideModels',
|
||||
'productViews',
|
||||
'newsModels',
|
||||
'recipeModels',
|
||||
'hotNewsSettings'
|
||||
'hotNewsSettings',
|
||||
'videoModels'
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,27 +5,66 @@ namespace App\Http\Controllers\Fo;
|
|||
use App\Enums\Settings\SettingsType;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Resources\Fo\Recipes\RecipeCommericalSheetResource;
|
||||
use App\Models\ConsumptionMoment;
|
||||
use App\Models\GeneralSetting;
|
||||
use App\Models\Meat;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use App\Models\Recipe;
|
||||
use App\Models\Submeat;
|
||||
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Pagination\LengthAwarePaginator as LengthAwarePaginatorCustom;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class RecipeController extends Controller
|
||||
{
|
||||
/**
|
||||
* Get recipes by a specific range into a json response.
|
||||
* Use for pagination,
|
||||
* number of recipe models per page.
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
* @var integer
|
||||
*/
|
||||
public function index(): \Illuminate\Contracts\View\View
|
||||
{
|
||||
$recipeModels = Recipe::query()->where('published', true)->get();
|
||||
return view('fo.pages.recipes.index', ['recipeModel' => $recipeModels]);
|
||||
}
|
||||
private $recipeModelsPerPage = 8;
|
||||
|
||||
/**
|
||||
* Get recipes by a specific range into a json response.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Pagination\LengthAwarePaginator|null $recipeModelsFiltered
|
||||
* @param \Illuminate\Support\Collection<\App\Models\Submeat>|null $submeatModelsFiltered
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
*/
|
||||
public function index(
|
||||
LengthAwarePaginator $recipeModelsFiltered = null,
|
||||
Collection $submeatModelsFiltered = null,
|
||||
): \Illuminate\Contracts\View\View {
|
||||
/** @var \Illuminate\Contracts\Pagination\LengthAwarePaginator $recipeModels */
|
||||
$recipeModels = $recipeModelsFiltered ?? Recipe::query()
|
||||
->with(['products', 'products.submeats', 'consumptionMoment'])
|
||||
->where('published', true)
|
||||
->orderBy('slug')
|
||||
->paginate($this->recipeModelsPerPage);
|
||||
$recipeModel = Recipe::query()->where('published', true)->where('highlight', true)->first();
|
||||
$generalSettingModel = GeneralSetting::query()->where('type', SettingsType::recipes)->first();
|
||||
$consumptionMomentModels = ConsumptionMoment::query()->orderBy('slug')->get();
|
||||
$meatModels = Meat::query()->where('published', true)->with('submeats')->orderBy('slug')->get();
|
||||
$submeatModels = $submeatModelsFiltered ??
|
||||
Submeat::query()->where('published', true)->orderBy('slug')->get();
|
||||
|
||||
return view('fo.pages.recipes.index', [
|
||||
'viewsPaginate' => $this->getViewsFromPaginateModels($recipeModels),
|
||||
'recipeModel' => $recipeModel,
|
||||
'generalSettingModel' => $generalSettingModel,
|
||||
'consumptionMomentModels' => $consumptionMomentModels,
|
||||
'meatModels' => $meatModels,
|
||||
'submeatModels' => $submeatModels,
|
||||
'searchPropositions' => $this->getRecipeModelsTitles(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the view of a specific recipe.
|
||||
*
|
||||
* @param string $slug
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
*/
|
||||
|
|
@ -47,7 +86,230 @@ class RecipeController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Get recipes by a specific range into a json response.
|
||||
* Get recipe models titles for search input propositions.
|
||||
*
|
||||
* @param string|null $search
|
||||
* @return \Illuminate\Pagination\LengthAwarePaginator
|
||||
*/
|
||||
public function getRecipeModelsTitles(string|null $search = null): \Illuminate\Pagination\LengthAwarePaginator
|
||||
{
|
||||
$recipeModelsTitles = [];
|
||||
Recipe::query()
|
||||
->with(['products', 'products.submeats', 'consumptionMoment'])
|
||||
->when(!is_null($search), function (Builder $q) use ($search) {
|
||||
$q->where('title', 'like', "%{$search}%");
|
||||
})
|
||||
->where('published', true)
|
||||
->inRandomOrder()
|
||||
->pluck('title')
|
||||
->each(function (string $title) use (&$recipeModelsTitles, $search) {
|
||||
if (count($recipeModelsTitles) < 5) {
|
||||
foreach (explode(" ", $title) as $word) {
|
||||
$word = Str::lower($word);
|
||||
if (
|
||||
strlen($word) > 3
|
||||
&& !in_array($word, $recipeModelsTitles)
|
||||
&& ((!is_null($search)) ? str_contains($word, $search) : true)
|
||||
) {
|
||||
$recipeModelsTitles[] = $word;
|
||||
}
|
||||
}
|
||||
return $recipeModelsTitles;
|
||||
}
|
||||
})
|
||||
->toArray();
|
||||
\sort($recipeModelsTitles);
|
||||
$titles = array_slice($recipeModelsTitles, 0, 5);
|
||||
return new LengthAwarePaginatorCustom($titles, count($titles), (count($titles) <= 0) ? 1 : count($titles));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of words for the search input propositions.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function getWordsList(Request $request): \Illuminate\Http\JsonResponse
|
||||
{
|
||||
return response()->json($this->getRecipeModelsTitles($request->input('search')));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get recipes by specific words,
|
||||
* the response can be a json or a view.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\JsonResponse|\Illuminate\Contracts\View\View
|
||||
*/
|
||||
public function getRecipesByWords(Request $request): \Illuminate\Http\JsonResponse|\Illuminate\Contracts\View\View
|
||||
{
|
||||
/** @var \Illuminate\Database\Eloquent\Builder $recipeModels */
|
||||
$recipeModels = Recipe::query()
|
||||
->with(['products', 'products.submeats', 'consumptionMoment'])
|
||||
->where('published', true);
|
||||
|
||||
/** @var string $search Search field */
|
||||
$search = $request->input('words');
|
||||
if ($search) {
|
||||
$this->searchQuery(
|
||||
$recipeModels,
|
||||
str_replace(",", " ", $request->input('words')),
|
||||
null,
|
||||
'title',
|
||||
);
|
||||
}
|
||||
$recipeModels = $recipeModels->paginate($this->recipeModelsPerPage);
|
||||
|
||||
if ($request->ajax()) {
|
||||
return response()->json([
|
||||
'viewsPaginate' => $this->getViewsFromPaginateModels($recipeModels),
|
||||
'children' => [],
|
||||
]);
|
||||
}
|
||||
return $this->index($recipeModels, collect());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get recipes by a specific consumption_moment,
|
||||
* the response can be a json or a view.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\JsonResponse|\Illuminate\Contracts\View\View
|
||||
*/
|
||||
public function getRecipesByConsumptionMoment(
|
||||
Request $request
|
||||
): \Illuminate\Http\JsonResponse|\Illuminate\Contracts\View\View {
|
||||
$consumptionMomentModel = ConsumptionMoment::query()
|
||||
->where('slug', $request->model_slug)
|
||||
->first();
|
||||
$recipeModels = Recipe::query()
|
||||
->with(['products', 'products.submeats', 'consumptionMoment'])
|
||||
->when(!is_null($consumptionMomentModel), function (Builder $q) use ($consumptionMomentModel) {
|
||||
$q->where('consumption_moment_id', $consumptionMomentModel->getKey());
|
||||
})
|
||||
->where('published', true)
|
||||
->orderBy('slug')
|
||||
->paginate($this->recipeModelsPerPage);
|
||||
if ($request->ajax()) {
|
||||
return response()->json([
|
||||
'viewsPaginate' => $this->getViewsFromPaginateModels($recipeModels),
|
||||
'children' => [],
|
||||
]);
|
||||
}
|
||||
return $this->index($recipeModels, collect());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get recipes by a specific meat,
|
||||
* the response can be a json or a view.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\JsonResponse|\Illuminate\Contracts\View\View
|
||||
*/
|
||||
public function getRecipesByMeat(
|
||||
Request $request
|
||||
): \Illuminate\Http\JsonResponse|\Illuminate\Contracts\View\View {
|
||||
$meatModel = Meat::query()
|
||||
->where('slug', $request->model_slug)
|
||||
->where('published', true)
|
||||
->first();
|
||||
$submeatModels = Submeat::query()
|
||||
->when(!is_null($meatModel), function (Builder $q) use ($meatModel) {
|
||||
$q->where('meat_id', $meatModel->getKey());
|
||||
})
|
||||
->where('published', true)
|
||||
->orderBy('slug')
|
||||
->get();
|
||||
$recipeModels = Recipe::query()
|
||||
->with(['products', 'products.submeats', 'consumptionMoment'])
|
||||
->where('published', true)
|
||||
->when(!is_null($meatModel), function (Builder $q) use ($meatModel) {
|
||||
$q->whereHas('products', function (Builder $q) use ($meatModel) {
|
||||
$q->whereHas('meats', function (Builder $q) use ($meatModel) {
|
||||
$q->where('published', true)->where('id', $meatModel->getKey());
|
||||
})->orWhereHas('submeats', function (Builder $q) use ($meatModel) {
|
||||
$q->where('published', true)->whereIn('id', $meatModel->submeats->pluck('id')->toArray());
|
||||
});
|
||||
});
|
||||
})
|
||||
->orderBy('slug')
|
||||
->paginate($this->recipeModelsPerPage);
|
||||
if ($request->ajax()) {
|
||||
return response()->json([
|
||||
'viewsPaginate' => $this->getViewsFromPaginateModels($recipeModels),
|
||||
'children' => $submeatModels,
|
||||
]);
|
||||
}
|
||||
return $this->index($recipeModels, $submeatModels);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get recipes by a specific submeat,
|
||||
* the response can be a json or a view.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\JsonResponse|\Illuminate\Contracts\View\View
|
||||
*/
|
||||
public function getRecipesBySubmeat(
|
||||
Request $request
|
||||
): \Illuminate\Http\JsonResponse|\Illuminate\Contracts\View\View {
|
||||
$meatModel = Meat::query()
|
||||
->where('slug', $request->model_slug)
|
||||
->where('published', true)
|
||||
->first();
|
||||
$submeatModel = Submeat::query()
|
||||
->when(!is_null($meatModel), function (Builder $q) use ($meatModel) {
|
||||
$q->where('meat_id', $meatModel->getKey());
|
||||
})
|
||||
->where('slug', $request->child_slug)
|
||||
->where('published', true)
|
||||
->first();
|
||||
$submeatModels = Submeat::query()
|
||||
->when(!is_null($meatModel), function (Builder $q) use ($meatModel) {
|
||||
$q->where('meat_id', $meatModel->getKey());
|
||||
})
|
||||
->where('published', true)
|
||||
->orderBy('slug')
|
||||
->get();
|
||||
$recipeModels = Recipe::query()
|
||||
->with(['products', 'products.submeats', 'consumptionMoment'])
|
||||
->where('published', true)
|
||||
->when(!is_null($submeatModel), function (Builder $q) use ($submeatModel) {
|
||||
$q->whereHas('products', function (Builder $q) use ($submeatModel) {
|
||||
$q->whereHas('submeats', function (Builder $q) use ($submeatModel) {
|
||||
$q->where('published', true)->where('id', $submeatModel->getKey());
|
||||
});
|
||||
});
|
||||
})
|
||||
->orderBy('slug')
|
||||
->paginate($this->recipeModelsPerPage);
|
||||
if ($request->ajax()) {
|
||||
return response()->json([
|
||||
'viewsPaginate' => $this->getViewsFromPaginateModels($recipeModels),
|
||||
'children' => [],
|
||||
]);
|
||||
}
|
||||
return $this->index($recipeModels, $submeatModels);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an array of views for each recipe models given.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Pagination\LengthAwarePaginator $recipeModels
|
||||
* @return array
|
||||
*/
|
||||
public function getViewsFromPaginateModels(LengthAwarePaginator $recipeModels): array
|
||||
{
|
||||
// @phpstan-ignore-next-line
|
||||
return $recipeModels->through(function ($recipeModel) {
|
||||
return view('fo.partials.recipe-card', ['recipeModel' => $recipeModel])->render();
|
||||
})->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get recipes by a selected recipe model,
|
||||
* filtered first by products associated,
|
||||
* by meats/submeats and finally by consumption moment.
|
||||
*
|
||||
* @param \App\Models\Recipe $recipeModel
|
||||
* @return \Illuminate\Support\Collection
|
||||
|
|
@ -66,9 +328,9 @@ class RecipeController extends Controller
|
|||
->where('published', true)
|
||||
->whereHas('products', function (Builder $q) use ($recipeProducts) {
|
||||
$q->where('id', $recipeProducts[0])
|
||||
->when(isset($recipeProducts[1]), function (Builder $q) use ($recipeProducts) {
|
||||
$q->orWhere('id', $recipeProducts[1]);
|
||||
});
|
||||
->when(isset($recipeProducts[1]), function (Builder $q) use ($recipeProducts) {
|
||||
$q->orWhere('id', $recipeProducts[1]);
|
||||
});
|
||||
})
|
||||
->get();
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,12 @@
|
|||
|
||||
namespace App\Http\Requests\Bo\Approaches;
|
||||
|
||||
use App\Enums\Approaches\ApproachTypeEnum;
|
||||
use App\Models\Approach;
|
||||
use App\Traits\Requests\HasPicture;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\Validation\Rules\Enum;
|
||||
|
||||
class StoreApproachRequest extends FormRequest
|
||||
{
|
||||
|
|
@ -43,7 +45,7 @@ class StoreApproachRequest extends FormRequest
|
|||
public function rules(): array
|
||||
{
|
||||
$rules = [
|
||||
'type' => 'required|numeric|between:0,1',
|
||||
'type' => ['required', new Enum(ApproachTypeEnum::class)],
|
||||
'name' => 'required|string|between:3,255',
|
||||
'picture_alt' => 'required_with:picture|nullable|between:3,255',
|
||||
'picture_title' => 'required_with:picture|nullable|between:3,255',
|
||||
|
|
|
|||
|
|
@ -6,6 +6,22 @@ use Illuminate\Support\Facades\Gate;
|
|||
|
||||
class UpdateApproachRequest extends StoreApproachRequest
|
||||
{
|
||||
/**
|
||||
* Prepare the data for validation.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function prepareForValidation(): void
|
||||
{
|
||||
/** @var \App\Models\Approach $approachModel */
|
||||
$approachModel = $this->route()->parameter('approach');
|
||||
$this->merge([
|
||||
'type' => intval($approachModel->type->value),
|
||||
'published' => $this->boolean('published')
|
||||
]);
|
||||
$this->mergePicture('picture');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -36,12 +36,18 @@ class UpdateGeneralSettingRequest extends FormRequest
|
|||
$generalSettingModel = $this->route('general_setting');
|
||||
if ($generalSettingModel->type === SettingsType::hotNews) {
|
||||
$this->mergePicture('picture');
|
||||
$this->merge(['value->picture' => $this->file('picture'),
|
||||
$this->merge([
|
||||
'value->text' => $this->input('text'),
|
||||
'value->picture' => $this->file('picture'),
|
||||
'value->picture_alt' => $this->input('picture_alt'),
|
||||
'value->picture_title' => $this->input('picture_title'),
|
||||
]);
|
||||
return;
|
||||
} elseif ($generalSettingModel->type === SettingsType::recipes) {
|
||||
$this->merge(['value->subtitle' => $this->input('subtitle'),
|
||||
'value->text' => $this->input('text'),
|
||||
]);
|
||||
return;
|
||||
} elseif ($generalSettingModel->type === SettingsType::recipe) {
|
||||
$this->merge([
|
||||
'value->tips_title' => $this->input('tips_title'),
|
||||
|
|
@ -49,7 +55,7 @@ class UpdateGeneralSettingRequest extends FormRequest
|
|||
'value->text' => $this->input('text'),
|
||||
]);
|
||||
return;
|
||||
}
|
||||
} //end if
|
||||
$this->merge([
|
||||
'value' => collect(json_decode($this->input('jsonValue', '[]'), true))->map(function ($element) {
|
||||
$element['published'] = (array_key_exists('published', $element)) ? $element['published'] : false;
|
||||
|
|
@ -75,8 +81,13 @@ class UpdateGeneralSettingRequest extends FormRequest
|
|||
];
|
||||
return \array_merge(
|
||||
$rules,
|
||||
$this->pictureRules('picture', 200, 100, 200, 100, false),
|
||||
$this->pictureRules('picture', 200, 100, 200, 100),
|
||||
);
|
||||
} elseif ($generalSettingModel->type === SettingsType::recipes) {
|
||||
return [
|
||||
'subtitle' => 'required|string|between:3,255',
|
||||
'text' => ['required', 'string', new WysiwygLength(3)],
|
||||
];
|
||||
} elseif ($generalSettingModel->type === SettingsType::recipe) {
|
||||
return [
|
||||
'tips_title' => 'required|string|between:3,255',
|
||||
|
|
@ -138,6 +149,7 @@ class UpdateGeneralSettingRequest extends FormRequest
|
|||
'picture_title' => trans('validation.custom.attribute_title'),
|
||||
'tips_title' => trans('validation.attributes.title'),
|
||||
'recipes_title' => trans('validation.attributes.title'),
|
||||
'subtitle' => trans('validation.custom.subtitle'),
|
||||
'value' => trans('validation.custom.value'),
|
||||
'value.*.type' => trans(':field :internoeud', [
|
||||
'field' => trans('validation.custom.type'),
|
||||
|
|
|
|||
|
|
@ -2,12 +2,15 @@
|
|||
|
||||
namespace App\Http\Requests\Bo\StaticPages;
|
||||
|
||||
use App\Traits\Requests\HasPicture;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class UpdateStaticPageRequest extends FormRequest
|
||||
{
|
||||
use HasPicture;
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
|
|
@ -26,8 +29,10 @@ class UpdateStaticPageRequest extends FormRequest
|
|||
public function prepareForValidation(): void
|
||||
{
|
||||
$this->merge([
|
||||
'content' => Str::of($this->input('content'))->value()
|
||||
'content' => Str::of($this->input('content'))->value(),
|
||||
'subtitle' => Str::of($this->input('subtitle'))->value(),
|
||||
]);
|
||||
$this->mergePicture('picture');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -37,12 +42,20 @@ class UpdateStaticPageRequest extends FormRequest
|
|||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
$rules = [
|
||||
'seo_title' => 'required|min:45|max:70',
|
||||
'seo_description' => 'required|min:50|max:160',
|
||||
'title' => 'required|min:3|max:255',
|
||||
'subtitle' => 'present',
|
||||
'content' => 'present',
|
||||
'picture' => 'required',
|
||||
'picture_alt' => 'required_with:picture|between:3,255',
|
||||
'picture_title' => 'required_with:picture|between:3,255',
|
||||
];
|
||||
return \array_merge(
|
||||
$rules,
|
||||
$this->pictureRules('picture', 720, 405, 720, 405),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -56,7 +69,11 @@ class UpdateStaticPageRequest extends FormRequest
|
|||
'seo_title' => trans('validation.custom.seo_title'),
|
||||
'seo_description' => trans('validation.custom.seo_description'),
|
||||
'title' => trans('validation.attributes.title'),
|
||||
'subtitle' => trans('validation.custom.subtitle'),
|
||||
'content' => trans('validation.attributes.content'),
|
||||
'picture' => trans('validation.attributes.image'),
|
||||
'picture_alt' => trans('validation.custom.attribute_alt'),
|
||||
'picture_title' => trans('validation.custom.attribute_title'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,20 +2,21 @@
|
|||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Enums\Approaches\ApproachTypeEnum;
|
||||
use App\Lib\Helpers\FileStorageHelper;
|
||||
use App\Traits\Models\ActivityLog;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* @property int $type Approach type (label or demarche).
|
||||
* @property string $name Approach name.
|
||||
* @property string $picture Approach picture.
|
||||
* @property string $picture_alt Picture alt attribute.
|
||||
* @property string $picture_title Picture title attribute.
|
||||
* @property boolean $published Approach publication status.
|
||||
* @property-read \Carbon\Carbon $created_at Created date.
|
||||
* @property-read \Carbon\Carbon $updated_at Updated date.
|
||||
* @property \App\Enums\Approaches\ApproachTypeEnum $type Approach type (label or demarche).
|
||||
* @property string $name Approach name.
|
||||
* @property string $picture Approach picture.
|
||||
* @property string $picture_alt Picture alt attribute.
|
||||
* @property string $picture_title Picture title attribute.
|
||||
* @property boolean $published Approach publication status.
|
||||
* @property-read \Carbon\Carbon $created_at Created date.
|
||||
* @property-read \Carbon\Carbon $updated_at Updated date.
|
||||
*/
|
||||
class Approach extends Model
|
||||
{
|
||||
|
|
@ -42,6 +43,7 @@ class Approach extends Model
|
|||
* @var array<string, string>
|
||||
*/
|
||||
protected $casts = [
|
||||
'type' => ApproachTypeEnum::class,
|
||||
'published' => 'boolean'
|
||||
];
|
||||
|
||||
|
|
@ -55,7 +57,7 @@ class Approach extends Model
|
|||
static::creating(function (self $approach) {
|
||||
$approach->picture = FileStorageHelper::storeFile($approach, $approach->picture, true);
|
||||
});
|
||||
static::updated(function (self $approach) {
|
||||
static::updating(function (self $approach) {
|
||||
$approach->picture = FileStorageHelper::storeFile($approach, $approach->picture, true);
|
||||
});
|
||||
static::updated(function (self $approach) {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||
|
||||
/**
|
||||
* @property string $title Title of the consumption moment.
|
||||
* @property string $slug Slug of the consumption moment title.
|
||||
* @property-read \Illuminate\Support\Carbon $created_at Created date.
|
||||
* @property-read \Illuminate\Support\Carbon $updated_at Updated date.
|
||||
*/
|
||||
|
|
@ -23,5 +24,6 @@ class ConsumptionMoment extends Model
|
|||
*/
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'slug',
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -148,13 +148,17 @@ class GeneralSetting extends Model
|
|||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||
(new Link(routeName: $nodeType->routeName()))->toArray() : (new Link(url: 'https://example.net'))->toArray()
|
||||
))->all(),
|
||||
SettingsType::hotNews => [
|
||||
SettingsType::hotNews => [
|
||||
'text' => 'le texte',
|
||||
'picture' => null,
|
||||
'picture_alt' => 'le texte alt de l\'image',
|
||||
'picture_title' => 'le titre de l\'image',
|
||||
'text' => 'le texte',
|
||||
],
|
||||
SettingsType::recipe => [
|
||||
SettingsType::recipes => [
|
||||
'subtitle' => 'le sous-titre des recettes',
|
||||
'text' => 'le texte des recettes',
|
||||
],
|
||||
SettingsType::recipe => [
|
||||
'tips_title' => 'le titre de l\'astuce',
|
||||
'recipes_title' => 'le titre des autres recettes',
|
||||
'text' => 'le texte des autres recettes',
|
||||
|
|
@ -178,8 +182,9 @@ class GeneralSetting extends Model
|
|||
return match ($type) {
|
||||
SettingsType::mainMenu => collect(json_decode($json, true))
|
||||
->map(fn (array $jsonLayout) => MenuNode::make(...$jsonLayout))->all(),
|
||||
SettingsType::hotNews => json_decode($json, true),
|
||||
SettingsType::recipe => json_decode($json, true),
|
||||
SettingsType::hotNews => json_decode($json, true),
|
||||
SettingsType::recipes => json_decode($json, true),
|
||||
SettingsType::recipe => json_decode($json, true),
|
||||
// @phpstan-ignore-next-line
|
||||
default => throw new \ErrorException("No instruction to unserialize setting type '{$type->label()}'")
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
namespace App\Models;
|
||||
|
||||
use App\Enums\StaticPageType;
|
||||
use App\Lib\Helpers\FileStorageHelper;
|
||||
use App\Lib\Helpers\ToolboxHelper;
|
||||
use App\Traits\Models\ActivityLog;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
|
@ -16,6 +17,10 @@ use Illuminate\Support\Str;
|
|||
* @property string $title Title for the page.
|
||||
* @property string $slug Slug of the title for the page.
|
||||
* @property string $content WYSIWYG text content using ckeditor.
|
||||
* @property string $picture Picture path.
|
||||
* @property string $picture_alt Picture alt.
|
||||
* @property string $picture_title Picture title.
|
||||
* @property string $subtitle The subtitle for the static page.
|
||||
* @property-read \Illuminate\Support\Carbon $created_at Created date.
|
||||
* @property-read \Illuminate\Support\Carbon $updated_at Updated date.
|
||||
*/
|
||||
|
|
@ -34,6 +39,10 @@ class StaticPage extends Model
|
|||
'seo_description',
|
||||
'title',
|
||||
'content',
|
||||
'picture',
|
||||
'picture_alt',
|
||||
'picture_title',
|
||||
'subtitle',
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -54,11 +63,19 @@ class StaticPage extends Model
|
|||
{
|
||||
static::creating(function (self $model) {
|
||||
self::assertTitleIsUnique($model->title);
|
||||
$model->slug = Str::slug($model->title);
|
||||
$model->slug = Str::slug($model->title);
|
||||
$model->picture = FileStorageHelper::storeFile($model, $model->picture, true);
|
||||
});
|
||||
static::updating(function (self $model) {
|
||||
self::assertTitleIsUnique($model->title, $model->id);
|
||||
$model->slug = Str::slug($model->title);
|
||||
$model->slug = Str::slug($model->title);
|
||||
$model->picture = FileStorageHelper::storeFile($model, $model->picture, true);
|
||||
});
|
||||
static::updated(function (self $model) {
|
||||
FileStorageHelper::removeOldFile($model, 'picture');
|
||||
});
|
||||
static::deleted(function (self $model) {
|
||||
FileStorageHelper::removeFile($model, 'picture');
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -54,8 +54,8 @@ class Video extends Model
|
|||
*/
|
||||
protected static function booted(): void
|
||||
{
|
||||
static::creating(function (self $keyNumber) {
|
||||
self::setOrder($keyNumber);
|
||||
static::creating(function (self $video) {
|
||||
self::setOrder($video);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,8 +2,12 @@
|
|||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Enums\Settings\SettingsType;
|
||||
use App\Enums\StaticPageType;
|
||||
use App\Models\GeneralSetting;
|
||||
use App\Models\Meat;
|
||||
use App\Models\Range;
|
||||
use App\Models\StaticPage;
|
||||
use Illuminate\Pagination\Paginator;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\File;
|
||||
|
|
@ -16,9 +20,11 @@ class ViewServiceProvider extends ServiceProvider
|
|||
* Bootstrap any application services.
|
||||
*
|
||||
* @return void
|
||||
* phpcs:disable Generic.Metrics.CyclomaticComplexity.TooHigh
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
// phpcs:enable
|
||||
$appInfos = Cache::remember('composer', 360, function () {
|
||||
return json_decode(File::get(\app_path('../composer.json')));
|
||||
});
|
||||
|
|
@ -31,11 +37,9 @@ class ViewServiceProvider extends ServiceProvider
|
|||
if (!app()->runningInConsole()) {
|
||||
// * FORCE BOOTSTRAP PAGINATOR (or custom if in front)
|
||||
// Early boot, request wont be filled as expected.
|
||||
if (collect(explode('/', \request()->getPathInfo()))->get(1) === 'bo') {
|
||||
Paginator::defaultView('bo.modules.pagination');
|
||||
} else {
|
||||
Paginator::useBootstrapFive();
|
||||
}
|
||||
(collect(explode('/', \request()->getPathInfo()))->get(1) === 'bo')
|
||||
? Paginator::defaultView('bo.modules.pagination')
|
||||
: Paginator::useBootstrapFive();
|
||||
|
||||
// * Inject actual view name
|
||||
View::composer('*', function ($view) {
|
||||
|
|
@ -54,22 +58,38 @@ class ViewServiceProvider extends ServiceProvider
|
|||
})());
|
||||
View::share('menuNodeDataList', app('menuNodeDataList'));
|
||||
|
||||
// * Inject first meat and range : needed for the bo menu.
|
||||
// * Inject configuration model
|
||||
View::share('mainMenuSettingModel', (function () {
|
||||
return GeneralSetting::query()->where('type', SettingsType::mainMenu)->first() ?: null;
|
||||
})());
|
||||
View::share('hotNewsSettingModel', (function () {
|
||||
return GeneralSetting::query()->where('type', SettingsType::hotNews)->first() ?: null;
|
||||
})());
|
||||
View::share('recipeSettingModel', (function () {
|
||||
return GeneralSetting::query()->where('type', SettingsType::recipe)->first() ?: null;
|
||||
})());
|
||||
View::share('recipesSettingModel', (function () {
|
||||
return GeneralSetting::query()->where('type', SettingsType::recipes)->first() ?: null;
|
||||
})());
|
||||
|
||||
// * Inject some data for the bo menu.
|
||||
View::share('firstMeat', (function () {
|
||||
/** @var \App\Models\Meat|null */
|
||||
$firstMeat = Meat::query()->first();
|
||||
if (!$firstMeat) {
|
||||
return null;
|
||||
}
|
||||
return $firstMeat;
|
||||
return Meat::query()->first() ?: null;
|
||||
})());
|
||||
View::share('firstRange', (function () {
|
||||
/** @var \App\Models\Range|null */
|
||||
$firstRange = Range::query()->first();
|
||||
if (!$firstRange) {
|
||||
return null;
|
||||
}
|
||||
return $firstRange;
|
||||
return Range::query()->first() ?: null;
|
||||
})());
|
||||
View::share('mainMenuMeatModels', (function () {
|
||||
return Meat::query()->where('published', true)->get();
|
||||
})());
|
||||
View::share('storyStaticPageModel', (function () {
|
||||
return StaticPage::query()->where('type', StaticPageType::story)->first() ?: null;
|
||||
})());
|
||||
View::share('recruitmentStaticPageModel', (function () {
|
||||
return StaticPage::query()->where('type', StaticPageType::recruitment)->first() ?: null;
|
||||
})());
|
||||
View::share('sagaStaticPageModel', (function () {
|
||||
return StaticPage::query()->where('type', StaticPageType::saga)->first() ?: null;
|
||||
})());
|
||||
} //end if
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class MeatFactory extends Factory
|
|||
*/
|
||||
public function definition()
|
||||
{
|
||||
$label = fake()->sentence();
|
||||
$label = fake()->words(rand(1, 2), true);
|
||||
return [
|
||||
'label' => $label,
|
||||
'slug' => Str::slug($label),
|
||||
|
|
|
|||
|
|
@ -4,7 +4,9 @@ namespace Database\Factories;
|
|||
|
||||
use App\Enums\Recipes\DifficultyEnum;
|
||||
use App\Models\ConsumptionMoment;
|
||||
use App\Models\Video;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class RecipeFactory extends Factory
|
||||
{
|
||||
|
|
@ -15,6 +17,7 @@ class RecipeFactory extends Factory
|
|||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
$title = fake()->words(3, true);
|
||||
$ingredientsList = [];
|
||||
$ingredientsListAmount = fake()->numberBetween(1, 5);
|
||||
for ($jj = 1; $jj <= $ingredientsListAmount; $jj++) {
|
||||
|
|
@ -27,15 +30,15 @@ class RecipeFactory extends Factory
|
|||
}
|
||||
|
||||
return [
|
||||
'slug' => fake()->slug(),
|
||||
'title' => fake()->words(3, true),
|
||||
'slug' => Str::slug($title),
|
||||
'title' => $title,
|
||||
'tips' => fake()->sentence(),
|
||||
'picture_alt' => fake()->words(8, true),
|
||||
'picture_title' => fake()->words(5, true),
|
||||
'advice' => fake()->sentence(),
|
||||
'preparation' => fake()->sentence(),
|
||||
'ingredients_list' => $ingredientsList,
|
||||
'video_id' => fake()->boolean(50) ? \collect(ConsumptionMoment::all())->random() : null,
|
||||
'video_id' => fake()->boolean(50) ? \collect(Video::all())->random() : null,
|
||||
'consumption_moment_id' => \collect(ConsumptionMoment::all())->random(),
|
||||
'preparation_time' => fake()->numberBetween(1, 100),
|
||||
'cooking_time' => fake()->numberBetween(1, 100),
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Database\Seeders\Development\BrandAdvantageSeeder;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
|
|
@ -28,10 +26,6 @@ return new class extends Migration
|
|||
$table->boolean('published')->comment('Brand advantage publish status');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Artisan::call('db:seed', [
|
||||
'class' => BrandAdvantageSeeder::class
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Database\Seeders\Development\ProfessionSeeder;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
|
|
@ -26,10 +24,6 @@ return new class extends Migration
|
|||
$table->boolean('published')->comment('Profession publish status.');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Artisan::call('db:seed', [
|
||||
'class' => ProfessionSeeder::class
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Database\Seeders\Development\KeyNumberSeeder;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
|
|
@ -26,10 +24,6 @@ return new class extends Migration
|
|||
$table->boolean('published')->comment('Picto publish status.');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Artisan::call('db:seed', [
|
||||
'class' => KeyNumberSeeder::class
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
<?php
|
||||
|
||||
use Database\Seeders\Mandatory\GeneralSettingSeeder;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
|
|
@ -20,10 +18,6 @@ return new class extends Migration
|
|||
$table->json('value')->comment('General settings value (json).');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Artisan::call('db:seed', [
|
||||
'class' => GeneralSettingSeeder::class
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
<?php
|
||||
|
||||
use Database\Seeders\Mandatory\MenuNodeDataSeeder;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
|
|
@ -18,32 +16,23 @@ return new class extends Migration
|
|||
Schema::create('menu_node_data', function (Blueprint $table) {
|
||||
$table->unsignedSmallInteger('type')
|
||||
->comment('Enum MenuNodeType, this is unique since we do not use this for links.');
|
||||
|
||||
$table->string('sub_label')->comment('(Left part) Link label');
|
||||
$table->string('title')->comment('(Right part) Sub title');
|
||||
$table->string('text')->comment('(Right part) Sub text');
|
||||
$table->unsignedBigInteger('text_color')->comment('(Right part) Sub text color');
|
||||
|
||||
$table->string('link_url')->comment('(Right part) Link url');
|
||||
$table->string('link_title')->comment('(Right part) Link title');
|
||||
$table->boolean('link_target')->comment('(Right part) Link target');
|
||||
$table->boolean('link_status')->comment('(Right part) Link status');
|
||||
|
||||
$table->string('picture')->comment('(Right part) Picture');
|
||||
$table->string('picture_alt')->comment('(Right part) Picture alt text');
|
||||
$table->string('picture_title')->comment('(Right part) Picture title text');
|
||||
$table->boolean('picture_status')->comment('(Right part) Picture status');
|
||||
|
||||
$table->string('background_picture')->comment('(Right part) Menu picture');
|
||||
$table->string('background_picture_alt')->comment('(Right part) Menu picture alt text');
|
||||
$table->string('background_picture_title')->comment('(Right part) Menu picture title text');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Artisan::call('db:seed', [
|
||||
'class' => MenuNodeDataSeeder::class
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Database\Seeders\Development\RangeSeeder;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
|
|
@ -31,10 +29,6 @@ return new class extends Migration
|
|||
$table->boolean('published')->comment('Range publish status');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Artisan::call('db:seed', [
|
||||
'class' => RangeSeeder::class
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Database\Seeders\Development\SubrangeSeeder;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
|
|
@ -26,10 +24,6 @@ return new class extends Migration
|
|||
$table->boolean('published')->comment('Subrange publish status');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Artisan::call('db:seed', [
|
||||
'class' => SubrangeSeeder::class
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Database\Seeders\Development\MeatSeeder;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
|
|
@ -28,10 +26,6 @@ return new class extends Migration
|
|||
$table->boolean('published')->comment('Meat publish status');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Artisan::call('db:seed', [
|
||||
'class' => MeatSeeder::class
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Database\Seeders\Development\SubmeatSeeder;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
|
|
@ -26,10 +24,6 @@ return new class extends Migration
|
|||
$table->boolean('published')->comment('Submeat publish status');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Artisan::call('db:seed', [
|
||||
'class' => SubmeatSeeder::class
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Database\Seeders\Development\ApproachSeeder;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
|
|
@ -25,10 +23,6 @@ return new class extends Migration
|
|||
$table->boolean('published')->comment('Approach publication status.');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Artisan::call('db:seed', [
|
||||
'class' => ApproachSeeder::class
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Database\Seeders\Development\MainSlideSeeder;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
|
|
@ -49,10 +47,6 @@ return new class extends Migration
|
|||
$table->timestamp('unpublish_at')->nullable()->comment('Slide unpublishment date.');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Artisan::call('db:seed', [
|
||||
'class' => MainSlideSeeder::class
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Database\Seeders\Development\ConsumptionMomentSeeder;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
|
|
@ -20,10 +18,6 @@ return new class extends Migration
|
|||
$table->string('title')->comment('The title of the consumption moment.');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Artisan::call('db:seed', [
|
||||
'class' => ConsumptionMomentSeeder::class
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Database\Seeders\Development\VideoSeeder;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
|
|
@ -26,10 +24,6 @@ return new class extends Migration
|
|||
$table->boolean('published')->comment('Video publish status.');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Artisan::call('db:seed', [
|
||||
'class' => VideoSeeder::class
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Database\Seeders\Development\RecipeSeeder;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
|
|
@ -39,10 +37,6 @@ return new class extends Migration
|
|||
$table->boolean('published')->comment('Recipe publish status.');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Artisan::call('db:seed', [
|
||||
'class' => RecipeSeeder::class
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
use App\Models\ConsumptionMoment;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('consumption_moments', function (Blueprint $table) {
|
||||
$table->string('slug')->comment('Consumption moment title slug.')->after('title');
|
||||
});
|
||||
|
||||
ConsumptionMoment::query()->get()->each(function (ConsumptionMoment $consumptionMoment) {
|
||||
$consumptionMoment->slug = Str::slug($consumptionMoment->title);
|
||||
$consumptionMoment->saveQuietly();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('consumption_moments', function (Blueprint $table) {
|
||||
$table->dropColumn('slug');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
<?php
|
||||
|
||||
use App\Lib\Helpers\FileStorageHelper;
|
||||
use App\Models\StaticPage;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('static_pages', function (Blueprint $table) {
|
||||
$table->string('subtitle')->after('slug')->comment('The static page subtitle.');
|
||||
$table->string('picture')->after('subtitle')->comment('Picture path.');
|
||||
$table->string('picture_alt')->after('picture')->comment('Picture alt attribute.');
|
||||
$table->string('picture_title')->after('picture_alt')->comment('Picture title attribute.');
|
||||
});
|
||||
|
||||
StaticPage::query()->get()->map(function ($satic_page_Model) {
|
||||
$satic_page_Model->subtitle = fake()->sentence();
|
||||
$satic_page_Model->picture = FileStorageHelper::storeFile(
|
||||
new StaticPage(),
|
||||
new \SplFileInfo(
|
||||
\resource_path('../database/factories/assets/recipes/default-picture-720x405.png')
|
||||
)
|
||||
);
|
||||
$satic_page_Model->picture_alt = "text alternatif de l'image";
|
||||
$satic_page_Model->picture_title = "titre de l'image";
|
||||
$satic_page_Model->saveQuietly();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('static_pages', function (Blueprint $table) {
|
||||
$table->dropColumn(['picture', 'picture_alt', 'picture_title', 'subtitle']);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -17,14 +17,4 @@ return new class extends Migration
|
|||
'class' => MandatorySeeder::class
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
// Do nothing.
|
||||
}
|
||||
};
|
||||
|
|
|
|||
20
database/migrations/2030_01_01_000002_development_seeds.php
Normal file
20
database/migrations/2030_01_01_000002_development_seeds.php
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
use Database\Seeders\DevelopmentSeeder;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Artisan::call('db:seed', [
|
||||
'class' => DevelopmentSeeder::class
|
||||
]);
|
||||
}
|
||||
};
|
||||
|
|
@ -3,7 +3,6 @@
|
|||
namespace Database\Seeders\Development;
|
||||
|
||||
use App\Models\Product;
|
||||
use App\Models\Recipe;
|
||||
use App\Models\Video;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
|
|
@ -24,17 +23,12 @@ class VideoSeeder extends Seeder
|
|||
public function run(): void
|
||||
{
|
||||
$productModels = Product::query()->get();
|
||||
Video::factory(10)->make()->each(function (Video $video) use ($productModels) {
|
||||
Video::factory(10)->make()->each(function (Video $video, int $key) use ($productModels) {
|
||||
if (rand(1, 10) > 5) {
|
||||
$video->product()->associate($productModels->random()->id);
|
||||
}
|
||||
$video->save();
|
||||
});
|
||||
|
||||
$videoModels = Video::query()->get();
|
||||
Recipe::query()->get()->map(function (Recipe $recipe) use ($videoModels) {
|
||||
$recipe->video_id = (rand(0, 1)) ? $videoModels->random()->id : null;
|
||||
$recipe->saveQuietly();
|
||||
$video->order = $key + 1;
|
||||
$video->saveQuietly();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
<file>config/</file>
|
||||
<file>database/factories</file>
|
||||
<file>routes/</file>
|
||||
<exclude-pattern type="relative">*/vendor/*</exclude-pattern>
|
||||
<rule ref="PSR1" />
|
||||
<rule ref="PSR12" />
|
||||
|
||||
|
|
|
|||
|
|
@ -2,9 +2,10 @@ includes:
|
|||
- vendor/larastan/larastan/extension.neon
|
||||
|
||||
parameters:
|
||||
|
||||
paths:
|
||||
- app/
|
||||
|
||||
# Level 9 is the highest level
|
||||
excludePaths:
|
||||
- app/Lib/vendor/
|
||||
|
||||
level: 5
|
||||
|
|
|
|||
4
resources/assets/images/footer/socials/YT.svg
Normal file
4
resources/assets/images/footer/socials/YT.svg
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<svg width="26" height="18" viewBox="0 0 26 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M25.6196 12.3123C25.6196 15.4165 23.1025 17.9336 19.9983 17.9336H5.62146C2.51724 17.9336 0.00012207 15.4165 0.00012207 12.3123V5.62134C0.00012207 2.51711 2.51724 0 5.62146 0H19.9983C23.1025 0 25.6196 2.51711 25.6196 5.62134V12.3123Z" fill="white"/>
|
||||
<path d="M16.8963 8.80467L10.7263 5.44638C10.4743 5.30334 9.60754 5.48481 9.60754 5.77516V12.3209C9.60754 12.6092 10.4658 12.7906 10.7199 12.654L17.1653 9.46437C17.4279 9.32346 17.1546 8.94771 16.8963 8.8004V8.80467Z" fill="#4E3238"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 596 B |
8
resources/assets/images/recipes/filter.svg
Normal file
8
resources/assets/images/recipes/filter.svg
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<svg width="19" height="13" viewBox="0 0 19 13" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M17.9229 9.99902H14.5202" stroke="white" stroke-width="1.5" stroke-miterlimit="20" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M12.449 11.9988C12.1715 12.0077 11.8951 11.9625 11.636 11.8659C11.377 11.7693 11.1407 11.6232 10.9412 11.4364C10.7417 11.2496 10.583 11.0259 10.4747 10.7786C10.3663 10.5312 10.3105 10.2653 10.3105 9.99667C10.3105 9.72802 10.3663 9.46212 10.4747 9.21478C10.583 8.96744 10.7417 8.74372 10.9412 8.55693C11.1407 8.37013 11.377 8.22408 11.636 8.12746C11.8951 8.03084 12.1715 7.98562 12.449 7.9945C12.9859 8.01169 13.4948 8.23015 13.8684 8.60376C14.2419 8.97736 14.4507 9.47684 14.4507 9.99667C14.4507 10.5165 14.2419 11.016 13.8684 11.3896C13.4948 11.7632 12.9859 11.9816 12.449 11.9988Z" stroke="white" stroke-width="1.5" stroke-miterlimit="20" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M5.85513 5.00378C5.57943 5.01002 5.30523 4.96286 5.04863 4.86507C4.79204 4.76729 4.55824 4.62085 4.36097 4.43436C4.1637 4.24788 4.00695 4.02511 3.89993 3.77916C3.79291 3.53321 3.73778 3.26903 3.73778 3.00216C3.73778 2.7353 3.79291 2.47112 3.89993 2.22517C4.00695 1.97922 4.1637 1.75645 4.36097 1.56996C4.55824 1.38348 4.79204 1.23704 5.04863 1.13925C5.30523 1.04147 5.57943 0.994308 5.85513 1.00055C6.39533 1.01277 6.90916 1.22903 7.28675 1.60307C7.66434 1.97711 7.87573 2.47926 7.87573 3.00216C7.87573 3.52506 7.66434 4.02721 7.28675 4.40126C6.90916 4.7753 6.39533 4.99155 5.85513 5.00378Z" stroke="white" stroke-width="1.5" stroke-miterlimit="20" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M9.9231 10L0.99998 9.99902" stroke="white" stroke-width="1.5" stroke-miterlimit="20" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M17.9229 3.00366L7.92638 3.00366" stroke="white" stroke-width="1.5" stroke-miterlimit="20" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M2.9231 3L1.0113 3.00391" stroke="white" stroke-width="1.5" stroke-miterlimit="20" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2 KiB |
|
|
@ -11,7 +11,7 @@ return [
|
|||
'save' => 'sauvegarder',
|
||||
'edit' => 'mettre à jour',
|
||||
'view' => 'aperçu',
|
||||
'order_submodels' => 'ordonner les sous-élements',
|
||||
'order_submodels' => 'ordonnancement des sous-élements',
|
||||
],
|
||||
|
||||
'helpers' => [
|
||||
|
|
@ -24,7 +24,6 @@ return [
|
|||
'delete_model' => 'Supprimer :model',
|
||||
'save_model' => 'Sauvegarder :model',
|
||||
'edit_model' => 'Mettre à jour :model',
|
||||
'order_submodels' => 'Modifier l\'ordre des :model',
|
||||
'no_results' => 'Aucun résultat pour :model',
|
||||
'publish' => 'Publié',
|
||||
'unpublish' => 'Dépublié',
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ return [
|
|||
'submeat' => 'sous-viande',
|
||||
'label' => 'label',
|
||||
'demarche' => 'démarche',
|
||||
'consumption_moment' => 'moment de consommation',
|
||||
'consumption_moment' => 'moment de consommation|moments de consommation',
|
||||
'video' => 'vidéo',
|
||||
'product' => 'produit',
|
||||
'recipe' => 'recette',
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ body {
|
|||
left: 0;
|
||||
overflow-y: auto;
|
||||
|
||||
@include media-breakpoint-up(md) {
|
||||
@include media-breakpoint-up(lg) {
|
||||
z-index: 1;
|
||||
height: calc(100vh - #{$bo-header-height});
|
||||
}
|
||||
|
|
@ -28,7 +28,7 @@ body {
|
|||
.sidemenu {
|
||||
height: calc(100vh - #{$bo-header-height});
|
||||
|
||||
@include media-breakpoint-up(md) {
|
||||
@include media-breakpoint-up(lg) {
|
||||
height: fit-content;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
@use 'sass:map';
|
||||
@import 'bootstrap/scss/functions';
|
||||
|
||||
// Override bootstrap colors
|
||||
$primary: $color-primary;
|
||||
$secondary: $color-secondary;
|
||||
|
|
@ -22,3 +25,13 @@ $theme-colors: (
|
|||
$font-family-base: $font-default-family-base;
|
||||
$font-size-base: $font-default-size-base;
|
||||
$line-height-base: $line-default-height-base;
|
||||
$grid-breakpoints: map.merge((
|
||||
xs: 0,
|
||||
sm: 576px,
|
||||
md: 768px,
|
||||
lg: 992px,
|
||||
xl: 1200px,
|
||||
xxl: 1400px
|
||||
), (
|
||||
xxxl: 1700px,
|
||||
))
|
||||
|
|
|
|||
59
resources/sass/fo/base/_header-banner.scss
Normal file
59
resources/sass/fo/base/_header-banner.scss
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
#header {
|
||||
&-background {
|
||||
bottom: 4rem;
|
||||
background-image: url('@/images/recipe/header-wood.jpg');
|
||||
background-size: cover;
|
||||
|
||||
@include media-breakpoint-up(md) {
|
||||
bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&-banner {
|
||||
overflow: hidden;
|
||||
padding-bottom: 23vw;
|
||||
|
||||
@include media-breakpoint-up(sm) {
|
||||
padding-bottom: 8rem;
|
||||
}
|
||||
|
||||
@include media-breakpoint-up(md) {
|
||||
padding-bottom: 7.5rem;
|
||||
}
|
||||
|
||||
@include media-breakpoint-up(lg) {
|
||||
padding-bottom: 10rem;
|
||||
}
|
||||
|
||||
@include media-breakpoint-up(xl) {
|
||||
padding-bottom: 1rem;
|
||||
}
|
||||
|
||||
.container {
|
||||
padding-top: $top-menu-offset;
|
||||
|
||||
ul {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.header-image-wrapper {
|
||||
@include media-breakpoint-up(xl) {
|
||||
position: absolute;
|
||||
top: -1rem;
|
||||
right: 7vw;
|
||||
max-width: 55%;
|
||||
transform: translateX(8vw);
|
||||
}
|
||||
|
||||
@include media-breakpoint-up(xxl) {
|
||||
max-width: 45%;
|
||||
}
|
||||
|
||||
img {
|
||||
box-shadow: -4px 8px 14px 0 rgb(0 0 0 / 23%);
|
||||
transform: rotate(2deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -14,9 +14,11 @@
|
|||
@import "./base/fonts";
|
||||
@import "./base/common";
|
||||
@import "./base/layout";
|
||||
@import "./base/header-banner";
|
||||
|
||||
// * PAGES
|
||||
@import "./pages/home";
|
||||
@import "./pages/recipes";
|
||||
@import "./pages/recipe";
|
||||
@import "./pages/recruitment";
|
||||
|
||||
|
|
|
|||
|
|
@ -293,4 +293,38 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.swiper-videos{
|
||||
.swiper-slide{
|
||||
transition: all .2s ease;
|
||||
|
||||
&-prev {
|
||||
opacity: 0.7;
|
||||
transform: scale(0.95) rotate(-2deg);
|
||||
}
|
||||
|
||||
&-next {
|
||||
opacity: 0.7;
|
||||
transform: scale(0.95) rotate(2deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.swiper-videos-button-prev{
|
||||
top: 55%;
|
||||
left: 4%;
|
||||
|
||||
@include media-breakpoint-up(md) {
|
||||
left: 23%;
|
||||
}
|
||||
}
|
||||
|
||||
.swiper-videos-button-next{
|
||||
top: 55%;
|
||||
right: 4%;
|
||||
|
||||
@include media-breakpoint-up(md) {
|
||||
right: 23%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,8 +51,10 @@
|
|||
}
|
||||
|
||||
img {
|
||||
/* stylelint-disable-next-line scss/at-extend-no-missing-placeholder */
|
||||
@extend .rotate-right;
|
||||
|
||||
box-shadow: -4px 8px 14px 0 rgb(0 0 0 / 23%);
|
||||
transform: rotate(2deg);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
47
resources/sass/fo/pages/recipes.scss
Normal file
47
resources/sass/fo/pages/recipes.scss
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
#recipes {
|
||||
&-header {
|
||||
background-image: url('@/images/common/wood-bg-big.jpg');
|
||||
background-position: center;
|
||||
background-size: cover;
|
||||
|
||||
.col-12:nth-child(1) {
|
||||
padding-top: $top-menu-offset;
|
||||
}
|
||||
|
||||
.img-wrapper {
|
||||
@include media-breakpoint-up(md) {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: -1rem;
|
||||
display: flex;
|
||||
max-width: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
|
||||
@include media-breakpoint-up(md) {
|
||||
max-width: initial;
|
||||
min-height: 110%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&-list {
|
||||
#recipe-highlight {
|
||||
max-width: 20rem;
|
||||
margin-top: -1rem;
|
||||
|
||||
@include media-breakpoint-up(md) {
|
||||
margin-top: -2rem;
|
||||
}
|
||||
|
||||
.card-header {
|
||||
top: -1.5rem;
|
||||
left: -10%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, defineOptions, onMounted, reactive, ref, useAttrs, type PropType } from "vue";
|
||||
import { computed, defineOptions, onMounted, ref, useAttrs, type PropType } from "vue";
|
||||
import "./../../../js/vendor/ckeditor";
|
||||
import parseLaravelErrorMessages from "../../modules/parseLaravelErrorMessages";
|
||||
|
||||
|
|
@ -74,15 +74,6 @@ const placeholder = ref<string>(props.placeholder);
|
|||
const required = ref<boolean>(props.required);
|
||||
const allErrors = ref<LaravelValidationErrors>(props.errors);
|
||||
|
||||
/** Counter parameters. */
|
||||
const counterParameters = reactive<{
|
||||
words: number,
|
||||
chars: number,
|
||||
}>({
|
||||
words: 0,
|
||||
chars: 0,
|
||||
});
|
||||
|
||||
// * COMPUTED
|
||||
const isUsedWithProps = computed<boolean>(() => attrs.json === undefined);
|
||||
|
||||
|
|
@ -404,7 +395,7 @@ function getErrorMessage(): string|null {
|
|||
box-shadow: 0 0 0 .25rem rgba(var(--bs-danger-rgb), var(--bs-focus-ring-opacity)) !important;
|
||||
}
|
||||
}
|
||||
.ck.ck-balloon-panel {
|
||||
.ck.ck-powered-by-balloon {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -33,11 +33,7 @@
|
|||
{{ trans.methods.__('Cocher pour rendre vide') }}
|
||||
</label>
|
||||
</div>
|
||||
<div
|
||||
:class="`position-absolute top-100 left-0 z-2 ${
|
||||
displayPicker ? 'd-inline-block' : 'd-none'
|
||||
}`"
|
||||
>
|
||||
<div :class="['position-absolute top-100 left-0 z-2', displayPicker ? 'd-inline-block' : 'd-none']">
|
||||
<Sketch
|
||||
ref="popupPicker"
|
||||
v-model="internalColor"
|
||||
|
|
|
|||
|
|
@ -7,17 +7,17 @@
|
|||
<VueSelect
|
||||
:id="id"
|
||||
:loading="loading"
|
||||
v-model="modelParameters.selected"
|
||||
v-model="modelSelected"
|
||||
:multiple="selectParameters.multiple"
|
||||
:clearable="!selectParameters.required"
|
||||
:label="selectParameters.fieldName"
|
||||
@search="search"
|
||||
:options="modelParameters.list"
|
||||
:selectable="(option: VselectOption) =>
|
||||
(modelParameters.selected !== null)
|
||||
? (Array.isArray(modelParameters.selected))
|
||||
? !modelParameters.selected.includes(option)
|
||||
: modelParameters.selected.id !== option.id
|
||||
(modelSelected !== null)
|
||||
? (Array.isArray(modelSelected))
|
||||
? !modelSelected.includes(option)
|
||||
: modelSelected.id !== option.id
|
||||
: true"
|
||||
:filterable="true"
|
||||
:required="selectParameters.required"
|
||||
|
|
@ -89,10 +89,10 @@
|
|||
</VueSelect>
|
||||
<!-- OUTPUT HTML INPUT -->
|
||||
<template
|
||||
v-if="Array.isArray(modelParameters.selected) && modelParameters.selected !== null"
|
||||
v-if="Array.isArray(modelSelected) && modelSelected !== null"
|
||||
>
|
||||
<input
|
||||
v-for="(selectedId, selectedIndex) in modelParameters.selected"
|
||||
v-for="(selectedId, selectedIndex) in modelSelected"
|
||||
:key="selectedIndex"
|
||||
:value="selectedId.id"
|
||||
:name="name + '[][id]'"
|
||||
|
|
@ -101,7 +101,7 @@
|
|||
</template>
|
||||
<input
|
||||
v-else
|
||||
:value="modelParameters.selected?.id"
|
||||
:value="modelSelected?.id"
|
||||
:name="name"
|
||||
type="hidden"
|
||||
>
|
||||
|
|
@ -120,7 +120,7 @@
|
|||
<script lang="ts" setup>
|
||||
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
|
||||
import type { PropType } from "vue";
|
||||
import { computed, defineOptions, nextTick, onMounted, reactive, ref, useAttrs } from "vue";
|
||||
import { computed, defineOptions, nextTick, onMounted, reactive, ref, useAttrs, watch } from "vue";
|
||||
import VueSelect from "vue-select";
|
||||
import route from "../../modules/route";
|
||||
import trans from "../../modules/trans";
|
||||
|
|
@ -131,6 +131,11 @@ defineOptions({
|
|||
name: "SearchBelongsToDropdown",
|
||||
});
|
||||
|
||||
// * EMITS
|
||||
const emits = defineEmits<{
|
||||
"selected-value-changed": [VselectOption|VselectOption[]|null],
|
||||
}>();
|
||||
|
||||
// * ATTRIBUTES
|
||||
const attrs = useAttrs();
|
||||
|
||||
|
|
@ -151,19 +156,19 @@ const props = defineProps({
|
|||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
fieldName: {
|
||||
fieldname: {
|
||||
type: String,
|
||||
default: "name"
|
||||
},
|
||||
modelTarget: {
|
||||
modeltarget: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
modelListPaginate: {
|
||||
modellistpaginate: {
|
||||
type: Object as PropType<LaravelPaginator>,
|
||||
default: () => { return []; }
|
||||
},
|
||||
modelSelected: {
|
||||
modelselected: {
|
||||
type: Object as PropType<VselectOption|VselectOption[]|null>,
|
||||
default: () => { return []; }
|
||||
},
|
||||
|
|
@ -179,7 +184,7 @@ const props = defineProps({
|
|||
type: String,
|
||||
default: ""
|
||||
},
|
||||
routeName: {
|
||||
routename: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
|
|
@ -202,12 +207,12 @@ const allErrors = ref<LaravelValidationErrors>(props.errors);
|
|||
const modelParameters = reactive<{
|
||||
targetClass: string,
|
||||
list: LaravelModelList,
|
||||
selected: VselectOption|VselectOption[]|null,
|
||||
}>({
|
||||
targetClass: props.modelTarget,
|
||||
list: props.modelListPaginate.data,
|
||||
selected: props.modelSelected,
|
||||
targetClass: props.modeltarget,
|
||||
list: props.modellistpaginate.data,
|
||||
});
|
||||
/** Exclude from modelParameters to emit an event on update */
|
||||
const modelSelected = ref<VselectOption|VselectOption[]|null>(props.modelselected);
|
||||
|
||||
/** Select parameters. */
|
||||
const selectParameters = reactive<{
|
||||
|
|
@ -221,7 +226,7 @@ const selectParameters = reactive<{
|
|||
required: props.required,
|
||||
disabled: props.disabled,
|
||||
placeholder: props.placeholder,
|
||||
fieldName: props.fieldName,
|
||||
fieldName: props.fieldname,
|
||||
});
|
||||
|
||||
/** Page parameters. */
|
||||
|
|
@ -233,26 +238,26 @@ const pageParameters = reactive<{
|
|||
hasPrevPage: boolean,
|
||||
routeName: string,
|
||||
}>({
|
||||
page: props.modelListPaginate.current_page,
|
||||
totalPage: props.modelListPaginate.last_page,
|
||||
itemPerPage: props.modelListPaginate.per_page,
|
||||
page: props.modellistpaginate.current_page,
|
||||
totalPage: props.modellistpaginate.last_page,
|
||||
itemPerPage: props.modellistpaginate.per_page,
|
||||
hasPrevPage: false,
|
||||
hasNextPage: false,
|
||||
routeName: props.routeName,
|
||||
routeName: props.routename,
|
||||
});
|
||||
|
||||
const isUsedWithProps = computed<boolean>(() => attrs.json === undefined);
|
||||
|
||||
// * LIFECYCLE
|
||||
onMounted(() => {
|
||||
const json = String(attrs.json ?? "{}"),
|
||||
data = JSON.parse(json);
|
||||
if (!isUsedWithProps.value) {
|
||||
const json = String(attrs.json ?? "{}"),
|
||||
data = JSON.parse(json);
|
||||
/** Model parameters. */
|
||||
modelParameters.targetClass = data.targetClass;
|
||||
modelParameters.list = data.modelListPaginate.data;
|
||||
nextTick(() => {
|
||||
modelParameters.selected = data.modelSelected;
|
||||
modelSelected.value = data.modelSelected;
|
||||
});
|
||||
/** Select parameters. */
|
||||
selectParameters.multiple = Boolean(data.multiple);
|
||||
|
|
@ -277,6 +282,28 @@ onMounted(() => {
|
|||
initTooltips();
|
||||
});
|
||||
|
||||
// * WATCHERS
|
||||
|
||||
watch(props, () => {
|
||||
/** Model parameters. */
|
||||
modelParameters.list = props.modellistpaginate.data;
|
||||
modelSelected.value = props.modelselected;
|
||||
|
||||
/** Select parameters. */
|
||||
selectParameters.disabled = props.disabled;
|
||||
selectParameters.placeholder = props.placeholder;
|
||||
|
||||
/** Page parameters. */
|
||||
pageParameters.page = props.modellistpaginate.current_page;
|
||||
pageParameters.totalPage = props.modellistpaginate.last_page;
|
||||
pageParameters.itemPerPage = props.modellistpaginate.per_page;
|
||||
pageParameters.routeName = props.routename;
|
||||
});
|
||||
|
||||
watch(modelSelected, () => {
|
||||
emits("selected-value-changed", modelSelected.value);
|
||||
});
|
||||
|
||||
// * METHODS
|
||||
|
||||
/** Customize clear button. */
|
||||
|
|
|
|||
|
|
@ -13,15 +13,20 @@ import {
|
|||
faArrowUpRightFromSquare,
|
||||
faArrowsAltH,
|
||||
faArrowsAltV,
|
||||
faArrowUpWideShort,
|
||||
faAward,
|
||||
faBackspace,
|
||||
faBan,
|
||||
faBars,
|
||||
faBuildingWheat,
|
||||
faBriefcase,
|
||||
faCheck,
|
||||
faChevronLeft,
|
||||
faChevronRight,
|
||||
faCircleCheck,
|
||||
faCircleExclamation,
|
||||
faCircleInfo,
|
||||
faCircleQuestion,
|
||||
faCircleXmark,
|
||||
faClock,
|
||||
faCopy,
|
||||
|
|
@ -35,26 +40,37 @@ import {
|
|||
faFilm,
|
||||
faFolderOpen,
|
||||
faHouse,
|
||||
faKitchenSet,
|
||||
faKiwiBird,
|
||||
faKey,
|
||||
faListUl,
|
||||
faMedal,
|
||||
faNoteSticky,
|
||||
faPaintRoller,
|
||||
faPanorama,
|
||||
faPencil,
|
||||
faPeopleArrows,
|
||||
faPlus,
|
||||
faQuestionCircle,
|
||||
faRectangleAd,
|
||||
faReceipt,
|
||||
faRedoAlt,
|
||||
faSearch,
|
||||
faSearchMinus,
|
||||
faSearchPlus,
|
||||
faNewspaper,
|
||||
faSyncAlt,
|
||||
faTableList,
|
||||
faTableColumns,
|
||||
faTag,
|
||||
faTags,
|
||||
faThumbsUp,
|
||||
faTimes,
|
||||
faTrash,
|
||||
faTriangleExclamation,
|
||||
faUndoAlt,
|
||||
faUserTie,
|
||||
faUtensils,
|
||||
faWandMagic
|
||||
} from "@fortawesome/free-solid-svg-icons";
|
||||
|
||||
|
|
@ -115,5 +131,21 @@ library.add(faDrumstickBite);
|
|||
library.add(faFilm);
|
||||
library.add(faTableList);
|
||||
library.add(faTriangleExclamation);
|
||||
library.add(faTableColumns);
|
||||
library.add(faBars);
|
||||
library.add(faNewspaper);
|
||||
library.add(faRectangleAd);
|
||||
library.add(faCircleQuestion);
|
||||
library.add(faBriefcase);
|
||||
library.add(faUtensils);
|
||||
library.add(faArrowUpWideShort);
|
||||
library.add(faTags);
|
||||
library.add(faMedal);
|
||||
library.add(faPeopleArrows);
|
||||
library.add(faAward);
|
||||
library.add(faKitchenSet);
|
||||
library.add(faKiwiBird);
|
||||
library.add(faNoteSticky);
|
||||
library.add(faReceipt);
|
||||
|
||||
dom.watch();
|
||||
|
|
|
|||
|
|
@ -244,6 +244,32 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||
},
|
||||
},
|
||||
},
|
||||
"swiper-videos": {
|
||||
modules: [Navigation, Pagination],
|
||||
grabCursor: true,
|
||||
slidesPerView: 1,
|
||||
centeredSlides: true,
|
||||
spaceBetween: 20,
|
||||
navigation: {
|
||||
nextEl: ".swiper-videos-button-next",
|
||||
prevEl: ".swiper-videos-button-prev",
|
||||
},
|
||||
pagination: {
|
||||
el: ".swiper-videos-pagination",
|
||||
clickable: true,
|
||||
renderBullet: function (index: number, className: string) {
|
||||
return "<button class=\"btn btn-tertiary rounded-circle border-0 mx-2 p-0 " + className + "\" title=\"Aller à la slide " + (index + 1) + "\"></button>";
|
||||
},
|
||||
},
|
||||
breakpoints: {
|
||||
768: {
|
||||
slidesPerView: 1.6,
|
||||
},
|
||||
992: {
|
||||
slidesPerView: 1.9,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const swiperVol = document.getElementsByClassName("swiper") as HTMLCollectionOf<HTMLElement>;
|
||||
|
|
@ -270,6 +296,18 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||
}
|
||||
});
|
||||
}
|
||||
if (swiper.el.id === "swiper-videos") {
|
||||
document.querySelectorAll("#swiper-videos .swiper-slide").forEach(slide => {
|
||||
if (!slide.classList.contains("swiper-slide-active")) {
|
||||
slide.setAttribute("inert", "true");
|
||||
}
|
||||
});
|
||||
swiper.on("transitionEnd", function() {
|
||||
document.querySelector("#swiper-videos .swiper-slide-active")?.removeAttribute("inert");
|
||||
document.querySelector("#swiper-videos .swiper-slide-prev")?.setAttribute("inert", "true");
|
||||
document.querySelector("#swiper-videos .swiper-slide-next")?.setAttribute("inert", "true");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function eventBtnPlayPause(swiper: Swiper, btnPlayPause: HTMLElement | null) {
|
||||
|
|
|
|||
|
|
@ -72,8 +72,4 @@ onMounted(() => {
|
|||
nbGuestsCustom.value = nbGuests.value;
|
||||
});
|
||||
|
||||
// * WATCHERS
|
||||
|
||||
// * METHODS
|
||||
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ const intRouteRangeShow = ref<string>("");
|
|||
const intRouteProductShow = ref<string>("");
|
||||
const intBtn1Label = ref<string>("");
|
||||
const intBtn2Label = ref<string>("");
|
||||
const intProductViews = ref<string[]>([]);
|
||||
const intProductViews = ref<Array<string>>([]);
|
||||
const intLoading = ref<boolean>(false);
|
||||
|
||||
// * LIFECYCLE
|
||||
|
|
@ -279,8 +279,8 @@ function setSelectedRange(rangeModel: LaravelModel): void {
|
|||
@import "bootstrap/scss/functions";
|
||||
@import "bootstrap/scss/variables";
|
||||
@import "bootstrap/scss/mixins";
|
||||
@import 'swiper/css';
|
||||
@import 'swiper/css/navigation';
|
||||
@import "swiper/css";
|
||||
@import "swiper/css/navigation";
|
||||
|
||||
.card-background, .range-btns {
|
||||
transition: .3s;
|
||||
|
|
|
|||
778
resources/ts/fo/components/SearchModelComponent.vue
Normal file
778
resources/ts/fo/components/SearchModelComponent.vue
Normal file
|
|
@ -0,0 +1,778 @@
|
|||
<template>
|
||||
<div
|
||||
ref="searchModel"
|
||||
class="search-model-component row w-100 mx-auto gx-5"
|
||||
>
|
||||
<!-- TEXTS MOBILE -->
|
||||
<div class="d-md-none col-12 col-md-7 col-xl-8 text-center">
|
||||
<h2>{{ textsParameters.subtitle }}</h2>
|
||||
<p v-html="textsParameters.paragraph" />
|
||||
</div>
|
||||
<!-- FILTERS -->
|
||||
<div class="col-12 col-md-5 col-xl-4">
|
||||
<div
|
||||
class="row filters-list"
|
||||
ref="filtersList"
|
||||
>
|
||||
<!-- TEXT FILTER -->
|
||||
<div class="col-12 mb-3 z-1">
|
||||
<div class="search-custom bg-white bottom-left-shadow">
|
||||
<SearchBelongsToDropdownComponent
|
||||
name="words"
|
||||
:multiple="true"
|
||||
:fieldname="searchParameters.fieldName"
|
||||
:modeltarget="searchParameters.modelTarget"
|
||||
:modellistpaginate="searchParameters.modelListPaginate"
|
||||
:modelselected="searchParameters.selectedList"
|
||||
:routename="searchParameters.routeList"
|
||||
@selected-value-changed="getModelByText"
|
||||
:placeholder="searchParameters.placeholder"
|
||||
:disabled="loading || paginationParameters.loading"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<!-- FILTERS LIST -->
|
||||
<div class="col-12">
|
||||
<button
|
||||
class="d-md-none btn btn-secondary w-100 mb-3"
|
||||
type="button"
|
||||
:title="trans.methods.__('Ouvrir le panneau des filtres')"
|
||||
data-bs-toggle="offcanvas"
|
||||
data-bs-target="#offcanvasRecipesFilters"
|
||||
aria-controls="offcanvasRecipesFilters"
|
||||
>
|
||||
<span class="pe-2">
|
||||
{{ trans.methods.__('Filtres') }}
|
||||
</span>
|
||||
<img
|
||||
src="@/images/recipes/filter.svg"
|
||||
:alt="trans.methods.__('Icône de filtres')"
|
||||
>
|
||||
</button>
|
||||
<div
|
||||
class="offcanvas-md offcanvas-start"
|
||||
tabindex="-1"
|
||||
id="offcanvasRecipesFilters"
|
||||
aria-labelledby="offcanvasRecipesFiltersLabel"
|
||||
>
|
||||
<div class="offcanvas-header">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-link text-decoration-none f-catamaran fw-semibold"
|
||||
data-bs-dismiss="offcanvas"
|
||||
data-bs-toggle="offcanvas"
|
||||
data-bs-target="#offcanvasRecipesFilters"
|
||||
:aria-label="trans.methods.__('Fermer le menu')"
|
||||
>
|
||||
<FontAwesomeIcon
|
||||
icon="fa-solid fa-xmark"
|
||||
class="me-2"
|
||||
/>
|
||||
{{ trans.methods.__('Fermer') }}
|
||||
</button>
|
||||
</div>
|
||||
<div class="offcanvas-body py-0">
|
||||
<div class="row w-100 mx-auto">
|
||||
<div
|
||||
class="col-12 bottom-left-shadow p-0"
|
||||
v-for="(filter, filterIndex) in filters"
|
||||
:key="filterIndex"
|
||||
>
|
||||
<div class="line-border-small mb-3">
|
||||
<button
|
||||
class="btn btn-transparent d-flex justify-content-between align-items-center fs-4 text-start border-0 shadow-none w-100"
|
||||
type="button"
|
||||
data-bs-toggle="collapse"
|
||||
:data-bs-target="'#' + slugify(filter.title, { lower: true })"
|
||||
aria-expanded="true"
|
||||
:aria-controls="slugify(filter.title, { lower: true })"
|
||||
>
|
||||
{{ filter.title }}
|
||||
<span class="f-bourton-base">></span>
|
||||
</button>
|
||||
<div
|
||||
class="collapse show"
|
||||
:id="slugify(filter.title, { lower: true })"
|
||||
>
|
||||
<fieldset
|
||||
:inert="loading || paginationParameters.loading"
|
||||
class="d-flex justify-content-start align-items-center flex-wrap px-4 py-2"
|
||||
>
|
||||
<div
|
||||
class="w-fit"
|
||||
v-for="(model, modelIndex) in filter.models"
|
||||
:key="modelIndex"
|
||||
>
|
||||
<input
|
||||
class="d-none"
|
||||
type="checkbox"
|
||||
:name="slugify(filter.title, { lower: true })"
|
||||
:id="`${slugify(filter.title, { lower: true })}-${ modelIndex }`"
|
||||
@click="getModelByFilters(filter, model, $event)"
|
||||
:checked="filtersDetailsParameters.selectedFilter === slugify(String(model.label ?? model.title), { lower: true })"
|
||||
:disabled="loading || paginationParameters.loading"
|
||||
>
|
||||
<label
|
||||
:class="['form-check-label btn position-relative mb-3 me-3 px-2 py-1', filtersDetailsParameters.selectedFilter === slugify(String(model.label ?? model.title), { lower: true }) ? 'btn-secondary' : 'btn-tertiary']"
|
||||
:for="`${slugify(filter.title, { lower: true })}-${ modelIndex }`"
|
||||
data-bs-dismiss="offcanvas"
|
||||
data-bs-target="#offcanvasRecipesFilters"
|
||||
>
|
||||
{{ model.label ?? model.title }}
|
||||
</label>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- MODELS LIST -->
|
||||
<div class="col-12 col-md-7 col-xl-8">
|
||||
<div class="row">
|
||||
<!-- TEXTS DESKTOP -->
|
||||
<div class="d-none d-md-block col-12 text-start">
|
||||
<h2>{{ textsParameters.subtitle }}</h2>
|
||||
<p v-html="textsParameters.paragraph" />
|
||||
</div>
|
||||
<!-- MODELS LIST -->
|
||||
<template v-if="!loading">
|
||||
<div
|
||||
v-if="filtersDetailsParameters.selectedFilter.length && filters[getFilterById(filtersDetailsParameters.selectedFilterId)].children?.models.length"
|
||||
ref="childrenList"
|
||||
class="col-12"
|
||||
>
|
||||
<div class="children-list position-relative px-5 mb-3">
|
||||
<div class="swiper swiper-children overflow-hidden position-relative p-2 z-1">
|
||||
<div class="swiper-wrapper w-fit">
|
||||
<div
|
||||
class="swiper-slide w-fit"
|
||||
v-for="(model, modelIndex) in filters[getFilterById(filtersDetailsParameters.selectedFilterId)].children?.models"
|
||||
:key="modelIndex"
|
||||
>
|
||||
<input
|
||||
class="d-none"
|
||||
type="checkbox"
|
||||
name="child"
|
||||
@click="getModelByChildren(filters[getFilterById(filtersDetailsParameters.selectedFilterId)].children!, model, $event)"
|
||||
:id="`child-${modelIndex}`"
|
||||
:checked="filtersDetailsParameters.selectedChildFilter === slugify(String(model.label ?? model.title), { lower: true })"
|
||||
>
|
||||
<label
|
||||
:class="['form-check-label btn position-relative px-2 py-1', filtersDetailsParameters.selectedChildFilter === slugify(String(model.label ?? model.title), { lower: true }) ? 'btn-secondary' : 'btn-white']"
|
||||
:for="`child-${modelIndex}`"
|
||||
>
|
||||
{{ model.label ?? model.title }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="swiper-btns swiper-btn-prev border-0 d-flex justify-content-center align-items-center position-absolute top-50 z-1 bg-white rounded-pill">
|
||||
<img
|
||||
src="@/images/common/arrow.svg"
|
||||
:title="trans.methods.__('Navigation du slider (gauche)')"
|
||||
:alt="trans.methods.__('flèche vers la gauche')"
|
||||
role="button"
|
||||
>
|
||||
</button>
|
||||
<button class="swiper-btns swiper-btn-next border-0 d-flex justify-content-center align-items-center position-absolute top-50 translate-middle-y z-1 bg-white rounded-pill">
|
||||
<img
|
||||
src="@/images/common/arrow.svg"
|
||||
:title="trans.methods.__('Navigation du slider (droite)')"
|
||||
:alt="trans.methods.__('flèche vers la droite')"
|
||||
role="button"
|
||||
>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- MODELS LIST -->
|
||||
<template v-if="filtersDetailsParameters.viewsPaginate.length">
|
||||
<div
|
||||
v-for="(view, viewIndex) in filtersDetailsParameters.viewsPaginate"
|
||||
:key="viewIndex"
|
||||
class="col-12 col-lg-6"
|
||||
v-html="view"
|
||||
/>
|
||||
</template>
|
||||
<!-- NO RESULT -->
|
||||
<div
|
||||
v-else
|
||||
class="col-12 d-flex flex-column justify-content-center align-items-center"
|
||||
>
|
||||
<span class="no-result-icon">
|
||||
<FontAwesomeIcon
|
||||
icon="fa-solid fa-triangle-exclamation"
|
||||
class="w-100 h-100"
|
||||
/>
|
||||
</span>
|
||||
<p class="text-center m-0 pt-2">
|
||||
{{ trans.methods.__("Aucun résultat ne correspond à votre recherche,") }}
|
||||
</p>
|
||||
<p class="text-center m-0 pb-3">
|
||||
{{ trans.methods.__("essayez un autre paramètre de recherche ou réinitialisez-la.") }}
|
||||
</p>
|
||||
<button
|
||||
@click="resetList(true)"
|
||||
class="btn btn-primary"
|
||||
type="button"
|
||||
>
|
||||
{{ trans.methods.__("Ré-initialiser la recherche") }}
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
<!-- PLACEHOLDERS -->
|
||||
<div
|
||||
v-if="loading || paginationParameters.loading"
|
||||
class="col-12 col-md-6 recipe-card placeholder-glow bottom-left-shadow"
|
||||
>
|
||||
<div class="position-relative d-flex justify-content-center">
|
||||
<span class="placeholder ratio ratio-16x9 line-border-medium w-100" />
|
||||
</div>
|
||||
<div class="line-border-medium position-relative d-flex flex-column align-items-center recipe-card-bottom-part bg-white px-3 pt-5">
|
||||
<p class="placeholder placeholder-title col-7" />
|
||||
<div class="d-flex flex-wrap justify-content-around align-items-center w-100">
|
||||
<p class="placeholder placeholder-time col-3" />
|
||||
<p class="placeholder placeholder-time col-3" />
|
||||
<p class="placeholder placeholder-time col-3" />
|
||||
</div>
|
||||
<div class="d-flex flex-wrap justify-content-around align-items-center w-100">
|
||||
<p class="placeholder placeholder-tag col-3" />
|
||||
<p class="placeholder placeholder-tag col-3" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
|
||||
import Swiper from "swiper";
|
||||
import { Navigation } from "swiper/modules";
|
||||
import { defineOptions, nextTick, onMounted, ref, useAttrs, reactive } from "vue";
|
||||
import route from "./../../modules/route";
|
||||
import trans from "./../../modules/trans";
|
||||
import parseLaravelErrorMessages from "./../../modules/parseLaravelErrorMessages";
|
||||
import slugify from "slugify";
|
||||
import SearchBelongsToDropdownComponent from "./../../bo/components/SearchBelongsToDropdownComponent.vue";
|
||||
|
||||
defineOptions({
|
||||
name: "SearchModelComponent"
|
||||
});
|
||||
|
||||
// * ATTRIBUTES
|
||||
const attrs = useAttrs();
|
||||
|
||||
// * REFS
|
||||
const searchModel = ref<HTMLDivElement|null>(null);
|
||||
const filtersList = ref<HTMLDivElement|null>(null);
|
||||
const childrenList = ref<HTMLDivElement|null>(null);
|
||||
|
||||
// * DATA
|
||||
|
||||
/** Texts parameters. */
|
||||
const textsParameters = reactive<{
|
||||
title: string,
|
||||
subtitle: string,
|
||||
paragraph: string,
|
||||
}>({
|
||||
title: "",
|
||||
subtitle: "",
|
||||
paragraph: "",
|
||||
});
|
||||
|
||||
/** Filters parameters */
|
||||
const filters = ref<Array<{
|
||||
id: string,
|
||||
title: string,
|
||||
models: LaravelModelList,
|
||||
route: string,
|
||||
children: {
|
||||
models: LaravelModelList,
|
||||
route: string,
|
||||
}|null
|
||||
}>>([]);
|
||||
|
||||
/** Filters details parameters. */
|
||||
const filtersDetailsParameters = reactive<{
|
||||
viewsPaginate: Array<string>,
|
||||
defaultPath: string,
|
||||
selectedFilter: string,
|
||||
selectedChildFilter: string,
|
||||
selectedFilterId: string,
|
||||
}>({
|
||||
viewsPaginate: [],
|
||||
defaultPath: "",
|
||||
selectedFilter: "",
|
||||
selectedChildFilter: "",
|
||||
selectedFilterId: "",
|
||||
});
|
||||
|
||||
/** Search parameters */
|
||||
const searchParameters = reactive<{
|
||||
modelTarget: string,
|
||||
modelListPaginate: LaravelPaginator|undefined,
|
||||
routeWords: string,
|
||||
routeList: string,
|
||||
fieldName: string,
|
||||
placeholder: string,
|
||||
selectedList: VselectOption[]|null,
|
||||
}>({
|
||||
modelTarget: "",
|
||||
modelListPaginate: undefined,
|
||||
routeWords: "",
|
||||
routeList: "",
|
||||
fieldName: "",
|
||||
placeholder: "",
|
||||
selectedList: null,
|
||||
});
|
||||
|
||||
/** Pagination parameters. */
|
||||
const paginationParameters = reactive<{
|
||||
page: number,
|
||||
lastPage: number,
|
||||
loading: boolean,
|
||||
}>({
|
||||
page: 1,
|
||||
lastPage: 1,
|
||||
loading: false,
|
||||
});
|
||||
|
||||
const swiper = ref<Swiper|null>(null);
|
||||
const loading = ref<boolean>(false);
|
||||
|
||||
// * LIFECYCLE
|
||||
onMounted(() => {
|
||||
const json = String(attrs.json ?? "{}"),
|
||||
data = JSON.parse(json);
|
||||
|
||||
/** Texts parameters. */
|
||||
textsParameters.title = data.texts.title;
|
||||
textsParameters.subtitle = data.texts.subtitle;
|
||||
textsParameters.paragraph = data.texts.paragraph;
|
||||
|
||||
/** Filters parameters */
|
||||
filters.value = data.filters;
|
||||
|
||||
/** Filters details parameters. */
|
||||
filtersDetailsParameters.viewsPaginate = data.filtersDetails.viewsPaginate.data;
|
||||
filtersDetailsParameters.defaultPath = data.filtersDetails.defaultPath;
|
||||
filtersDetailsParameters.selectedFilter = data.filtersDetails.selectedFilter;
|
||||
filtersDetailsParameters.selectedChildFilter = data.filtersDetails.selectedChildFilter;
|
||||
|
||||
/** Pagination parameters. */
|
||||
paginationParameters.page = data.filtersDetails.viewsPaginate.current_page;
|
||||
paginationParameters.lastPage = data.filtersDetails.viewsPaginate.last_page;
|
||||
|
||||
/** Search parameters. */
|
||||
searchParameters.modelTarget = data.search.modelTarget;
|
||||
searchParameters.modelListPaginate = data.search.modelListPaginate;
|
||||
searchParameters.modelTarget = data.search.modelTarget;
|
||||
searchParameters.routeWords = data.search.routeWords;
|
||||
searchParameters.routeList = data.search.routeList;
|
||||
searchParameters.fieldName = data.search.fieldName;
|
||||
searchParameters.placeholder = data.search.placeholder;
|
||||
|
||||
checkScroll();
|
||||
updateTitle(filtersDetailsParameters.selectedFilter);
|
||||
nextTick(() => {
|
||||
filtersDetailsParameters.selectedFilterId = String(getFilterId());
|
||||
initChildrenSwiper();
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Init children slider.
|
||||
* @return void
|
||||
*/
|
||||
function initChildrenSwiper(): void {
|
||||
nextTick(() => {
|
||||
swiper.value = new Swiper(".swiper-children", {
|
||||
modules: [Navigation],
|
||||
grabCursor: true,
|
||||
slidesPerView: "auto",
|
||||
spaceBetween: 20,
|
||||
navigation: {
|
||||
nextEl: ".children-list .swiper-btn-next",
|
||||
prevEl: ".children-list .swiper-btn-prev",
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if all models are loaded,
|
||||
* if not, get next models.
|
||||
* @return void
|
||||
*/
|
||||
function checkScroll(): void {
|
||||
window.addEventListener("scroll", () => {
|
||||
if (
|
||||
(window.innerHeight + window.scrollY) >= (document.body.offsetHeight - 800)
|
||||
&& !loading.value
|
||||
&& !paginationParameters.loading
|
||||
&& paginationParameters.page < paginationParameters.lastPage
|
||||
) {
|
||||
paginationParameters.page++;
|
||||
paginationParameters.loading = true;
|
||||
let routeCustom = (searchParameters.selectedList?.length)
|
||||
? (getRouteFilter(searchParameters.routeWords) + `?page=${paginationParameters.page}&words=${searchParameters.selectedList.join(",")}`)
|
||||
: getRouteFilter(
|
||||
filters.value[getFilterById(filtersDetailsParameters.selectedFilterId)].route,
|
||||
(filtersDetailsParameters.selectedChildFilter.length)
|
||||
? { model_slug: filtersDetailsParameters.selectedFilter, child_slug: filtersDetailsParameters.selectedChildFilter, page: paginationParameters.page }
|
||||
: (filtersDetailsParameters.selectedFilter.length)
|
||||
? { model_slug: filtersDetailsParameters.selectedFilter, page: paginationParameters.page }
|
||||
: { page: paginationParameters.page }
|
||||
);
|
||||
let url = (filtersDetailsParameters.selectedChildFilter.length)
|
||||
? filtersDetailsParameters.selectedChildFilter
|
||||
: ((filtersDetailsParameters.selectedFilter.length)
|
||||
? filtersDetailsParameters.selectedFilter
|
||||
: "");
|
||||
let title = (searchParameters.selectedList?.length)
|
||||
? searchParameters.selectedList.join(", ")
|
||||
: url;
|
||||
let children = filters.value[getFilterById(filtersDetailsParameters.selectedFilterId)].children ? true : false;
|
||||
ajaxCall(routeCustom, url, title, children, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get models by search words.
|
||||
* @return void
|
||||
*/
|
||||
function getModelByText(elements: VselectOption|VselectOption[]|null) {
|
||||
if (elements !== null){
|
||||
searchParameters.selectedList = (!Array.isArray(elements)) ? [elements] : elements;
|
||||
resetList();
|
||||
ajaxCall(
|
||||
getRouteFilter(searchParameters.routeWords) + `?words=${searchParameters.selectedList.join(",")}`,
|
||||
`${location.origin}/${filtersDetailsParameters.defaultPath}`,
|
||||
searchParameters.selectedList.join(", "),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get models by filter checked.
|
||||
* @param {
|
||||
title: string,
|
||||
models: LaravelModelList,
|
||||
route: string,
|
||||
} filter
|
||||
* @param LaravelModel|null model
|
||||
* @param Event|null event
|
||||
* @return void
|
||||
*/
|
||||
function getModelByFilters(filter: {
|
||||
title: string,
|
||||
models: LaravelModelList,
|
||||
route: string,
|
||||
}, model: LaravelModel|null = null, event: Event|null = null): void {
|
||||
let target = getTarget(event);
|
||||
if (!filtersList.value) {
|
||||
throw new Error("Undefined filters list");
|
||||
}
|
||||
searchParameters.selectedList = null;
|
||||
filtersDetailsParameters.selectedFilter = "";
|
||||
filtersDetailsParameters.selectedChildFilter = "";
|
||||
resetFilters(filtersList.value, target?.checked ? target?.id : null);
|
||||
filtersDetailsParameters.selectedFilterId = String(getFilterId());
|
||||
filtersDetailsParameters.selectedFilter = target?.checked ? slugify(String(model?.label ?? model?.title), { lower: true }) : "";
|
||||
paginationParameters.page = 1;
|
||||
ajaxCall(
|
||||
getRouteFilter(filter.route, target?.checked ? { model_slug: String(model?.slug), page: paginationParameters.page } : { page: paginationParameters.page }),
|
||||
target?.checked ? getRouteFilter(filter.route).split("MODELSLUG")[0] + String(model?.slug) : `${location.origin}/${filtersDetailsParameters.defaultPath}`,
|
||||
target?.checked ? String(model?.label ?? model?.title) : "",
|
||||
filters.value[getFilterById(filtersDetailsParameters.selectedFilterId)].children ? true : false,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get models by child checked.
|
||||
* @param {
|
||||
models: LaravelModelList,
|
||||
route: string,
|
||||
} children
|
||||
* @param LaravelModel|null model
|
||||
* @param Event|null event
|
||||
* @return void
|
||||
*/
|
||||
function getModelByChildren(children: {
|
||||
models: LaravelModelList,
|
||||
route: string,
|
||||
}, model: LaravelModel|null = null, event: Event|null = null): void {
|
||||
let target = getTarget(event);
|
||||
if (!childrenList.value) {
|
||||
throw new Error("Undefined children list");
|
||||
}
|
||||
searchParameters.selectedList = null;
|
||||
filtersDetailsParameters.selectedChildFilter = "";
|
||||
resetFilters(childrenList.value, target?.checked ? target?.id : null);
|
||||
filtersDetailsParameters.selectedChildFilter = target?.checked ? slugify(String(model?.label ?? model?.title), { lower: true }) : "";
|
||||
paginationParameters.page = 1;
|
||||
ajaxCall(
|
||||
getRouteFilter(target?.checked ? children.route : filters.value[getFilterById(filtersDetailsParameters.selectedFilterId)].route, target?.checked ? { model_slug: filtersDetailsParameters.selectedFilter, child_slug: String(model?.slug), page: paginationParameters.page } : { model_slug: filtersDetailsParameters.selectedFilter, page: paginationParameters.page }),
|
||||
target?.checked ? `${getRouteFilter(children.route).split("MODELSLUG")[0]}${filtersDetailsParameters.selectedFilter}/${String(model?.slug)}` : getRouteFilter(children.route).split("MODELSLUG")[0] + filtersDetailsParameters.selectedFilter,
|
||||
target?.checked ? `${filtersDetailsParameters.selectedFilter}, ${String(model?.label ?? model?.title)}` : filtersDetailsParameters.selectedFilter,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajax call template to get models views list.
|
||||
* @param string customRoute
|
||||
* @param string url
|
||||
* @param string title
|
||||
* @param string title
|
||||
* @param boolean updateChildren
|
||||
* @return void
|
||||
*/
|
||||
function ajaxCall(
|
||||
customRoute: string,
|
||||
url: string,
|
||||
title: string,
|
||||
updateChildren: boolean = false,
|
||||
concatResult: boolean = false
|
||||
): void {
|
||||
(concatResult) ? paginationParameters.loading = true : loading.value = true;
|
||||
window.axios
|
||||
.get(customRoute)
|
||||
.then((reponse) => {
|
||||
paginationParameters.page = reponse.data.viewsPaginate.current_page;
|
||||
paginationParameters.lastPage = reponse.data.viewsPaginate.last_page;
|
||||
filtersDetailsParameters.viewsPaginate = (concatResult)
|
||||
? filtersDetailsParameters.viewsPaginate.concat(reponse.data.viewsPaginate.data)
|
||||
: reponse.data.viewsPaginate.data;
|
||||
if (updateChildren) {
|
||||
filters.value[getFilterById(filtersDetailsParameters.selectedFilterId)].children!.models = reponse.data.children;
|
||||
}
|
||||
setTimeout(initChildrenSwiper, 311);
|
||||
updateURL(url);
|
||||
updateTitle(title);
|
||||
(!concatResult) ? setTimeout(() => { searchModel.value?.scrollIntoView(); }, 10) : "";
|
||||
})
|
||||
.then(() => {
|
||||
(concatResult) ? paginationParameters.loading = false : setTimeout(() => { loading.value = false; }, 310);
|
||||
})
|
||||
.catch(ajaxErrorHandler);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get route filter.
|
||||
* @param string routeName
|
||||
* @param Record<string, string|number|(string|number)[]> parameters
|
||||
* @return void
|
||||
*/
|
||||
function getRouteFilter(routeName: string, parameters: Record<string, string|number|(string|number)[]> = {}): string {
|
||||
const routeFilter = route.methods.route(routeName, parameters);
|
||||
if (!routeFilter) {
|
||||
throw new Error("Undefined route " + routeName);
|
||||
}
|
||||
return routeFilter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update h1 title of the page.
|
||||
* @param string newTitle
|
||||
* @return void
|
||||
*/
|
||||
function updateTitle(newTitle: string): void {
|
||||
document.querySelector("h1")!.textContent = textsParameters.title + newTitle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update url of the page.
|
||||
* @param string newURL
|
||||
* @return void
|
||||
*/
|
||||
function updateURL(newURL: string): void {
|
||||
history.replaceState("Object", "", newURL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get checked filter id.
|
||||
* @return string|void
|
||||
*/
|
||||
function getFilterId(): string|void {
|
||||
const inputs = searchModel.value?.querySelectorAll("input[type='checkbox']") as NodeListOf<HTMLInputElement>;
|
||||
for (let index = 0; index < inputs.length; index++) {
|
||||
if (inputs[index].checked) {
|
||||
return inputs[index].name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get filter index by id.
|
||||
* @param string id
|
||||
* @return number
|
||||
*/
|
||||
function getFilterById(id: string): number {
|
||||
for (let index = 0; index < filters.value.length; index++) {
|
||||
if (filters.value[index].id === id) {
|
||||
return index;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the target of a click event.
|
||||
* @param event Event|null
|
||||
* @return HTMLInputElement|undefined
|
||||
*/
|
||||
function getTarget(event: Event|null): HTMLInputElement|undefined {
|
||||
let target = undefined as HTMLInputElement|undefined;
|
||||
if (event && event.target) {
|
||||
target = event.target as HTMLInputElement;
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the models list and all filters.
|
||||
* @return void
|
||||
*/
|
||||
function resetList(getModels: boolean = false): void {
|
||||
if (!searchModel.value) {
|
||||
throw new Error("Undefined search model wrapper");
|
||||
}
|
||||
filtersDetailsParameters.selectedFilter = "";
|
||||
filtersDetailsParameters.selectedChildFilter = "";
|
||||
resetFilters(searchModel.value);
|
||||
if (getModels)
|
||||
getModelByFilters(filters.value[getFilterById(filtersDetailsParameters.selectedFilterId)]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset all filters.
|
||||
* @param HTMLDivElement nodeElement
|
||||
* @param string|null inputId
|
||||
* @return void
|
||||
*/
|
||||
function resetFilters(nodeElement: HTMLDivElement, inputId: string|null = null): void {
|
||||
const inputs = nodeElement?.querySelectorAll("input[type='checkbox']") as NodeListOf<HTMLInputElement>;
|
||||
inputs.forEach(input => {
|
||||
input.checked = (inputId === input.id) ? true : false;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Return error message after the ajax call.
|
||||
* @param e any
|
||||
* @return void
|
||||
*/
|
||||
function ajaxErrorHandler(e: any): void {
|
||||
let message = trans.methods.__("Une erreur est survenue");
|
||||
if (e.response.status === 422) {
|
||||
message = parseLaravelErrorMessages.methods.parseValidationErrors(
|
||||
e.response?.data?.errors ?? {}
|
||||
) || message;
|
||||
if (window.vueDebug) {
|
||||
console.warn(e.response.data.errors);
|
||||
}
|
||||
} else if (e.response.status === 419) {
|
||||
console.log(trans.methods.__("Votre session a expiré, la page va être rechargée"));
|
||||
setTimeout(() => window.location.reload(), 2000);
|
||||
} else if (e.response.status === 403) {
|
||||
console.log(trans.methods.__("Vous n'êtes pas autorisé a effectuer cette action"));
|
||||
setTimeout(() => window.location.reload(), 2000);
|
||||
} else {
|
||||
if (window.vueDebug) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
console.log(message);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scopped>
|
||||
@import "bootstrap/scss/functions";
|
||||
@import "bootstrap/scss/variables";
|
||||
@import "bootstrap/scss/mixins";
|
||||
@import "swiper/css";
|
||||
@import "swiper/css/navigation";
|
||||
|
||||
.search-model-component {
|
||||
scroll-margin-top: 7rem;
|
||||
@include media-breakpoint-up(md) {
|
||||
.offcanvas-md {
|
||||
.line-border-small {
|
||||
background-color: rgb(var(--bs-white-rgb)) !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
.filters-list {
|
||||
position: sticky;
|
||||
top: 7rem;
|
||||
z-index: 2;
|
||||
}
|
||||
.filters-list:has(.offcanvas-md.show, .offcanvas-md.showing) {
|
||||
z-index: 1050;
|
||||
}
|
||||
.placeholder-title {
|
||||
height: 1.76rem;
|
||||
}
|
||||
.placeholder-time {
|
||||
height: 1.3rem;
|
||||
}
|
||||
.placeholder-tag {
|
||||
height: 1.1rem;
|
||||
}
|
||||
.no-result-icon {
|
||||
width: 4rem;
|
||||
height: 4rem;
|
||||
}
|
||||
.form-check-label.btn-secondary::after {
|
||||
content: 'X';
|
||||
position: absolute;
|
||||
top: -.5rem;
|
||||
right: -.5rem;
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
background: var(--bs-btn-bg);
|
||||
border-radius: 100%;
|
||||
}
|
||||
button[data-bs-toggle="collapse"] span {
|
||||
rotate: -90deg;
|
||||
transition: .3s;
|
||||
}
|
||||
button[data-bs-toggle="collapse"].collapsed span {
|
||||
rotate: 90deg !important;
|
||||
}
|
||||
.swiper-btns {
|
||||
width: 2rem;
|
||||
height: 2rem;
|
||||
}
|
||||
.swiper-btn-prev {
|
||||
left: 0;
|
||||
transform: translateY(-50%) rotate(180deg);
|
||||
}
|
||||
.swiper-btn-next {
|
||||
right: 0;
|
||||
}
|
||||
.search-custom {
|
||||
.vs__dropdown-toggle {
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
padding: 0.75rem 1.12rem !important;
|
||||
}
|
||||
.vs__dropdown-menu {
|
||||
background-color: var(--bs-white);
|
||||
}
|
||||
.vs--multiple .vs__selected {
|
||||
margin: .375rem .5rem .375rem 0 !important;
|
||||
}
|
||||
.vs__search {
|
||||
margin: 0 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,6 +1,12 @@
|
|||
import { config, dom, library } from "@fortawesome/fontawesome-svg-core";
|
||||
import { faUser } from "@fortawesome/free-regular-svg-icons";
|
||||
import { faMagnifyingGlass, faPause, faPlay, faXmark } from "@fortawesome/free-solid-svg-icons";
|
||||
import {
|
||||
faMagnifyingGlass,
|
||||
faPause,
|
||||
faPlay,
|
||||
faTriangleExclamation,
|
||||
faXmark
|
||||
} from "@fortawesome/free-solid-svg-icons";
|
||||
|
||||
config.autoReplaceSvg = false;
|
||||
|
||||
|
|
@ -9,5 +15,6 @@ library.add(faUser);
|
|||
library.add(faXmark);
|
||||
library.add(faPause);
|
||||
library.add(faPlay);
|
||||
library.add(faTriangleExclamation);
|
||||
|
||||
dom.watch();
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
id="main-container">
|
||||
<div class="row justify-content-center @guest w-100 mx-auto @endguest">
|
||||
@include('bo.layouts.sidemenu')
|
||||
<div class="@auth('backend') col-md-8 col-lg-9 col-xxl-10 ms-sm-auto p-3 py-2 py-md-3 @else col px-md-4 pb-5 @endauth">
|
||||
<div class="@auth('backend') col-12 col-lg-8 col-xl-9 col-xxxl-10 ms-sm-auto p-3 py-2 py-md-3 @else col px-md-4 pb-5 @endauth">
|
||||
@auth('backend')
|
||||
@include('modules.flash-messages')
|
||||
@endauth
|
||||
|
|
|
|||
|
|
@ -1,14 +1,16 @@
|
|||
<header class="navbar @auth('backend') navbar-expand-md @else navbar-expand @endauth position-fixed fixed-top bg-body-tertiary shadow-sm"
|
||||
<header
|
||||
class="navbar @auth('backend') navbar-expand-lg @else navbar-expand @endauth position-fixed fixed-top bg-body-tertiary shadow-sm"
|
||||
id="top-navbar">
|
||||
<div class="container-fluid">
|
||||
{{-- BUTTON MENU NAVIGATION --}}
|
||||
@auth('backend')
|
||||
<button class="navbar-toggler" data-bs-toggle="collapse" data-bs-target="#menuNavigation" type="button" aria-controls="menuNavigation"
|
||||
aria-expanded="false" aria-label="{{ __('Afficher/Masquer le menu de navigation') }}">
|
||||
<button class="navbar-toggler" data-bs-toggle="collapse" data-bs-target="#menuNavigation" type="button"
|
||||
aria-controls="menuNavigation" aria-expanded="false"
|
||||
aria-label="{{ __('Afficher/Masquer le menu de navigation') }}">
|
||||
<i class="fa-solid fa-ellipsis-vertical fa-lg"></i>
|
||||
</button>
|
||||
@endauth
|
||||
<a class="navbar-brand fs-4 fw-bold @canAny(['isConceptor', 'viewAny'], \App\Models\User::class) border-md-end @endcan me-md-2 pe-md-3 m-0 p-0"
|
||||
<a class="navbar-brand fs-4 fw-bold @canAny(['isConceptor', 'viewAny'], \App\Models\User::class) border-lg-end @endcan me-lg-2 pe-lg-3 m-0 p-0"
|
||||
data-bs-toggle="tooltip" data-bs-placement="bottom" href="{{ route('fo.home.show') }}"
|
||||
title="{{ __('Accéder au front du projet') }}" target="_blank">
|
||||
{{ config('app.name', 'Laravel') }}
|
||||
|
|
@ -30,18 +32,6 @@
|
|||
<!-- Left Side Of Navbar -->
|
||||
@canAny(['isConceptor', 'viewAny'], \App\Models\User::class)
|
||||
<ul class="navbar-nav me-auto">
|
||||
@can('viewAny', \App\Models\GeneralSetting::class)
|
||||
<li class="nav-item">
|
||||
<a @class([
|
||||
'nav-link d-flex align-items-center h-100',
|
||||
'active' => request()->routeIs('bo.general_settings.*'),
|
||||
])
|
||||
data-bs-toggle="tooltip" href="{{ route('bo.general_settings.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => trans_choice('models.classes.general_setting', \INF)]) }}">
|
||||
{{ str(trans_choice('models.classes.general_setting', \INF))->ucfirst() }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
@can('viewAny', \App\Models\User::class)
|
||||
<li class="nav-item">
|
||||
<a @class([
|
||||
|
|
@ -71,54 +61,71 @@
|
|||
<!-- Right Side Of Navbar -->
|
||||
<ul class="navbar-nav ms-auto">
|
||||
<!-- Bootstrap themes -->
|
||||
<li class="nav-item dropdown @auth('backend') border-md-end @endauth">
|
||||
<li class="nav-item dropdown @auth('backend') border-lg-end @endauth">
|
||||
<button class="btn nav-link dropdown-toggle d-flex align-items-center h-100 flex-row border-0 pe-3"
|
||||
data-bs-toggle="dropdown" type="button" aria-expanded="false" aria-label="Changer les couleurs de l'interface du back-office">
|
||||
<span class="fa-solid fa-paint-roller"></span>
|
||||
<i class="d-none d-xl-block fa-solid fa-paint-roller"></i>
|
||||
<span class="d-xl-none">{{ __('Thème') }}</span>
|
||||
</button>
|
||||
<form class="dropdown-menu dropdown-menu-end text-center" id="theme-selector" action="{{ route('bo.theme.set') }}"
|
||||
method="POST">
|
||||
@push('scripts')
|
||||
<script @if (!empty($nonce)) nonce="{{ $nonce }}" @endif> document.addEventListener('DOMContentLoaded', function() { const themeSelector = document.getElementById('theme-selector'); if (themeSelector) { themeSelector.addEventListener('change', function() { this.submit(); }); } }); </script> @endpush @csrf @use('\App\Enums\Theme\BootstrapThemeEnum', 'BootstrapThemeEnum') @foreach (BootstrapThemeEnum::toArray() as $key => $bootstrapTheme) <input class="btn-check"
|
||||
id="theme{{ $key }}" name="theme" type="radio" value="{{ $bootstrapTheme->value }}">
|
||||
<label for="theme{{ $key }}" @class([
|
||||
'dropdown-item btn btn-secondary py-2',
|
||||
'active' => !is_null(Cache::get('theme'))
|
||||
? $bootstrapTheme->value === intval(Cache::get('theme'))
|
||||
: $bootstrapTheme->value === BootstrapThemeEnum::light->value,
|
||||
])>{{ str($bootstrapTheme->label)->ucFirst() }}</label>
|
||||
@endforeach
|
||||
</form>
|
||||
</li>
|
||||
<!-- Authentication Links -->
|
||||
@auth('backend')
|
||||
<li class="nav-item dropdown">
|
||||
<button class="btn nav-link dropdown-toggle d-flex align-items-center h-100 ps-md-3 flex-row border-0" id="navbarDropdown"
|
||||
data-bs-toggle="dropdown" type="button">
|
||||
<div class="d-flex flex-column align-items-start align-items-md-end lh-1">
|
||||
<span
|
||||
class="fw-bold">{{ auth('backend')->user()->first_name }} {{ auth('backend')->user()->last_name }}</span>
|
||||
<small class="text-secondary-body">{{ str(auth('backend')->user()->role->label())->ucFirst() }}</small>
|
||||
</div>
|
||||
</button>
|
||||
<div class="dropdown-menu dropdown-menu-end m-0 text-center" aria-labelledby="navbarDropdown">
|
||||
<a class="dropdown-item w-100 text-decoration-none p-2" data-bs-toggle="tooltip" data-bs-placement="left"
|
||||
href="{{ route('bo.users.edit', auth('backend')->user()->getKey()) }}" title="{{ __('Accéder à son profile') }}">
|
||||
{{ __('Profile') }}
|
||||
</a>
|
||||
<hr class="dropdown-divider m-0">
|
||||
<form class="m-0 text-center" id="logout-form" action="{{ route('bo.logout') }}" method="POST">
|
||||
<script @if (!empty($nonce)) nonce="{{ $nonce }}" @endif>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const themeSelector = document.getElementById('theme-selector');
|
||||
if (themeSelector) {
|
||||
themeSelector.addEventListener('change', function() {this.submit(); });
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@csrf
|
||||
<button class="dropdown-item w-100 text-decoration-none p-2" data-bs-toggle="tooltip" data-bs-placement="left"
|
||||
type="submit" title="{{ __('Se déconnecter du back-office') }}">
|
||||
{{ __('Déconnexion') }}
|
||||
</button>
|
||||
@use('\App\Enums\Theme\BootstrapThemeEnum', 'BootstrapThemeEnum')
|
||||
@foreach (BootstrapThemeEnum::toArray() as $key => $bootstrapTheme)
|
||||
<input class="btn-check" id="theme{{ $key }}" name="theme" type="radio"
|
||||
value="{{ $bootstrapTheme->value }}">
|
||||
<label for="theme{{ $key }}" @class([
|
||||
'dropdown-item btn btn-secondary py-2',
|
||||
'active' => !is_null(Cache::get('theme'))
|
||||
? $bootstrapTheme->value === intval(Cache::get('theme'))
|
||||
: $bootstrapTheme->value === BootstrapThemeEnum::light->value,
|
||||
])>{{ str($bootstrapTheme->label)->ucFirst() }}</label>
|
||||
@endforeach
|
||||
</form>
|
||||
</div>
|
||||
</li>
|
||||
@endauth
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<!-- Authentication Links -->
|
||||
@auth('backend')
|
||||
<li class="nav-item dropdown">
|
||||
<button class="btn nav-link dropdown-toggle d-flex align-items-center h-100 ps-lg-3 flex-row border-0"
|
||||
id="navbarDropdown" data-bs-toggle="dropdown" type="button">
|
||||
<div class="d-flex flex-column align-items-start align-items-lg-end lh-1">
|
||||
<span class="fw-bold">
|
||||
{{ auth('backend')->user()->first_name }} {{ auth('backend')->user()->last_name }}
|
||||
</span>
|
||||
<small class="text-secondary-body">
|
||||
{{ str(auth('backend')->user()->role->label())->ucFirst() }}
|
||||
</small>
|
||||
</div>
|
||||
</button>
|
||||
<div class="dropdown-menu dropdown-menu-end m-0 text-center" aria-labelledby="navbarDropdown">
|
||||
<a class="dropdown-item w-100 text-decoration-none p-2" data-bs-toggle="tooltip"
|
||||
data-bs-placement="left" href="{{ route('bo.users.edit', auth('backend')->user()->getKey()) }}"
|
||||
title="{{ __('Accéder à son profile') }}">
|
||||
{{ __('Profile') }}
|
||||
</a>
|
||||
<hr class="dropdown-divider m-0">
|
||||
<form class="m-0 text-center" id="logout-form" action="{{ route('bo.logout') }}" method="POST">
|
||||
@csrf
|
||||
<button class="dropdown-item w-100 text-decoration-none p-2" data-bs-toggle="tooltip"
|
||||
data-bs-placement="left" type="submit" title="{{ __('Se déconnecter du back-office') }}">
|
||||
{{ __('Déconnexion') }}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</li>
|
||||
@endauth
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
@use('\App\Enums\Approaches\ApproachTypeEnum', 'ApproachTypeEnum')
|
||||
@auth('backend')
|
||||
<nav class="col-md-4 col-lg-3 col-xxl-2 d-md-block bg-body-tertiary sidebar collapse overflow-x-visible"
|
||||
<nav class="col-lg-4 col-xl-3 col-xxxl-2 d-lg-block bg-body-tertiary sidebar collapse overflow-x-visible"
|
||||
id="menuNavigation">
|
||||
<div class="sidemenu py-2">
|
||||
{{-- HOME --}}
|
||||
|
|
@ -9,196 +9,519 @@
|
|||
'btn btn-primary w-100 text-start',
|
||||
'fw-bold active' => request()->routeIs('bo.dashboard'),
|
||||
])>
|
||||
<i class="fa-solid fa-house me-1"></i>
|
||||
{{ __('Accueil') }}
|
||||
<i @class([
|
||||
"fa-solid fa-table-columns fa-fw",
|
||||
'fa-lg' => request()->routeIs('bo.dashboard')
|
||||
])></i>
|
||||
{{ __('Accueil administration') }}
|
||||
</a>
|
||||
{{-- STATIC PAGES --}}
|
||||
<a data-bs-toggle="tooltip" href="{{ route('bo.static_pages.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => trans_choice('models.classes.static_page', \INF)]) }}"
|
||||
role="button" @class([
|
||||
'btn btn-primary w-100 text-start mt-1',
|
||||
'fw-bold active' => request()->routeIs('bo.static_pages.*'),
|
||||
])>
|
||||
<i class="fa-solid fa-file me-1"></i>
|
||||
{{ str(trans_choice('models.classes.static_page', \INF))->ucFirst() }}
|
||||
</a>
|
||||
{{-- PROFESSIONS --}}
|
||||
<a data-bs-toggle="tooltip" href="{{ route('bo.professions.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.profession')]) }}" role="button"
|
||||
@class([
|
||||
'btn btn-primary w-100 text-start mt-1',
|
||||
'fw-bold active' => request()->routeIs('bo.professions.*'),
|
||||
])>
|
||||
<i class="fa-solid fa-user-tie me-1"></i>
|
||||
{{ str(__('models.classes.profession'))->ucFirst() }}
|
||||
</a>
|
||||
{{-- BRAND ADVANTAGES --}}
|
||||
<a data-bs-toggle="tooltip" href="{{ route('bo.brand_advantages.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => trans_choice('models.classes.brand_advantage', \INF)]) }}"
|
||||
role="button" @class([
|
||||
'btn btn-primary w-100 text-start mt-1',
|
||||
'fw-bold active' => request()->routeIs('bo.brand_advantages.*'),
|
||||
])>
|
||||
<i class="fa-solid fa-thumbs-up me-1"></i>
|
||||
{{ str(trans_choice('models.classes.brand_advantage', \INF))->ucFirst() }}
|
||||
</a>
|
||||
{{-- KEYNUMBERS --}}
|
||||
<a data-bs-toggle="tooltip" href="{{ route('bo.key_numbers.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.key_number')]) }}" role="button"
|
||||
@class([
|
||||
'btn btn-primary w-100 text-start mt-1',
|
||||
'fw-bold active' => request()->routeIs('bo.key_numbers.*'),
|
||||
])>
|
||||
<i class="fa-solid fa-key me-1"></i> {{ str(__('models.classes.key_number'))->ucFirst() }}
|
||||
</a>
|
||||
{{-- CARROUSELS --}}
|
||||
{{-- HOME PAGE --}}
|
||||
<div class="dropdown">
|
||||
<button data-bs-toggle="dropdown" type="button" aria-expanded="false" @class([
|
||||
'btn btn-primary text-start w-100 dropdown-toggle mt-1',
|
||||
'fw-bold active' =>
|
||||
request()->is('bo/general_settings/1/edit') ||
|
||||
request()->is('bo/general_settings/2/edit') ||
|
||||
request()->routeIs('bo.main_slides.*') ||
|
||||
request()->routeIs('bo.demarche_slides.*'),
|
||||
])>
|
||||
<i class="fa-solid fa-panorama"></i> {{ __('Carrousels') }}
|
||||
<i @class([
|
||||
"fa-solid fa-house me-1 fa-fw",
|
||||
'fa-lg' =>
|
||||
request()->routeIs('bo.general_settings.*') ||
|
||||
request()->routeIs('bo.main_slides.*') ||
|
||||
request()->routeIs('bo.demarche_slides.*'),
|
||||
])></i>
|
||||
{{ __('Accueil du site') }}
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li>
|
||||
<a class="dropdown-item" href="{{ route('bo.main_slides.index') }}">
|
||||
{{-- MAIN MENU --}}
|
||||
<li class="py-1">
|
||||
<a @class([
|
||||
"dropdown-item",
|
||||
'fw-bold text-bg-secondary' => request()->is('bo/general_settings/1/edit')
|
||||
]) data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.general_settings.edit', $mainMenuSettingModel) }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => $mainMenuSettingModel->type->label()]) }}">
|
||||
<i @class([
|
||||
"fa-solid fa-bars fa-fw",
|
||||
'fa-lg' => request()->routeIs('bo.general_settings.edit')
|
||||
])></i> {{ $mainMenuSettingModel->type->label() }}
|
||||
</a>
|
||||
</li>
|
||||
{{-- MAIN CARROUSELS --}}
|
||||
<li class="py-1">
|
||||
<a @class([
|
||||
"dropdown-item",
|
||||
'fw-bold text-bg-secondary' => request()->routeIs('bo.main_slides.*')
|
||||
]) data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.main_slides.index') }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => trans('models.classes.main_slide')]) }}">
|
||||
<i @class([
|
||||
"fa-solid fa-panorama fa-fw",
|
||||
'fa-lg' => request()->routeIs('bo.main_slides.*')
|
||||
])></i>
|
||||
{{ str(__('models.classes.main_slide'))->ucFirst() }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="dropdown-item" href="{{ route('bo.demarche_slides.index') }}">
|
||||
{{-- HOT NEWS --}}
|
||||
<li class="py-1">
|
||||
<a @class([
|
||||
"dropdown-item",
|
||||
'fw-bold text-bg-secondary' => request()->is('bo/general_settings/2/edit')
|
||||
]) data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.general_settings.edit', $hotNewsSettingModel) }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => $hotNewsSettingModel->type->label()]) }}">
|
||||
<i @class([
|
||||
"fa-solid fa-newspaper fa-fw",
|
||||
'fa-lg' => request()->routeIs('bo.general_settings.edit')
|
||||
])></i>
|
||||
{{ $hotNewsSettingModel->type->label() }}
|
||||
</a>
|
||||
</li>
|
||||
{{-- DEMARCHES CARROUSELS --}}
|
||||
<li class="py-1">
|
||||
<a @class([
|
||||
"dropdown-item",
|
||||
'fw-bold text-bg-secondary' => request()->routeIs('bo.demarche_slides.*')
|
||||
]) data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.demarche_slides.index') }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => trans('models.classes.demarche_slide')]) }}">
|
||||
<i @class([
|
||||
"fa-solid fa-panorama fa-fw",
|
||||
'fa-lg' => request()->routeIs('bo.demarche_slides.*')
|
||||
])></i>
|
||||
{{ str(__('models.classes.demarche_slide'))->ucFirst() }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{{-- WHO ARE WE PAGE --}}
|
||||
<div class="dropdown">
|
||||
<button data-bs-toggle="dropdown" type="button" aria-expanded="false" @class([
|
||||
'btn btn-primary text-start w-100 dropdown-toggle mt-1',
|
||||
'fw-bold active' =>
|
||||
url()->current() === route('bo.static_pages.edit', $storyStaticPageModel->type->value()) ||
|
||||
request()->routeIs('bo.key_numbers.*'),
|
||||
])>
|
||||
<i @class([
|
||||
"fa-solid fa-circle-question fa-fw",
|
||||
'fa-lg' =>
|
||||
url()->current() === route('bo.static_pages.edit', $storyStaticPageModel->type->value()) ||
|
||||
request()->routeIs('bo.key_numbers.*')
|
||||
])></i>
|
||||
{{ __('Qui sommes nous ?') }}
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
{{-- WHO ARE WE PAGE --}}
|
||||
<li class="py-1">
|
||||
<a @class([
|
||||
"dropdown-item",
|
||||
'fw-bold text-bg-secondary' => url()->current() === route('bo.static_pages.edit', $storyStaticPageModel->type->value())
|
||||
]) data-bs-toggle="tooltip" href="{{ route('bo.static_pages.edit', $storyStaticPageModel) }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => $storyStaticPageModel->type->label()]) }}">
|
||||
<i @class([
|
||||
"fa-solid fa-file fa-fw",
|
||||
'fa-lg' => url()->current() === route('bo.static_pages.edit', $storyStaticPageModel->type->value())
|
||||
])></i>
|
||||
{{ sprintf('Page %s', $storyStaticPageModel->type->label()) }}
|
||||
</a>
|
||||
</li>
|
||||
{{-- KEYNUMBERS --}}
|
||||
<li class="py-1">
|
||||
<a @class([
|
||||
"dropdown-item",
|
||||
'fw-bold text-bg-secondary' => request()->routeIs('bo.key_numbers.*')
|
||||
]) data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.key_numbers.index') }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => trans('models.classes.key_number')]) }}">
|
||||
<i @class([
|
||||
"fa-solid fa-key me-1 fa-fw",
|
||||
'fa-lg' => request()->routeIs('bo.key_numbers.*')
|
||||
])></i>
|
||||
{{ str(__('models.classes.key_number'))->ucFirst() }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{{-- ADVERTISING SAGA PAGE --}}
|
||||
<div class="dropdown">
|
||||
<button data-bs-toggle="dropdown" type="button" aria-expanded="false" @class([
|
||||
'btn btn-primary text-start w-100 dropdown-toggle mt-1',
|
||||
'fw-bold active' =>
|
||||
url()->current() === route('bo.static_pages.edit', $sagaStaticPageModel->type->value()) ||
|
||||
request()->routeIs('bo.videos.*'),
|
||||
])>
|
||||
<i @class([
|
||||
"fa-solid fa-rectangle-ad fa-fw",
|
||||
'fa-lg' =>
|
||||
url()->current() === route('bo.static_pages.edit', $sagaStaticPageModel->type->value()) ||
|
||||
request()->routeIs('bo.videos.*')
|
||||
])></i>
|
||||
{{ __('Saga publicitaire') }}
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
{{-- ADVERTISING SAGA PAGE --}}
|
||||
<li class="py-1">
|
||||
<a @class([
|
||||
"dropdown-item",
|
||||
'fw-bold text-bg-secondary' => url()->current() === route('bo.static_pages.edit', $sagaStaticPageModel->type->value())
|
||||
]) data-bs-toggle="tooltip" href="{{ route('bo.static_pages.edit', $sagaStaticPageModel) }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => $sagaStaticPageModel->type->label()]) }}">
|
||||
<i @class([
|
||||
"fa-solid fa-file fa-fw",
|
||||
'fa-lg' => url()->current() === route('bo.static_pages.edit', $sagaStaticPageModel->type->value())
|
||||
])></i>
|
||||
{{ sprintf('Page %s', $sagaStaticPageModel->type->label()) }}
|
||||
</a>
|
||||
</li>
|
||||
{{-- VIDEOS --}}
|
||||
<li class="py-1">
|
||||
<a @class([
|
||||
"dropdown-item",
|
||||
'fw-bold text-bg-secondary' => request()->routeIs('bo.videos.*')
|
||||
]) data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.videos.index') }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => __('models.classes.video')]) }}">
|
||||
<i @class([
|
||||
"fa-solid fa-film me-1 fa-fw",
|
||||
'fa-lg' => request()->routeIs('bo.videos.*')
|
||||
])></i>
|
||||
{{ str(__('models.classes.video'))->ucFirst()->plural() }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{{-- RECRUITMENT PAGE --}}
|
||||
<div class="dropdown">
|
||||
<button data-bs-toggle="dropdown" type="button" aria-expanded="false" @class([
|
||||
'btn btn-primary text-start w-100 dropdown-toggle mt-1',
|
||||
'fw-bold active' =>
|
||||
url()->current() === route('bo.static_pages.edit', $recruitmentStaticPageModel->type->value()) ||
|
||||
request()->routeIs('bo.professions.*') ||
|
||||
request()->routeIs('bo.brand_advantages.*'),
|
||||
])>
|
||||
<i @class([
|
||||
"fa-solid fa-briefcase fa-fw",
|
||||
'fa-lg' =>
|
||||
url()->current() === route('bo.static_pages.edit', $recruitmentStaticPageModel->type->value()) ||
|
||||
request()->routeIs('bo.professions.*') ||
|
||||
request()->routeIs('bo.brand_advantages.*'),
|
||||
])></i>
|
||||
{{ __('Recrutement') }}
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
{{-- RECRUITMENT PAGE --}}
|
||||
<li class="py-1">
|
||||
<a @class([
|
||||
"dropdown-item",
|
||||
'fw-bold text-bg-secondary' => url()->current() === route('bo.static_pages.edit', $recruitmentStaticPageModel->type->value())
|
||||
]) data-bs-toggle="tooltip" href="{{ route('bo.static_pages.edit', $recruitmentStaticPageModel) }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => $recruitmentStaticPageModel->type->label()]) }}">
|
||||
<i @class([
|
||||
"fa-solid fa-file fa-fw",
|
||||
'fa-lg' => url()->current() === route('bo.static_pages.edit', $recruitmentStaticPageModel->type->value())
|
||||
])></i>
|
||||
{{ sprintf('Page %s', $recruitmentStaticPageModel->type->label()) }}
|
||||
</a>
|
||||
</li>
|
||||
{{-- PROFESSIONS --}}
|
||||
<li class="py-1">
|
||||
<a @class([
|
||||
"dropdown-item",
|
||||
'fw-bold text-bg-secondary' => request()->routeIs('bo.professions.*')
|
||||
]) data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.professions.index') }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => __('models.classes.profession')]) }}">
|
||||
<i @class([
|
||||
"fa-solid fa-user-tie me-1 fa-fw",
|
||||
'fa-lg' => request()->routeIs('bo.professions.*')
|
||||
])></i>
|
||||
{{ str(__('models.classes.profession'))->ucFirst()->plural() }}
|
||||
</a>
|
||||
</li>
|
||||
{{-- BRAND ADVANTAGES --}}
|
||||
<li class="py-1">
|
||||
<a @class([
|
||||
"dropdown-item",
|
||||
'fw-bold text-bg-secondary' => request()->routeIs('bo.brand_advantages.*')
|
||||
]) data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.brand_advantages.index') }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => trans_choice('models.classes.brand_advantage', \INF)]) }}">
|
||||
<i @class([
|
||||
"fa-solid fa-thumbs-up me-1 fa-fw",
|
||||
'fa-lg' => request()->routeIs('bo.brand_advantages.*')
|
||||
])></i>
|
||||
{{ str(trans_choice('models.classes.brand_advantage', \INF))->ucFirst() }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{{-- RECIPES PAGE --}}
|
||||
<div class="dropdown">
|
||||
<button data-bs-toggle="dropdown" type="button" aria-expanded="false" @class([
|
||||
'btn btn-primary text-start w-100 dropdown-toggle mt-1',
|
||||
'fw-bold active' =>
|
||||
request()->routeIs('bo.recipes.*') ||
|
||||
url()->current() === route('bo.general_settings.edit', $recipeSettingModel->type->value()) ||
|
||||
url()->current() === route('bo.general_settings.edit', $recipesSettingModel->type->value()) ||
|
||||
request()->routeIs('bo.consumption_moments.*'),
|
||||
])>
|
||||
<i @class([
|
||||
"fa-solid fa-receipt fa-fw",
|
||||
'fa-lg' =>
|
||||
request()->routeIs('bo.recipes.*') ||
|
||||
request()->routeIs('bo.consumption_moments.*'),
|
||||
])></i>
|
||||
{{ __('Section Recettes') }}
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
{{-- RECIPES PAGE --}}
|
||||
<li class="py-1">
|
||||
<a @class([
|
||||
"dropdown-item",
|
||||
'fw-bold text-bg-secondary' => url()->current() === route('bo.general_settings.edit', $recipeSettingModel->type->value())
|
||||
]) data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.general_settings.edit', $recipeSettingModel) }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => $recipeSettingModel->type->label()]) }}">
|
||||
<i @class([
|
||||
"fa-solid fa-file fa-fw",
|
||||
'fa-lg' => url()->current() === route('bo.general_settings.edit', $recipeSettingModel->type->value())
|
||||
])></i> {{ $recipeSettingModel->type->label() }}
|
||||
</a>
|
||||
</li>
|
||||
{{-- RECIPES PAGE --}}
|
||||
<li class="py-1">
|
||||
<a @class([
|
||||
"dropdown-item",
|
||||
'fw-bold text-bg-secondary' => url()->current() === route('bo.general_settings.edit', $recipesSettingModel->type->value())
|
||||
]) data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.general_settings.edit', $recipesSettingModel) }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => $recipesSettingModel->type->label()]) }}">
|
||||
<i @class([
|
||||
"fa-solid fa-file fa-fw",
|
||||
'fa-lg' => url()->current() === route('bo.general_settings.edit', $recipesSettingModel->type->value())
|
||||
])></i> {{ $recipesSettingModel->type->label() }}
|
||||
</a>
|
||||
</li>
|
||||
{{-- RECIPES --}}
|
||||
<li class="py-1">
|
||||
<a @class([
|
||||
"dropdown-item",
|
||||
'fw-bold text-bg-secondary' => request()->routeIs('bo.recipes.*')
|
||||
]) data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.recipes.index') }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => __('models.classes.recipe')]) }}">
|
||||
<i @class([
|
||||
"fa-solid fa-utensils fa-fw",
|
||||
'fa-lg' => request()->routeIs('bo.recipes.*')
|
||||
])></i>
|
||||
{{ str(__('models.classes.recipe'))->ucFirst()->plural() }}
|
||||
</a>
|
||||
</li>
|
||||
{{-- CONSUMPTION MOMENTS --}}
|
||||
<li class="py-1">
|
||||
<a @class([
|
||||
"dropdown-item",
|
||||
'fw-bold text-bg-secondary' => request()->routeIs('bo.consumption_moments.*')
|
||||
]) data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.consumption_moments.index') }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => trans_choice('models.classes.consumption_moment', 2)]) }}">
|
||||
<i @class([
|
||||
"fa-solid fa-clock fa-fw",
|
||||
'fa-lg' => request()->routeIs('bo.consumption_moments.*')
|
||||
])></i>
|
||||
{{ str(trans_choice('models.classes.consumption_moment', 2))->ucFirst() }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{{-- PRODUCTS PAGE --}}
|
||||
<div class="dropdown">
|
||||
<button data-bs-toggle="dropdown" type="button" aria-expanded="false" @class([
|
||||
'btn btn-primary text-start w-100 dropdown-toggle mt-1',
|
||||
'fw-bold active' =>
|
||||
request()->routeIs('bo.products.*') ||
|
||||
request()->routeIs('bo.meats.*') ||
|
||||
request()->routeIs('bo.ranges.*') ||
|
||||
request()->routeIs('bo.subranges.*') ||
|
||||
request()->routeIs('bo.submeats.*'),
|
||||
])>
|
||||
<i @class([
|
||||
"fa-solid fa-table-list fa-fw",
|
||||
'fa-lg' =>
|
||||
request()->routeIs('bo.products.*') ||
|
||||
request()->routeIs('bo.meats.*') ||
|
||||
request()->routeIs('bo.ranges.*') ||
|
||||
request()->routeIs('bo.subranges.*') ||
|
||||
request()->routeIs('bo.submeats.*'),
|
||||
])></i>
|
||||
{{ __('Section Produits') }}
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
{{-- PRODUCTS --}}
|
||||
{{-- FIXME: décommenter une fois CRUD product fait --}}
|
||||
{{-- <li class="py-1">
|
||||
<a @class([
|
||||
"dropdown-item",
|
||||
'fw-bold text-bg-secondary' => request()->routeIs('bo.products.*')
|
||||
]) data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.products.index') }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => __('models.classes.product')]) }}">
|
||||
<i @class([
|
||||
"fa-solid fa-utensils fa-fw",
|
||||
'fa-lg' => request()->routeIs('bo.products.*')
|
||||
])></i>
|
||||
{{ str(__('models.classes.product'))->ucFirst()->plural() }}
|
||||
</a>
|
||||
</li>
|
||||
<li class="py-1"><hr class="dropdown-divider"></li> --}}
|
||||
{{-- MEATS --}}
|
||||
<li class="py-1">
|
||||
<a @class([
|
||||
"dropdown-item",
|
||||
'fw-bold text-bg-secondary ' => request()->routeIs('bo.meats.index')
|
||||
]) data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.meats.index') }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => __('models.classes.meat')]) }}">
|
||||
<i @class([
|
||||
"fa-solid fa-kiwi-bird fa-fw",
|
||||
'fa-lg' => request()->routeIs('bo.meats.*')
|
||||
])></i>
|
||||
{{ str(__('models.classes.meat'))->ucFirst() }}
|
||||
</a>
|
||||
</li>
|
||||
{{-- SUBMEATS --}}
|
||||
<li class="py-1">
|
||||
<a @class([
|
||||
"dropdown-item",
|
||||
'fw-bold text-bg-secondary' => request()->routeIs('bo.submeats.*')
|
||||
]) data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.submeats.index') }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => __('models.classes.submeat')]) }}">
|
||||
<i @class([
|
||||
"fa-solid fa-drumstick-bite fa-fw",
|
||||
'fa-lg' => request()->routeIs('bo.submeats.*')
|
||||
])></i>
|
||||
{{ str(__('models.classes.submeat'))->ucFirst() }}
|
||||
</a>
|
||||
</li>
|
||||
{{-- ORDER MEATS/SUBMEATS --}}
|
||||
@if ($firstMeat && $firstMeat->submeats->count() >= 2)
|
||||
<li class="py-1">
|
||||
<a @class([
|
||||
"dropdown-item",
|
||||
'fw-bold text-bg-secondary' => request()->routeIs('bo.meats.edit-submeats-order')
|
||||
]) data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.meats.edit-submeats-order', $firstMeat) }}"
|
||||
title="{{ str(__('crud.actions.order_submodels'))->ucFirst() }}">
|
||||
<i @class([
|
||||
"fa-solid fa-arrow-up-wide-short fa-fw",
|
||||
'fa-lg' => request()->routeIs('bo.meats.edit-submeats-order')
|
||||
])></i>
|
||||
{{ __('Ordonnancement') }}
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
<li class="py-1"><hr class="dropdown-divider"></li>
|
||||
{{-- RANGES --}}
|
||||
<li class="py-1">
|
||||
<a @class([
|
||||
"dropdown-item",
|
||||
'fw-bold text-bg-secondary' => request()->routeIs('bo.ranges.index')
|
||||
]) data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.ranges.index') }}"
|
||||
title="{{ str(__('crud.actions.order_submodels'))->ucFirst() }}">
|
||||
<i @class([
|
||||
"fa-solid fa-tags fa-fw",
|
||||
'fa-lg' => request()->routeIs('bo.ranges.index')
|
||||
])></i>
|
||||
{{ str(__('models.classes.range'))->ucFirst() }}
|
||||
</a>
|
||||
</li>
|
||||
{{-- SUBRANGES --}}
|
||||
<li class="py-1">
|
||||
<a @class([
|
||||
"dropdown-item",
|
||||
'fw-bold text-bg-secondary' => request()->routeIs('bo.subranges.*')
|
||||
]) data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.subranges.index') }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => __('models.classes.subrange')]) }}">
|
||||
<i @class([
|
||||
"fa-solid fa-tag fa-fw",
|
||||
'fa-lg' => request()->routeIs('bo.subranges.*')
|
||||
])></i>
|
||||
{{ str(__('models.classes.subrange'))->ucFirst() }}
|
||||
</a>
|
||||
</li>
|
||||
{{-- ORDER RANGES/SUBRANGES --}}
|
||||
@if ($firstRange && $firstRange->subranges->count() >= 2)
|
||||
<li class="py-1">
|
||||
<a @class([
|
||||
"dropdown-item",
|
||||
'fw-bold text-bg-secondary' => request()->routeIs('bo.ranges.edit-subranges-order')
|
||||
]) data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.ranges.edit-subranges-order', $firstRange) }}"
|
||||
title="{{ __('crud.helpers.update_model', ['model' => __('models.classes.subrange')]) }}">
|
||||
<i @class([
|
||||
"fa-solid fa-arrow-up-wide-short fa-fw",
|
||||
'fa-lg' => request()->routeIs('bo.ranges.edit-subranges-order')
|
||||
])></i>
|
||||
{{ __('Ordonnancement') }}
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
</div>
|
||||
{{-- APPROACHES --}}
|
||||
<div class="dropdown">
|
||||
<button data-bs-toggle="dropdown" type="button" aria-expanded="false" @class([
|
||||
'btn btn-primary text-start w-100 dropdown-toggle mt-1',
|
||||
'fw-bold active' =>
|
||||
request()->routeIs('bo.approaches.*') ||
|
||||
request()->routeIs('bo.approaches.*'),
|
||||
])>
|
||||
<i class="fa-solid fa-building-wheat"></i>
|
||||
{{ str(trans_choice('models.classes.approach', 2))->ucFirst() }}
|
||||
<i @class([
|
||||
"fa-solid fa-building-wheat fa-fw",
|
||||
'fa-lg' => request()->routeIs('bo.approaches.*')
|
||||
])></i>
|
||||
{{ sprintf('Section %s', str(trans_choice('models.classes.approach', 2))->ucFirst()) }}
|
||||
</button>
|
||||
@php $approachType = intval(request()->route()->parameter('approach_type') ?: ((isset($approachModel)) ? $approachModel->type->value() : 0)); @endphp
|
||||
<ul class="dropdown-menu">
|
||||
<li>
|
||||
<a class="dropdown-item"
|
||||
{{-- LABEL --}}
|
||||
<li class="py-1">
|
||||
<a @class([
|
||||
"dropdown-item",
|
||||
'fw-bold text-bg-secondary' => request()->routeIs('bo.approaches.*') && $approachType === \App\Enums\Approaches\ApproachTypeEnum::label->value()
|
||||
])
|
||||
href="{{ route('bo.approaches.index', [
|
||||
'approach_type' => ApproachTypeEnum::label,
|
||||
'approach_type' => \App\Enums\Approaches\ApproachTypeEnum::label->value()
|
||||
]) }}">
|
||||
<i @class([
|
||||
"fa-solid fa-award fa-fw",
|
||||
'fa-lg' => request()->routeIs('bo.approaches.*') && $approachType === \App\Enums\Approaches\ApproachTypeEnum::label->value()
|
||||
])></i>
|
||||
{{ str(__('labels'))->ucFirst() }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="dropdown-item"
|
||||
{{-- DEMARCHE --}}
|
||||
<li class="py-1">
|
||||
<a @class([
|
||||
"dropdown-item",
|
||||
'fw-bold text-bg-secondary' => request()->routeIs('bo.approaches.*') && $approachType === \App\Enums\Approaches\ApproachTypeEnum::demarche->value()
|
||||
])
|
||||
href="{{ route('bo.approaches.index', [
|
||||
'approach_type' => ApproachTypeEnum::demarche,
|
||||
'approach_type' => \App\Enums\Approaches\ApproachTypeEnum::demarche->value(),
|
||||
]) }}">
|
||||
{{ str(__('démarches'))->ucFirst() }}</a>
|
||||
<i @class([
|
||||
"fa-solid fa-people-arrows fa-fw",
|
||||
'fa-lg' => request()->routeIs('bo.approaches.*') && $approachType === \App\Enums\Approaches\ApproachTypeEnum::demarche->value()
|
||||
])></i>
|
||||
{{ str(__('démarches'))->ucFirst() }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{{-- RANGES/SUBRANGES) --}}
|
||||
<div class="dropdown">
|
||||
<button data-bs-toggle="dropdown" type="button" aria-expanded="false" @class([
|
||||
'btn btn-primary text-start w-100 dropdown-toggle mt-1',
|
||||
'fw-bold active' =>
|
||||
request()->routeIs('bo.ranges.*') ||
|
||||
request()->routeIs('bo.subranges.*'),
|
||||
])>
|
||||
<i class="fa-solid fa-tag"></i>
|
||||
{{ str(
|
||||
__(':model1/:model2', [
|
||||
'model1' => str(__('models.classes.range'))->plural(),
|
||||
'model2' => str(__('models.classes.subrange'))->plural(),
|
||||
]),
|
||||
)->ucFirst() }}
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li>
|
||||
<a class="dropdown-item"
|
||||
href="{{ route('bo.ranges.index') }}">{{ str(__('models.classes.range'))->ucfirst()->plural() }}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="dropdown-item"
|
||||
href="{{ route('bo.subranges.index') }}">{{ str(__('models.classes.subrange'))->ucfirst()->plural() }}</a>
|
||||
</li>
|
||||
@if ($firstRange && $firstRange->subranges->count() >= 2)
|
||||
<li>
|
||||
<a class="dropdown-item" href="{{ route('bo.ranges.edit-subranges-order', $firstRange) }}">
|
||||
{{ __('crud.helpers.order_submodels', ['model' => str(__('models.classes.subrange'))->plural()]) }}
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
</div>
|
||||
{{-- MEATS/(SUB)MEATS --}}
|
||||
<div class="dropdown">
|
||||
<button data-bs-toggle="dropdown" type="button" aria-expanded="false" @class([
|
||||
'btn btn-primary text-start w-100 dropdown-toggle mt-1',
|
||||
'fw-bold active' =>
|
||||
request()->routeIs('bo.meats.*') || request()->routeIs('bo.submeats.*'),
|
||||
])>
|
||||
<i class="fa-solid fa-drumstick-bite"></i>
|
||||
{{ str(
|
||||
__(':model1/:model2', [
|
||||
'model1' => str(__('models.classes.meat'))->plural(),
|
||||
'model2' => str(__('models.classes.submeat'))->plural(),
|
||||
]),
|
||||
)->ucFirst() }}
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li>
|
||||
<a class="dropdown-item"
|
||||
href="{{ route('bo.meats.index') }}">{{ str(__('models.classes.meat'))->ucfirst()->plural() }}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="dropdown-item"
|
||||
href="{{ route('bo.submeats.index') }}">{{ str(__('models.classes.submeat'))->ucfirst()->plural() }}</a>
|
||||
</li>
|
||||
@if ($firstMeat && $firstMeat->submeats->count() >= 2)
|
||||
<li>
|
||||
<a class="dropdown-item" href="{{ route('bo.meats.edit-submeats-order', $firstMeat) }}">
|
||||
{{ __('crud.helpers.order_submodels', ['model' => str(__('models.classes.submeat'))->plural()]) }}
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
</div>
|
||||
{{-- CONSUMPTION MOMENTS --}}
|
||||
<a data-bs-toggle="tooltip" href="{{ route('bo.consumption_moments.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.consumption_moment')]) }}"
|
||||
role="button" @class([
|
||||
'btn btn-primary w-100 text-start mt-1',
|
||||
'fw-bold active' => request()->routeIs('bo.consumption_moments.*'),
|
||||
])>
|
||||
<i class="fa-solid fa-clock"></i>
|
||||
{{ str(__('models.classes.consumption_moment'))->ucFirst() }}
|
||||
</a>
|
||||
{{-- VIDEOS --}}
|
||||
<a data-bs-toggle="tooltip" href="{{ route('bo.videos.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.video')]) }}" role="button"
|
||||
@class([
|
||||
'btn btn-primary w-100 text-start mt-1',
|
||||
'fw-bold active' => request()->routeIs('bo.videos.*'),
|
||||
])>
|
||||
<i class="fa-solid fa-film me-1"></i> {{ str(__('models.classes.video'))->ucFirst() }}
|
||||
</a>
|
||||
{{-- RECIPES --}}
|
||||
<a data-bs-toggle="tooltip" href="{{ route('bo.recipes.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.recipe')]) }}" role="button"
|
||||
@class([
|
||||
'btn btn-primary w-100 text-start mt-1',
|
||||
'fw-bold active' => request()->routeIs('bo.recipes.*'),
|
||||
])>
|
||||
<i class="fa-solid fa-table-list"></i>
|
||||
{{ str(__('models.classes.recipe'))->ucFirst()->plural() }}
|
||||
</a>
|
||||
</div>
|
||||
</nav>
|
||||
@endauth
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap pb-3">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0" data-bs-toggle="tooltip" href="{{ route('bo.activity_logs.index') }}"
|
||||
<a class="btn btn-primary text-decoration-none m-0 me-2" data-bs-toggle="tooltip" href="{{ route('bo.activity_logs.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => trans_choice('models.classes.activity_log', \INF)]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -1,36 +1,35 @@
|
|||
@extends('bo.layout', ['brParam' => intval(request()->approach_type)])
|
||||
@extends('bo.layout', ['brParam' => intval($approachModel->type ? $approachModel->type->value() : request()->approach_type)])
|
||||
|
||||
@section('title', __('Création d\'un :model', ['model' => __(intval(request()->approach_type) ? 'validation.custom.demarche' :
|
||||
'validation.custom.label')]))
|
||||
@section('description', __('Création d\'un tout nouveau :model', ['model' => intval(request()->approach_type) ?
|
||||
__('validation.custom.demarche') : __('validation.custom.label')]))
|
||||
<?php $condition = \App\Enums\Approaches\ApproachTypeEnum::demarche->value() === intval(request()->approach_type ?: $approachModel->type->value()); ?>
|
||||
|
||||
@section('title', __('Création d\'un :model', ['model' => $condition ? __('validation.custom.demarche') : __('validation.custom.label')]))
|
||||
@section('description', __('Création d\'un tout nouveau :model', ['model' => $condition ? __('validation.custom.demarche') : __('validation.custom.label')]))
|
||||
@section('breadcrumb', request()->route()->getName())
|
||||
|
||||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap pb-3">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.approaches.index', intval(request()->approach_type)) }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => str(__(intval(request()->approach_type) ? 'validation.custom.demarche' : 'validation.custom.label'))->plural()]) }}">
|
||||
<a class="btn btn-primary text-decoration-none m-0 me-2" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.approaches.index', intval($approachModel->type ? $approachModel->type->value() : request()->approach_type)) }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => $condition ? str(__('validation.custom.demarche'))->plural() : str(__('validation.custom.label'))->plural()]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
@include('modules.breadcrumbs.breadcrumb-body', ['brParam' => intval(request()->approach_type)])
|
||||
@include('modules.breadcrumbs.breadcrumb-body', ['brParam' => intval($approachModel->type ? $approachModel->type->value() : request()->approach_type)])
|
||||
</div>
|
||||
<div class="mb-md-0 mb-2">
|
||||
<button class="btn btn-primary" id="formSubmitClone" data-bs-toggle="tooltip" type="submit"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => __(intval(request()->approach_type) ? 'validation.custom.demarche' : 'validation.custom.label')]) }}">
|
||||
title="{{ __('crud.helpers.save_model', ['model' => $condition ? __('validation.custom.demarche') : __('validation.custom.label')]) }}">
|
||||
{{ str(__('crud.actions.save'))->ucfirst() }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<form action="{{ route('bo.approaches.store', intval(request()->approach_type)) }}" method="POST" enctype="multipart/form-data">
|
||||
<form action="{{ route('bo.approaches.store', intval($approachModel->type ? $approachModel->type->value() : request()->approach_type)) }}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@include('bo.pages.approaches.form')
|
||||
@include('bo.partials.script-button-clone')
|
||||
<div class="row mt-3">
|
||||
<div class="col text-center">
|
||||
<button class="btn btn-primary" id="formSubmit" data-bs-toggle="tooltip" type="submit"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => __(intval(request()->approach_type) ? 'validation.custom.demarche' : 'validation.custom.label')]) }}">
|
||||
title="{{ __('crud.helpers.save_model', ['model' => $condition ? __('validation.custom.demarche') : __('validation.custom.label')]) }}">
|
||||
{{ str(__('crud.actions.save'))->ucfirst() }}
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,16 +1,18 @@
|
|||
@extends('bo.layout', ['brParam' => $approachModel])
|
||||
|
||||
@section('title', __('Édition d\'un :model', ['model' => __($approachModel->type ? 'validation.custom.demarche' : 'validation.custom.label')]))
|
||||
@section('description', __('Édition d\'un :model déjà existant', ['model' => __($approachModel->type ? 'validation.custom.demarche' :
|
||||
<?php $condition = \App\Enums\Approaches\ApproachTypeEnum::demarche->value() === $approachModel->type->value(); ?>
|
||||
|
||||
@section('title', __('Édition d\'un :model', ['model' => __($approachModel->type->value() ? 'validation.custom.demarche' : 'validation.custom.label')]))
|
||||
@section('description', __('Édition d\'un :model déjà existant', ['model' => __($approachModel->type->value() ? 'validation.custom.demarche' :
|
||||
'validation.custom.label')]))
|
||||
@section('breadcrumb', request()->route()->getName())
|
||||
|
||||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap pb-3">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.approaches.index', $approachModel->type) }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => str(__($approachModel->type ? 'validation.custom.demarche' : 'validation.custom.label'))->plural()]) }}">
|
||||
<a class="btn btn-primary text-decoration-none m-0 me-2" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.approaches.index', $approachModel->type->value()) }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => $condition ? str(__('validation.custom.demarche'))->plural() : str(__('validation.custom.label'))->plural()]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
@include('modules.breadcrumbs.breadcrumb-body', ['brParam' => $approachModel])
|
||||
|
|
@ -31,7 +33,7 @@
|
|||
</a>
|
||||
@endcan
|
||||
<button class="btn btn-primary" id="formSubmitClone" data-bs-toggle="tooltip" type="submit"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => __($approachModel->type ? 'validation.custom.demarche' : 'validation.custom.label')]) }}">
|
||||
title="{{ __('crud.helpers.save_model', ['model' => $condition ? __('validation.custom.demarche') : __('validation.custom.label')]) }}">
|
||||
{{ str(__('crud.actions.save'))->ucfirst() }}
|
||||
</button>
|
||||
@can('delete', $approachModel)
|
||||
|
|
@ -52,7 +54,7 @@
|
|||
<div class="row">
|
||||
<div class="col text-center">
|
||||
<button class="btn btn-primary" id="formSubmit" data-bs-toggle="tooltip" type="submit"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => trans_choice('models.classes.approach', 1)]) }}">
|
||||
title="{{ __('crud.helpers.save_model', ['model' => $condition ? __('validation.custom.demarche') : __('validation.custom.label')]) }}">
|
||||
{{ str(__('crud.actions.save'))->ucfirst() }}
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
@php
|
||||
$inter = $condition ? __('validation.custom.of_the.female') : __('validation.custom.of_the.male');
|
||||
$model = $condition ? __('validation.custom.demarche') : __('validation.custom.label');
|
||||
@endphp
|
||||
<div class="row">
|
||||
{{-- NAME --}}
|
||||
<div class="col-12 col-lg-6 mb-3">
|
||||
|
|
@ -10,8 +14,8 @@
|
|||
'label' => str(
|
||||
__(':field :inter:model', [
|
||||
'field' => __('validation.attributes.name'),
|
||||
'inter' => __(($approachModel->type || intval(request()->approach_type)) ? 'validation.custom.of_the.female' : 'validation.custom.of_the.male'),
|
||||
'model' => __(($approachModel->type || intval(request()->approach_type)) ? 'validation.custom.demarche' : 'validation.custom.label'),
|
||||
'inter' => $inter,
|
||||
'model' => $model,
|
||||
]))->ucfirst(),
|
||||
'hasWordCounter' => true,
|
||||
'name' => 'name',
|
||||
|
|
@ -20,8 +24,8 @@
|
|||
'helper' => __('validation.between.string', [
|
||||
'attribute' => __(':field :inter:model', [
|
||||
'field' => __('validation.attributes.name'),
|
||||
'inter' => __(($approachModel->type || intval(request()->approach_type)) ? 'validation.custom.of_the.female' : 'validation.custom.of_the.male'),
|
||||
'model' => __(($approachModel->type || intval(request()->approach_type)) ? 'validation.custom.demarche' : 'validation.custom.label'),
|
||||
'inter' => $inter,
|
||||
'model' => $model,
|
||||
]),
|
||||
'min' => 3,
|
||||
'max' => 255,
|
||||
|
|
@ -45,8 +49,8 @@
|
|||
'field1' => str(__('validation.custom.attribute_alt'))->ucfirst(),
|
||||
'inter1' => __('validation.custom.of_the.male'),
|
||||
'field2' => __('validation.attributes.image'),
|
||||
'inter2' => __(($approachModel->type || intval(request()->approach_type)) ? 'validation.custom.of_the.female' : 'validation.custom.of_the.male'),
|
||||
'model' => __(($approachModel->type || intval(request()->approach_type)) ? 'validation.custom.demarche' : 'validation.custom.label'),
|
||||
'inter2' => $inter,
|
||||
'model' => $model,
|
||||
]),
|
||||
'hasWordCounter' => true,
|
||||
'name' => 'picture_alt',
|
||||
|
|
@ -57,8 +61,8 @@
|
|||
'field1' => str(__('validation.custom.attribute_alt'))->ucfirst(),
|
||||
'inter1' => __('validation.custom.of_the.male'),
|
||||
'field2' => __('validation.attributes.image'),
|
||||
'inter2' => __(($approachModel->type || intval(request()->approach_type)) ? 'validation.custom.of_the.female' : 'validation.custom.of_the.male'),
|
||||
'model' => __(($approachModel->type || intval(request()->approach_type)) ? 'validation.custom.demarche' : 'validation.custom.label'),
|
||||
'inter2' => $inter,
|
||||
'model' => $model,
|
||||
]),
|
||||
])
|
||||
</div>
|
||||
|
|
@ -70,8 +74,8 @@
|
|||
'field1' => str(__('validation.custom.attribute_title'))->ucfirst(),
|
||||
'inter1' => __('validation.custom.of_the.male'),
|
||||
'field2' => __('validation.attributes.image'),
|
||||
'inter2' => __(($approachModel->type || intval(request()->approach_type)) ? 'validation.custom.of_the.female' : 'validation.custom.of_the.male'),
|
||||
'model' => __(($approachModel->type || intval(request()->approach_type)) ? 'validation.custom.demarche' : 'validation.custom.label'),
|
||||
'inter2' => $inter,
|
||||
'model' => $model,
|
||||
]),
|
||||
'hasWordCounter' => true,
|
||||
'name' => 'picture_title',
|
||||
|
|
@ -82,8 +86,8 @@
|
|||
'field1' => str(__('validation.custom.attribute_title'))->ucfirst(),
|
||||
'inter1' => __('validation.custom.of_the.male'),
|
||||
'field2' => __('validation.attributes.image'),
|
||||
'inter2' => __(($approachModel->type || intval(request()->approach_type)) ? 'validation.custom.of_the.female' : 'validation.custom.of_the.male'),
|
||||
'model' => __(($approachModel->type || intval(request()->approach_type)) ? 'validation.custom.demarche' : 'validation.custom.label'),
|
||||
'inter2' => $inter,
|
||||
'model' => $model,
|
||||
]),
|
||||
])
|
||||
</div>
|
||||
|
|
@ -113,8 +117,8 @@
|
|||
'name' => 'published',
|
||||
'label' => __(':field :inter:model', [
|
||||
'field' => str(__('validation.custom.publication'))->ucFirst(),
|
||||
'inter' => __(($approachModel->type || intval(request()->approach_type)) ? 'validation.custom.of_the.female' : 'validation.custom.of_the.male'),
|
||||
'model' => __(($approachModel->type || intval(request()->approach_type)) ? 'validation.custom.demarche' : 'validation.custom.label'),
|
||||
'inter' => $inter,
|
||||
'model' => $model,
|
||||
]),
|
||||
'helper' => __('Deux réponses possibles : oui ou non.'),
|
||||
'model' => $approachModel ?? null,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
@extends('bo.layout', ['brParam' => request()->approach_type])
|
||||
|
||||
@section('title',
|
||||
str(intval(request()->approach_type) ? __('validation.custom.demarche') : __('validation.custom.label'))->plural()->ucfirst())
|
||||
str(intval(request()->approach_type) ? __('validation.custom.demarche') :
|
||||
__('validation.custom.label'))->plural()->ucfirst())
|
||||
@section('description', __('Liste de tous les :model', ['model' => trans_choice('models.classes.approach', \INF)]))
|
||||
@section('breadcrumb', request()->route()->getName())
|
||||
|
||||
|
|
@ -13,7 +14,7 @@
|
|||
@can('create', \App\Models\Approach::class)
|
||||
<a class="btn btn-primary float-right" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.approaches.create', intval(request()->approach_type)) }}"
|
||||
title="{{ __('crud.helpers.create_model', ['model' => intval(request()->approach_type) ? __('validation.custom.demarche') : __('validation.custom.label')]) }}">
|
||||
title="{{ __('crud.helpers.create_model', ['model' => \App\Enums\Approaches\ApproachTypeEnum::demarche->value() === intval(request()->approach_type) ? __('validation.custom.demarche') : __('validation.custom.label')]) }}">
|
||||
<i class="fa-solid fa-plus"></i>
|
||||
</a>
|
||||
@endcan
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@
|
|||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap pb-3">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.approaches.index', $approachModel->type) }}"
|
||||
<a class="btn btn-primary text-decoration-none m-0 me-2" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.approaches.index', $approachModel->type->value()) }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => trans_choice('models.classes.approach', \INF)]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap pb-3">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0" data-bs-toggle="tooltip" href="{{ route('bo.brand_advantages.index') }}"
|
||||
<a class="btn btn-primary text-decoration-none m-0 me-2" data-bs-toggle="tooltip" href="{{ route('bo.brand_advantages.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => trans_choice('models.classes.brand_advantage', 1)]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap pb-3">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0" data-bs-toggle="tooltip" href="{{ route('bo.brand_advantages.index') }}"
|
||||
<a class="btn btn-primary text-decoration-none m-0 me-2" data-bs-toggle="tooltip" href="{{ route('bo.brand_advantages.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => trans_choice('models.classes.brand_advantage', \INF)]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap pb-3">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0" data-bs-toggle="tooltip" href="{{ route('bo.brand_advantages.index') }}"
|
||||
<a class="btn btn-primary text-decoration-none m-0 me-2" data-bs-toggle="tooltip" href="{{ route('bo.brand_advantages.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => trans_choice('models.classes.brand_advantage', \INF)]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -1,21 +1,21 @@
|
|||
@extends('bo.layout', ['brParam' => $consumptionMomentModel])
|
||||
|
||||
@section('title', __('Création d\'une :model', ['model' => __('models.classes.consumption_moment')]))
|
||||
@section('description', __('Création d\'une tout nouveau :model', ['model' => __('models.classes.consumption_moment')]))
|
||||
@section('title', __('Création d\'une :model', ['model' => trans_choice('models.classes.consumption_moment', 1)]))
|
||||
@section('description', __('Création d\'une tout nouveau :model', ['model' => trans_choice('models.classes.consumption_moment', 1)]))
|
||||
@section('breadcrumb', request()->route()->getName())
|
||||
|
||||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap pb-3">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0" data-bs-toggle="tooltip" href="{{ route('bo.consumption_moments.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.consumption_moment')]) }}">
|
||||
<a class="btn btn-primary text-decoration-none m-0 me-2" data-bs-toggle="tooltip" href="{{ route('bo.consumption_moments.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => trans_choice('models.classes.consumption_moment', 2)]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
@include('modules.breadcrumbs.breadcrumb-body', ['brParam' => $consumptionMomentModel])
|
||||
</div>
|
||||
<div class="mb-md-0 mb-2">
|
||||
<button class="btn btn-primary" id="formSubmitClone" data-bs-toggle="tooltip" type="submit"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => __('models.classes.consumption_moment')]) }}">
|
||||
title="{{ __('crud.helpers.save_model', ['model' => trans_choice('models.classes.consumption_moment', 1)]) }}">
|
||||
{{ str(__('crud.actions.save'))->ucfirst() }}
|
||||
</button>
|
||||
</div>
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
<div class="row mt-3">
|
||||
<div class="col text-center">
|
||||
<button class="btn btn-primary" id="formSubmit" data-bs-toggle="tooltip" type="submit"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => __('models.classes.consumption_moment')]) }}">
|
||||
title="{{ __('crud.helpers.save_model', ['model' => trans_choice('models.classes.consumption_moment', 1)]) }}">
|
||||
{{ str(__('crud.actions.save'))->ucfirst() }}
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
@extends('bo.layout', ['brParam' => $consumptionMomentModel])
|
||||
|
||||
@section('title', __('Édition d\'une :model', ['model' => __('models.classes.consumption_moment')]))
|
||||
@section('description', __('Édition d\'une :model déjà existant', ['model' => __('models.classes.consumption_moment')]))
|
||||
@section('title', __('Édition d\'une :model', ['model' => trans_choice('models.classes.consumption_moment', 1)]))
|
||||
@section('description', __('Édition d\'une :model déjà existant', ['model' => trans_choice('models.classes.consumption_moment', 1)]))
|
||||
@section('breadcrumb', request()->route()->getName())
|
||||
|
||||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap pb-3">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0" data-bs-toggle="tooltip" href="{{ route('bo.consumption_moments.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => str(__('models.classes.consumption_moment'))->plural()]) }}">
|
||||
<a class="btn btn-primary text-decoration-none m-0 me-2" data-bs-toggle="tooltip" href="{{ route('bo.consumption_moments.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => trans_choice('models.classes.consumption_moment', 2)]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
@include('modules.breadcrumbs.breadcrumb-body', ['brParam' => $consumptionMomentModel])
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
</a>
|
||||
@endcan
|
||||
<button class="btn btn-primary" id="formSubmitClone" data-bs-toggle="tooltip" type="submit"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => __('models.classes.consumption_moment')]) }}">
|
||||
title="{{ __('crud.helpers.save_model', ['model' => trans_choice('models.classes.consumption_moment', 1)]) }}">
|
||||
{{ str(__('crud.actions.save'))->ucfirst() }}
|
||||
</button>
|
||||
@can('delete', $consumptionMomentModel)
|
||||
|
|
@ -49,7 +49,7 @@
|
|||
<div class="row">
|
||||
<div class="col text-center">
|
||||
<button class="btn btn-primary" id="formSubmit" data-bs-toggle="tooltip" type="submit"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => __('models.classes.consumption_moment')]) }}">
|
||||
title="{{ __('crud.helpers.save_model', ['model' => trans_choice('models.classes.consumption_moment', 1)]) }}">
|
||||
{{ str(__('crud.actions.save'))->ucfirst() }}
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
'label' => __(':field1 :inter2:model', [
|
||||
'field1' => str(__('validation.custom.attribute_title'))->ucFirst(),
|
||||
'inter2' => __('validation.custom.of_the.male'),
|
||||
'model' => __('models.classes.consumption_moment'),
|
||||
'model' => trans_choice('models.classes.consumption_moment', 1),
|
||||
]),
|
||||
'hasWordCounter' => true,
|
||||
'name' => 'title',
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
'placeholder' => __(':field1 :inter2:model', [
|
||||
'field1' => str(__('validation.custom.attribute_title'))->ucFirst(),
|
||||
'inter2' => __('validation.custom.of_the.male'),
|
||||
'model' => __('models.classes.consumption_moment'),
|
||||
'model' => trans_choice('models.classes.consumption_moment', 1),
|
||||
]),
|
||||
])
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
@else
|
||||
<tr>
|
||||
<td class="border-0">
|
||||
{{ trans_choice('crud.other.no_model_found', 1, ['model' => __('models.classes.consumption_moment')]) }}
|
||||
{{ trans_choice('crud.other.no_model_found', 1, ['model' => trans_choice('models.classes.consumption_moment', 1)]) }}
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
@extends('bo.layout')
|
||||
|
||||
@section('title', str(__('models.classes.consumption_moment'))->ucfirst()->plural())
|
||||
@section('description', __('Liste de tous les :model', ['model' => str(__('models.classes.consumption_moment'))->plural()]))
|
||||
@section('title', str(trans_choice('models.classes.consumption_moment', 2))->ucfirst())
|
||||
@section('description', __('Liste de tous les :model', ['model' => trans_choice('models.classes.consumption_moment', 2)]))
|
||||
|
||||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap">
|
||||
@include('modules.breadcrumbs.breadcrumb-body')
|
||||
@can('create', \App\Models\ConsumptionMoment::class)
|
||||
<a class="btn btn-primary float-right" data-bs-toggle="tooltip" href="{{ route('bo.consumption_moments.create') }}"
|
||||
title="{{ __('crud.helpers.create_model', ['model' => __('models.classes.consumption_moment')]) }}">
|
||||
title="{{ __('crud.helpers.create_model', ['model' => trans_choice('models.classes.consumption_moment', 1)]) }}">
|
||||
<i class="fa-solid fa-plus"></i>
|
||||
</a>
|
||||
@endcan
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
@extends('bo.layout', ['brParam' => $consumptionMomentModel])
|
||||
|
||||
@section('title', __('Aperçu d\'un :model', ['model' => __('models.classes.consumption_moment')]))
|
||||
@section('description', __('Aperçu d\'un :model déjà existante', ['model' => __('models.classes.consumption_moment')]))
|
||||
@section('title', __('Aperçu d\'un :model', ['model' => trans_choice('models.classes.consumption_moment', 1)]))
|
||||
@section('description', __('Aperçu d\'un :model déjà existante', ['model' => trans_choice('models.classes.consumption_moment', 1)]))
|
||||
@section('breadcrumb', request()->route()->getName())
|
||||
|
||||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center border-bottom flex-wrap pb-3">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0" data-bs-toggle="tooltip" data-bs-placement="top"
|
||||
<a class="btn btn-primary text-decoration-none m-0 me-2" data-bs-toggle="tooltip" data-bs-placement="top"
|
||||
href="{{ route('bo.consumption_moments.index', ['sort_col' => 'created_at', 'sort_way' => 'desc']) }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => str(__('models.classes.consumption_moment'))->plural()]) }}">
|
||||
title="{{ __('crud.helpers.list_all', ['model' => trans_choice('models.classes.consumption_moment', 2)]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
@include('modules.breadcrumbs.breadcrumb-body', ['brParam' => $consumptionMomentModel])
|
||||
|
|
@ -20,14 +20,14 @@
|
|||
@can('duplicate', $consumptionMomentModel)
|
||||
<a class="btn btn-secondary" data-bs-toggle="tooltip" data-bs-placement="top"
|
||||
href="{{ route('bo.consumption_moments.duplicate', $consumptionMomentModel) }}"
|
||||
title="{{ __('crud.helpers.duplicate_model', ['model' => __('models.classes.consumption_moment')]) }}">
|
||||
title="{{ __('crud.helpers.duplicate_model', ['model' => trans_choice('models.classes.consumption_moment', 1)]) }}">
|
||||
<i class="fa-solid fa-copy"></i>
|
||||
</a>
|
||||
@endcan
|
||||
@can('update', $consumptionMomentModel)
|
||||
<a class="btn btn-primary" data-bs-toggle="tooltip" data-bs-placement="top"
|
||||
href="{{ route('bo.consumption_moments.edit', $consumptionMomentModel) }}"
|
||||
title="{{ __('crud.helpers.edit_model', ['model' => __('models.classes.consumption_moment')]) }}">
|
||||
title="{{ __('crud.helpers.edit_model', ['model' => trans_choice('models.classes.consumption_moment', 1)]) }}">
|
||||
<i class="fa-solid fa-pencil"></i>
|
||||
</a>
|
||||
@endcan
|
||||
|
|
@ -35,7 +35,7 @@
|
|||
@csrf
|
||||
@method('DELETE')
|
||||
<button class="btn btn-danger" data-bs-toggle="tooltip" data-bs-placement="top" type="submit"
|
||||
title="{{ __('crud.helpers.delete_model', ['model' => __('models.classes.consumption_moment')]) }}">
|
||||
title="{{ __('crud.helpers.delete_model', ['model' => trans_choice('models.classes.consumption_moment', 1)]) }}">
|
||||
<i class="fa-solid fa-trash"></i>
|
||||
</button>
|
||||
@endcan
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap pb-3">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0" data-bs-toggle="tooltip" href="{{ route('bo.demarche_slides.index') }}"
|
||||
<a class="btn btn-primary text-decoration-none m-0 me-2" data-bs-toggle="tooltip" href="{{ route('bo.demarche_slides.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.demarche_slide')]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap pb-3">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0" data-bs-toggle="tooltip" href="{{ route('bo.demarche_slides.index') }}"
|
||||
<a class="btn btn-primary text-decoration-none m-0 me-2" data-bs-toggle="tooltip" href="{{ route('bo.demarche_slides.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => str(__('models.classes.demarche_slide'))->plural()]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center border-bottom flex-wrap pb-3">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0" data-bs-toggle="tooltip" data-bs-placement="top"
|
||||
<a class="btn btn-primary text-decoration-none m-0 me-2" data-bs-toggle="tooltip" data-bs-placement="top"
|
||||
href="{{ route('bo.demarche_slides.index', ['sort_col' => 'created_at', 'sort_way' => 'desc']) }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => str(__('models.classes.demarche_slide'))->plural()]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
|
|
|
|||
|
|
@ -7,10 +7,6 @@
|
|||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap pb-3">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0" data-bs-toggle="tooltip" href="{{ route('bo.general_settings.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => str(__('models.classes.general_setting'))->plural()]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
@include('modules.breadcrumbs.breadcrumb-body', ['brParam' => $generalSettingModel])
|
||||
</div>
|
||||
<div class="mb-md-0 mb-2">
|
||||
|
|
|
|||
|
|
@ -1,11 +1,4 @@
|
|||
<div class="row">
|
||||
{{-- TYPE --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<p class="h5 m-0">
|
||||
{{ sprintf('%s associées à :', str(__("models.classes.general_setting"))->ucfirst()->plural()) }}
|
||||
<span class="fw-bold">{{ $generalSettingModel->type->label() }}</span>
|
||||
</p>
|
||||
</div>
|
||||
{{-- Value --}}
|
||||
<div class="col-12 mb-3">
|
||||
@include('bo.pages.general_settings.values.' . $generalSettingModel->type->name(), [
|
||||
|
|
|
|||
|
|
@ -1,45 +0,0 @@
|
|||
<table class="table-hover table-fix-action m-0 table">
|
||||
@if (count($generalSettingsModelList) > 0)
|
||||
<thead>
|
||||
@include('bo.modules.table-col-sorter', [
|
||||
'cols' => [
|
||||
'type' => str(__('validation.custom.general_setting_type'))->ucfirst(),
|
||||
'updated_at' => str(__('validation.attributes.updated_at'))->ucfirst(),
|
||||
],
|
||||
])
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($generalSettingsModelList as $generalSettingModel)
|
||||
<tr class="border-bottom">
|
||||
<td class="text-center align-middle">{{ $generalSettingModel->type->label() }}</td>
|
||||
<td class="text-center align-middle">
|
||||
<span class="badge text-bg-secondary">{{ $generalSettingModel->updated_at->isoFormat('LLLL') }}</span>
|
||||
</td>
|
||||
<td class="text-end align-middle">
|
||||
@canAny(['update'], $generalSettingModel)
|
||||
<div class="btn-group">
|
||||
@can('update', $generalSettingModel)
|
||||
<a class="btn btn-sm btn-primary" data-bs-toggle="tooltip"
|
||||
href="{{ route('bo.general_settings.edit', $generalSettingModel) }}"
|
||||
title="{{ str(__('crud.actions.update'))->ucfirst() }}">
|
||||
<i class="fa-solid fa-pencil"></i>
|
||||
</a>
|
||||
@endcan
|
||||
</div>
|
||||
@else
|
||||
<span class="text-danger" data-bs-toggle="tooltip" title="{{ __('list.right') }}">
|
||||
<i class="fa-solid fa-ban"></i>
|
||||
</span>
|
||||
@endcan
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
@else
|
||||
<tr>
|
||||
<td class="border-0">
|
||||
{{ trans_choice('crud.other.no_model_found', 2, ['model' => trans_choice('models.classes.general_setting', 1)]) }}
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
@extends('bo.layout')
|
||||
|
||||
@section('title', str(trans_choice('models.classes.general_setting', \INF))->ucfirst())
|
||||
@section('description', __('Liste de toutes les :model', ['model' => trans_choice('models.classes.general_setting', \INF)]))
|
||||
|
||||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap">
|
||||
@include('modules.breadcrumbs.breadcrumb-body')
|
||||
</div>
|
||||
@include('bo.modules.search-bar')
|
||||
<div class="table-responsive mb-3">
|
||||
@include('bo.pages.general_settings.index-list')
|
||||
</div>
|
||||
{{ $generalSettingsModelList->links() }}
|
||||
@endsection
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
<div class="row">
|
||||
{{-- SUBTITLE --}}
|
||||
<div class="col-12 col-lg-6 mb-3">
|
||||
<fieldset class="border p-3">
|
||||
<legend>{{ str(__('validation.custom.subtitle'))->ucFirst()->plural() }}</legend>
|
||||
<div class="row mb-3">
|
||||
<div class="col-12">
|
||||
@include('bo.partials.inputs.varchar', [
|
||||
'id' => 'recipeSubtitle',
|
||||
'label' => __(':field :inter:model', [
|
||||
'field' => str(__('validation.custom.subtitle'))->ucFirst(),
|
||||
'inter' => __('validation.custom.of_the.plural'),
|
||||
'model' => str(__('models.classes.recipe'))->plural(),
|
||||
]),
|
||||
'hasWordCounter' => true,
|
||||
'name' => 'subtitle',
|
||||
'required' => true,
|
||||
'model' => json_decode(collect($generalSettingModel->value)) ?? null,
|
||||
'helper' => __('validation.between.string', [
|
||||
'attribute' => __(':field :inter:model', [
|
||||
'field' => __('validation.custom.subtitle'),
|
||||
'inter' => __('validation.custom.of_the.plural'),
|
||||
'model' => str(__('models.classes.recipe'))->plural(),
|
||||
]),
|
||||
'min' => 3,
|
||||
'max' => 255,
|
||||
]),
|
||||
'placeholder' => __(':field :inter:model', [
|
||||
'field' => str(__('validation.custom.subtitle'))->ucFirst(),
|
||||
'inter' => __('validation.custom.of_the.plural'),
|
||||
'model' => str(__('models.classes.recipe'))->plural(),
|
||||
]),
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
{{-- RECIPES TEXT --}}
|
||||
<div class="col-12 mb-3">
|
||||
<fieldset class="border p-3">
|
||||
<legend>{{ str(__('validation.attributes.text'))->ucFirst() }}</legend>
|
||||
<div class="row mb-3">
|
||||
<div class="col-12">
|
||||
@include('bo.partials.inputs.text-html', [
|
||||
'id' => 'recipesText',
|
||||
'label' => __(':field :inter:model', [
|
||||
'field' => str(__('validation.attributes.text'))->ucFirst(),
|
||||
'inter' => __('validation.custom.of_the.plural'),
|
||||
'model' => str(__('models.classes.recipe'))->plural(),
|
||||
]),
|
||||
'name' => 'text',
|
||||
'model' => json_decode(collect($generalSettingModel->value)) ?? null,
|
||||
'required' => true,
|
||||
'helper' =>
|
||||
__('crud.minicrud.text_warning') .
|
||||
' ' .
|
||||
__('validation.min.string', [
|
||||
'attribute' => str(__('models.classes.recipe'))->plural(),
|
||||
'min' => 15,
|
||||
]),
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap pb-3">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0" data-bs-toggle="tooltip" href="{{ route('bo.key_numbers.index') }}"
|
||||
<a class="btn btn-primary text-decoration-none m-0 me-2" data-bs-toggle="tooltip" href="{{ route('bo.key_numbers.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.key_number')]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap pb-3">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0" data-bs-toggle="tooltip" href="{{ route('bo.key_numbers.index') }}"
|
||||
<a class="btn btn-primary text-decoration-none m-0 me-2" data-bs-toggle="tooltip" href="{{ route('bo.key_numbers.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => str(__('models.classes.key_number'))->plural()]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center border-bottom flex-wrap pb-3">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0" data-bs-toggle="tooltip" data-bs-placement="top"
|
||||
<a class="btn btn-primary text-decoration-none m-0 me-2" data-bs-toggle="tooltip" data-bs-placement="top"
|
||||
href="{{ route('bo.key_numbers.index', ['sort_col' => 'created_at', 'sort_way' => 'desc']) }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => str(__('models.classes.key_number'))->plural()]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap pb-3">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0" data-bs-toggle="tooltip" href="{{ route('bo.main_slides.index') }}"
|
||||
<a class="btn btn-primary text-decoration-none m-0 me-2" data-bs-toggle="tooltip" href="{{ route('bo.main_slides.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.main_slide')]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap pb-3">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0" data-bs-toggle="tooltip" href="{{ route('bo.main_slides.index') }}"
|
||||
<a class="btn btn-primary text-decoration-none m-0 me-2" data-bs-toggle="tooltip" href="{{ route('bo.main_slides.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => str(__('models.classes.main_slide'))->plural()]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center border-bottom flex-wrap pb-3">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0" data-bs-toggle="tooltip" data-bs-placement="top"
|
||||
<a class="btn btn-primary text-decoration-none m-0 me-2" data-bs-toggle="tooltip" data-bs-placement="top"
|
||||
href="{{ route('bo.main_slides.index', ['sort_col' => 'created_at', 'sort_way' => 'desc']) }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => str(__('models.classes.main_slide'))->plural()]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap pb-3">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0" data-bs-toggle="tooltip" href="{{ route('bo.meats.index') }}"
|
||||
<a class="btn btn-primary text-decoration-none m-0 me-2" data-bs-toggle="tooltip" href="{{ route('bo.meats.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.meat')]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap pb-3">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0" data-bs-toggle="tooltip" href="{{ route('bo.meats.index') }}"
|
||||
<a class="btn btn-primary text-decoration-none m-0 me-2" data-bs-toggle="tooltip" href="{{ route('bo.meats.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => trans_choice('models.classes.meat', \INF)]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap pb-3">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0" data-bs-toggle="tooltip" href="{{ route('bo.meats.index') }}"
|
||||
<a class="btn btn-primary text-decoration-none m-0 me-2" data-bs-toggle="tooltip" href="{{ route('bo.meats.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => str(__('models.classes.meat'))->plural()]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap pb-3">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0" data-bs-toggle="tooltip" href="{{ route('bo.professions.index') }}"
|
||||
<a class="btn btn-primary text-decoration-none m-0 me-2" data-bs-toggle="tooltip" href="{{ route('bo.professions.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.profession')]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center flex-wrap pb-3">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0" data-bs-toggle="tooltip" href="{{ route('bo.professions.index') }}"
|
||||
<a class="btn btn-primary text-decoration-none m-0 me-2" data-bs-toggle="tooltip" href="{{ route('bo.professions.index') }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => str(__('models.classes.profession'))->plural()]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-md-nowrap align-items-center border-bottom flex-wrap pb-3">
|
||||
<div class="d-flex align-items-start flex-row">
|
||||
<a class="btn btn-primary text-decoration-none m-0" data-bs-toggle="tooltip" data-bs-placement="top"
|
||||
<a class="btn btn-primary text-decoration-none m-0 me-2" data-bs-toggle="tooltip" data-bs-placement="top"
|
||||
href="{{ route('bo.professions.index', ['sort_col' => 'created_at', 'sort_way' => 'desc']) }}"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => str(__('models.classes.profession'))->plural()]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue