Merge branch 'le-gaulois-2024' into develop

This commit is contained in:
Vincent BRIDIER 2024-09-19 15:49:00 +02:00
commit 31c6a90802
No known key found for this signature in database
GPG key ID: 8571BFA20420D512
40 changed files with 523 additions and 220 deletions

View file

@ -86,16 +86,7 @@ class NewsController extends Controller
return DB::transaction(function () use ($request) {
$news = new News();
$news->fill($request->validated());
$oldestNewsWithHighlight = News::query()->where('highlight', true)->orderBy('created_at')->get();
if ($news->saveOrFail()) {
if ($news->highlight === true) {
if ($oldestNewsWithHighlight->count() >= 2) {
/** @var \App\Models\News $firstNews */
$firstNews = $oldestNewsWithHighlight->first();
$firstNews->highlight = false;
$firstNews->save();
}
}
return redirect()->route('bo.news.edit', $news)
->with('success', trans('crud.messages.has_been_created', [
'model' => Str::ucfirst(trans('models.classes.news'))
@ -144,16 +135,7 @@ class NewsController extends Controller
): \Illuminate\Http\RedirectResponse {
return DB::transaction(function () use ($request, $news) {
$news->fill($request->validated());
$oldestNewsWithHighlight = News::query()->where('highlight', true)->orderBy('created_at')->get();
if ($news->saveOrFail()) {
if ($news->highlight === true) {
if ($oldestNewsWithHighlight->count() >= 2) {
/** @var \App\Models\News $firstNews */
$firstNews = $oldestNewsWithHighlight->first();
$firstNews->highlight = false;
$firstNews->save();
}
}
return redirect()->route('bo.news.edit', $news)
->with('success', trans('crud.messages.has_been_updated', [
'model' => Str::ucfirst(trans('models.classes.news'))

View file

@ -17,9 +17,7 @@ class HomeController extends Controller
{
$newsClubModels = NewsClub::query()->where('published', true)->orderBy('publish_at', 'asc')->take(3)->get();
$discountModels = Discount::query()->get();
$discountsTotal = array_sum($discountModels->map(function (Discount $discountModel) {
return $discountModel->value;
})->toArray());
$discountsTotal = $discountModels->sum('value');
return (auth('club')->check())
? view('club.pages.home.homepage', compact('newsClubModels', 'discountModels', 'discountsTotal'))
: view('club.pages.home.guest', compact('newsClubModels'));

View file

@ -7,6 +7,7 @@ use App\Enums\StaticPageType;
use App\Http\Controllers\Controller;
use App\Http\Requests\Fo\SingleOptinRequest;
use App\Models\DemarcheSlide;
use App\Models\Discount;
use App\Models\MainSlide;
use App\Models\Product;
use App\Models\GeneralSetting;
@ -46,6 +47,7 @@ class HomeController extends Controller
])->limit(9)->get();
$videoModels = Video::query()->where('published', true)->where('is_on_homepage', true)
->orderBy('order')->with('product')->limit(9)->get();
$discountsTotal = Discount::query()->get()->sum('value');
return view('fo.pages.home', compact(
'staticPageModel',
'mainSlideModels',
@ -55,7 +57,8 @@ class HomeController extends Controller
'newsModels',
'recipeModels',
'hotNewsSettings',
'videoModels'
'videoModels',
'discountsTotal',
));
}

View file

@ -221,7 +221,7 @@ class UpdateGeneralSettingRequest extends FormRequest
];
return \array_merge(
$rules,
$this->pictureRules('picture', 200, 100, 200, 100),
$this->pictureRules('picture', 500, 281, 500, 281),
);
}

View file

@ -56,12 +56,12 @@ class StoreProductRequest extends FormRequest
'seo_title' => 'required|min:45|max:70',
'seo_description' => 'required|min:50|max:160',
'label' => 'required|string|between:3,255',
'picture_alt' => 'required_with:picture|nullable|between:3,255',
'picture_title' => 'required_with:picture|nullable|between:3,255',
'banner_alt' => 'required_with:banner|nullable|between:3,255',
'banner_title' => 'required_with:banner|nullable|between:3,255',
'packaging_alt' => 'required_with:packaging|nullable|between:3,255',
'packaging_title' => 'required_with:packaging|nullable|between:3,255',
'picture_alt' => 'required_with:picture|nullable|string|between:3,255',
'picture_title' => 'required_with:picture|nullable|string|between:3,255',
'banner_alt' => 'required_with:banner|nullable|string|between:3,255',
'banner_title' => 'required_with:banner|nullable|string|between:3,255',
'packaging_alt' => 'required_with:packaging|nullable|string|between:3,255',
'packaging_title' => 'required_with:packaging|nullable|string|between:3,255',
'description' => ['required', 'string', new WysiwygLength()],
'details' => ['required', 'string', new WysiwygLength()],
'preparation' => ['required', 'string', new WysiwygLength()],
@ -178,7 +178,7 @@ class StoreProductRequest extends FormRequest
return \array_merge(
$rules,
$this->pictureRules('picture', 300, 200, 300, 200),
$this->pictureRules('banner', 1440, 420, 1440, 420),
$this->pictureRules('banner', 1440, 420, 1440, 420, true),
$this->pictureRules('packaging', 315, 450, 315, 450),
);
}

View file

@ -62,7 +62,7 @@ class StoreRecipeRequest extends FormRequest
'picture_alt' => 'required_with:picture|nullable|between:3,255',
'picture_title' => 'required_with:picture|nullable|between:3,255',
'ingredients_list.*' => 'required|array',
'ingredients_list.*.value' => 'sometimes|nullable|numeric|between:1,1000',
'ingredients_list.*.value' => 'sometimes|nullable|decimal:0,2|between:1,1000',
'ingredients_list.*.label_unit' => [
'required_with:ingredients_list.*.label_unit',
'sometimes',
@ -79,7 +79,7 @@ class StoreRecipeRequest extends FormRequest
'products' => 'required|array',
'products.*' => 'required|integer|exists:products,id',
'preparation_time' => 'required|numeric|between:1,1000',
'cooking_time' => 'required|numeric|between:1,1000',
'cooking_time' => 'nullable|numeric|between:0,1000',
'nb_guests' => 'required|numeric|between:1,50',
'difficulty' => ['required', new Enum(DifficultyEnum::class)],
'highlight' => 'required|boolean',

View file

@ -3,25 +3,35 @@
namespace App\Models;
use App\Lib\Helpers\FileStorageHelper;
use App\Traits\Models\ActivityLog;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Lib\Helpers\ToolboxHelper;
use App\Traits\Models\ActivityLog;
use Detection\MobileDetect;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Str;
/**
* @property string $title The title of the news.
* @property string $content The content of the news.
* @property string $url The linkedin url of the news.
* @property string $picture Picture path.
* @property string $picture_title Picture title attribute.
* @property string $picture_alt Picture alt attribute.
* @property boolean $published News publish status.
* @property-read \Illuminate\Support\Carbon $published_at News published_at.
* @property-read \Illuminate\Support\Carbon $unpublished_at News unpublished_at.
* @property-read \Illuminate\Support\Carbon $created_at Created date.
* @property-read \Illuminate\Support\Carbon $updated_at Updated date.
* @property string $seo_title The seo title of the news.
* @property string $seo_description The seo description of the news.
* @property string $title The title of the news.
* @property string|null $subtitle The subtitle of the news.
* @property string $subtitle The subtitle of the news.
* @property string $picture News picture.
* @property string $picture_alt Picture alt attribute.
* @property string $picture_title Picture title attribute.
* @property string $thumbnail News thumbnail.
* @property string $thumbnail_alt Thumbnail alt attribute.
* @property string $thumbnail_title Thumbnail title attribute.
* @property string $content The content of the news.
* @property \App\Models\NewsCategory $news_category_id The category associated to the news.
* @property boolean $highlight News highlight status.
* @property boolean $published News publish status.
* @property-read \Illuminate\Support\Carbon $published_at News published_at.
* @property-read \Illuminate\Support\Carbon $unpublished_at News unpublished_at.
* @property-read \Illuminate\Support\Carbon $created_at Created date.
* @property-read \Illuminate\Support\Carbon $updated_at Updated date.
*/
class News extends Model
{
@ -74,12 +84,13 @@ class News extends Model
{
static::creating(function (self $news) {
self::makeStatusSense($news);
self::checkHighlightField($news);
self::assertTitleIsUnique($news->title);
self::manageFields($news);
});
static::updating(function (self $news) {
self::makeStatusSense($news);
self::assertTitleIsUnique($news->title, $news->getKey());
self::checkHighlightField($news);
self::manageFields($news);
});
static::updated(function (self $news) {
@ -120,6 +131,34 @@ class News extends Model
}
}
/**
* Adjusts news status using current status and publish dates.
*
* @param self $news
* @return void
*/
private static function checkHighlightField(self $news): void
{
$hotNewsModels = News::query()
->where('published', true)
->where('highlight', true)
->where('id', '!=', $news->getKey())
->orderBy('publish_at', 'ASC')
->get();
if ($hotNewsModels->count() >= 2 && $news->highlight) {
$hotNewsModel = $hotNewsModels->first();
$hotNewsModel->highlight = false;
$hotNewsModel->saveOrFail();
Session::flash('warning', trans(
'Maximum 2 :model1 peuvent être mise en avant, la plus ancienne a donc été enlevée des :model2',
[
'model1' => Str::of(trans('models.classes.news'))->plural(),
'model2' => trans('models.classes.hot_news'),
]
));
}
}
/**
* Getter the current status following planification dates planificated_status.
*
@ -151,6 +190,7 @@ class News extends Model
*/
private static function manageFields(self $model): void
{
self::assertTitleIsUnique($model->title, $model->getKey());
$model->slug = str($model->title)->slug();
$model->thumbnail = FileStorageHelper::storeFile($model, $model->thumbnail, true);
$model->picture = FileStorageHelper::storeFile($model, $model->picture, true);

View file

@ -114,8 +114,8 @@ class Product extends Model implements SeoInterface
});
static::deleted(function (self $product) {
FileStorageHelper::removeFile($product, 'picture');
FileStorageHelper::removeOldFile($product, 'banner');
FileStorageHelper::removeOldFile($product, 'packaging');
FileStorageHelper::removeFile($product, 'banner');
FileStorageHelper::removeFile($product, 'packaging');
});
}

View file

@ -152,8 +152,11 @@ trait HasPicture
$changedPicture = ltrim($decodedPath, '/');
$this->merge([
$name => $changedPicture
]);
} //end if
]);// le else if sert a gerer le cas ou l'image de la bannière produit est nulle
} else if (is_null($picturePath)) {
$this->merge([$name => null]);
return;
}
}
/**

View file

@ -16,7 +16,7 @@ return new class extends Migration
$table->string('seo_title')->comment('The seo title of the news.');
$table->string('seo_description')->comment('The seo description of the news.');
$table->string('title')->comment('The title of the news.');
$table->string('subtitle')->nullable()->comment('The title of the news.');
$table->string('subtitle')->nullable()->comment('The subtitle of the news.');
$table->string('picture')->comment('Picture path.');
$table->string('picture_alt')->comment('Picture alt attribute.');
$table->string('picture_title')->comment('Picture title attribute.');
@ -25,8 +25,9 @@ return new class extends Migration
$table->string('thumbnail_title')->comment('Thumbnail title attribute.');
$table->string('slug')->unique()->comment('Unique title slug');
$table->text('content')->comment('The content of the news.');
$table->foreignId('news_category_id')->constrained('news_categories')->restrictOnDelete()->comment('News category id');
$table->boolean('highlight')->comment('Highlight status.');
$table->foreignId('news_category_id')->constrained('news_categories')
->restrictOnDelete()->comment('News category id');
$table->boolean('highlight')->comment('News highlight status.');
$table->boolean('published')->comment('News publish status.');
$table->timestamp('publish_at')->nullable()->comment('News publishment date.');
$table->timestamp('unpublish_at')->nullable()->comment('News unpublishment date.');

View file

@ -0,0 +1,36 @@
<?php
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('products', function (Blueprint $table) {
$table->string('banner')->nullable()->change();
$table->string('banner_alt')->nullable()->change();
$table->string('banner_title')->nullable()->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down(): void
{
Schema::table('products', function (Blueprint $table) {
$table->string('banner')->nullable(false)->change();
$table->string('banner_alt')->nullable(false)->change();
$table->string('banner_title')->nullable(false)->change();
});
}
};

View file

@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('recipes', function (Blueprint $table) {
$table->unsignedSmallInteger('cooking_time')->nullable()->change();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('recipes', function (Blueprint $table) {
$table->unsignedSmallInteger('cooking_time')->nullable(false);
});
}
};

View file

@ -0,0 +1,23 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('recipes', function (Blueprint $table) {
$table->string('tips', 500)->comment('Recipe tips.')->change();
});
}
/**
* Reverse the migrations.
*/
public function down(): void {}
};

View file

@ -74,7 +74,7 @@ return [
'picture_title_helper' => 'Utile pour les utilisateurs, s\'affiche en passant la souris sur l\'image.',
'picture_title_label' => 'Attribut du titre de l\'image',
'picture_alt_helper' => 'Doit décrire votre image pour les moteurs de recherche et
les aveugles (5 à 6 mots).',
les personnes malvoyantes (5 à 6 mots).',
'picture_alt_label' => 'Attribut Alt de l\'image',
'text_warning' => 'Relisez votre contenu avant de le publier.',
],

View file

@ -1,31 +1,74 @@
#home {
.hot-news-content{
width: 250px;
height: 22rem;
.hot-news-content {
height: fit-content;
@include media-breakpoint-up(xl) {
width: 250px;
}
.border-custom {
border-bottom: 2px #0006 dashed;
@include media-breakpoint-up(sm) {
&:nth-child(1), &:nth-child(2) {
border-right: 2px #0006 dashed;
border-bottom: 0;
}
&:nth-child(2) {
border-right: 0;
border-bottom: 0;
}
}
@include media-breakpoint-up(md) {
&:nth-child(1), &:nth-child(2) {
border-right: 2px #0006 dashed;
border-bottom: 0;
}
}
@include media-breakpoint-up(xl) {
&:nth-child(1), &:nth-child(2) {
border-right: 0 !important;
border-bottom: 2px #0006 dashed !important;
}
}
}
}
#hot-news-desktop{
.wood-background{
height: 20rem;
#hot-news-desktop {
margin-top: -1rem;
@include media-breakpoint-up(md) {
padding-top: 8rem;
}
@include media-breakpoint-up(xl) {
padding-top: 0;
}
.wood-background {
bottom: 1rem;
min-height: 100%;
background-image: url('@/images/home/hot-news-wood.png');
background-position: bottom;
background-size: cover;
@include media-breakpoint-up(md) {
height: calc(14vw + 5rem);
}
}
.hot-news-position{
position: absolute;
.hot-news-position {
z-index: 10;
top: -5%;
right: 13%;
width: calc(100% - 6rem);
}
}
#hot-news{
#hot-news {
transition: .3s;
hr {
border-top: 2px dashed;
}
&.hot-news-hide {
transform: translate(100%, -50%) !important;
}
@ -115,7 +158,7 @@
}
&-next-custom {
left: calc(20vw + 29.5rem);
right: 1rem;
}
}
}
@ -275,8 +318,8 @@
}
}
.swiper-videos{
.swiper-slide{
.swiper-videos {
.swiper-slide {
transition: all .2s ease;
&-prev {
@ -291,7 +334,7 @@
}
}
.swiper-videos-button-prev{
.swiper-videos-button-prev {
top: 55%;
left: 4%;
@ -300,7 +343,7 @@
}
}
.swiper-videos-button-next{
.swiper-videos-button-next {
top: 55%;
right: 4%;

View file

@ -37,7 +37,9 @@
}
.recipe-image-wrapper {
transform: translateX(8vw);
@include media-breakpoint-up(lg) {
transform: translateX(8vw);
}
@include media-breakpoint-up(xl) {
position: absolute;
@ -84,4 +86,4 @@
}
}
}
}
}

View file

@ -1,7 +1,6 @@
.testimonial-card {
.testimonial-img {
clip-path: polygon(60% .2vw,100% 0,100% calc(100% - .2vw),70% calc(100% - .35vw),40% 100%,0 calc(100% - .2vw),0 .2vw,30% 0);
clip-path: polygon(60% .2vw, 100% 0, 100% calc(100% - .2vw), 70% calc(100% - .35vw), 40% 100%, 0 calc(100% - .2vw), 0 .2vw, 30% 0);
&-wrapper {
@include media-breakpoint-up(lg) {
@ -36,4 +35,13 @@
min-height: 5rem;
}
}
.fa-play {
width: 2rem;
height: 2rem;
}
.video-link {
cursor: pointer;
}
}

View file

@ -24,19 +24,43 @@
.w#{$infix}-25 {
width: 25% !important;
}
.w#{$infix}-50 {
width: 50% !important;
}
.w#{$infix}-75 {
width: 75% !important;
}
.w#{$infix}-100 {
width: 100% !important;
}
.w#{$infix}-fit {
width: fit-content !important;
}
.h#{$infix}-25 {
height: 25% !important;
}
.h#{$infix}-50 {
height: 50% !important;
}
.h#{$infix}-75 {
height: 75% !important;
}
.h#{$infix}-100 {
height: 100% !important;
}
.h#{$infix}-fit {
height: fit-content !important;
}
@each $prop, $unit in (width: vw, height: vh) {
@each $size in [25, 50, 75, 100] {
.#{$unit}#{$infix}-#{$size} {

View file

@ -31,7 +31,7 @@
@change="pictureInputHasChanged"
type="file"
class="d-none"
:name="`${fileParamIsFile ? parameters.name : ''}`"
:name="parameters.name"
accept=".jpg,.jpeg,.gif,.png"
:aria-describedby="`Help${parameters.id}`"
>

View file

@ -53,6 +53,7 @@
:name="`${inputParameters.name}[${String(itemIndex)}][${column[0]}]`"
:type="itemParameters.type[columnIndex]"
v-model="item[column[0] as keyof typeof item]"
:step="itemParameters.type[columnIndex] === 'number' ? (inputParameters.step ?? 1) : undefined"
:placeholder="inputParameters.placeholder[columnIndex]"
:min="itemParameters.type[columnIndex] == 'number' ? '0' : undefined"
>
@ -120,11 +121,15 @@ const allErrors = ref<LaravelValidationErrors>({});
const inputParameters = reactive<{
name: string,
placeholder: Array<string>,
step: number,
}>({
name: "",
placeholder: [""],
step: 1
});
/** Item parameters. */
const itemParameters = reactive<{
list: Array<Object>,
@ -158,6 +163,7 @@ onMounted(() => {
/** Input parameters. */
inputParameters.name = data.inputName;
inputParameters.placeholder = data.inputPlaceholder;
inputParameters.step = data.step ?? null;
/** Item parameters. */
itemParameters.list = data.itemList;
itemParameters.columns = data.itemColumns;

View file

@ -546,6 +546,32 @@ document.addEventListener("DOMContentLoaded", function () {
document.querySelector("#swiper-videos .swiper-slide-next")?.setAttribute("inert", "true");
});
}
if (swiper.el.id === "swiper-testimonials") {
swiper.on("slideChange", function() {
updateTestimonialVideoModal(swiper.slides[swiper.activeIndex]);
});
}
}
function updateTestimonialVideoModal(currentSlide: any) {
const videoLinkElement = currentSlide.querySelector(".video-link") as HTMLAnchorElement;
if (!videoLinkElement) {
return;
}
const videoModal = document.querySelector("#testimonial-video-modal") as HTMLDivElement;
if (!videoModal) {
return;
}
const modalLink = document.querySelector(".video-inlaid") as HTMLAnchorElement;
if (!modalLink) {
return;
}
modalLink.setAttribute("href", String(videoLinkElement.dataset.videoLink));
const iframe = modalLink.querySelector("iframe");
if (!iframe) {
return;
}
iframe.setAttribute("src", String(videoLinkElement.dataset.videoLink));
}
function eventBtnPlayPause(swiper: Swiper, btnPlayPause: HTMLElement | null) {

View file

@ -35,7 +35,7 @@
class="text-quad me-2"
>{{ (ingredient.is_proportionnal ? (Math.round((nbGuestsCustom * ingredient.value / nbGuests)* 2 ) * 0.5 > 1 ?
Math.round((nbGuestsCustom * ingredient.value / nbGuests)* 2 ) * 0.5 :
1) : ingredient.value) }}{{ ingredient.label_unit }}</span>
1) : ingredient.value) }} {{ " " }} {{ ingredient.label_unit }}</span>
<span>{{ ingredient.label_value }}</span>
</li>
</ul>

View file

@ -54,8 +54,8 @@
@include('bo.partials.inputs.varchar-picture', [
'id' => 'hotNewsPicture',
'name' => 'picture',
'width' => 200,
'height' => 100,
'width' => 500,
'height' => 281,
'value' => json_decode(collect($generalSettingModel->value))->picture,
'required' => true,
'preview' => true,

View file

@ -495,7 +495,7 @@
{{-- IS_NEW --}}
<div class="col-12 col-md-6 mb-3">
@include('bo.partials.inputs.tinyint-boolean', [
'id' => 'mainSlidePublished',
'id' => 'mainSlideIsNew',
'name' => 'new',
'model' => $mainSlideModel ?? null,
'label' => str(__('validation.custom.new'))->ucFirst(),

View file

@ -80,6 +80,8 @@
'model' => __('models.classes.meat'),
]))->ucfirst(),
'name' => 'color',
'value' => "#268DC6",
'presetColors' => ["#268DC6", "#EE7C28", "#C6725C", "#0F437E", "#AC283D", "#FDC331", "#FFDB9A", "#063", "#111", "#fbf8f5"],
'model' => $meatModel ?? null,
'nullable' => false,
'required' => true,

View file

@ -6,6 +6,7 @@
'title' => str(__('validation.attributes.title'))->ucfirst(),
'news_category_id' => str(__('validation.custom.category'))->ucfirst(),
'picture' => str(__('validation.attributes.image'))->ucfirst(),
'highlight' => str(__('validation.custom.highlight'))->ucfirst(),
'published' => str(__('validation.custom.publication'))->ucfirst(),
'updated_at' => str(__('validation.attributes.updated_at'))->ucfirst(),
],
@ -20,6 +21,9 @@
<img class="image-preview" src="{{ asset($newsModel->picture) }}" title="{{ $newsModel->picture_title }}"
alt="{{ $newsModel->picture_alt }}">
</td>
<td class="text-center align-middle">
{{ str($newsModel->highlight ? 'oui' : 'non')->ucFirst() }}
</td>
@include('bo.modules.change-published-status', [
'routeName' => 'news',
'model' => $newsModel,

View file

@ -241,7 +241,7 @@
'field1' => str(__('validation.custom.attribute_alt'))->ucFirst(),
'inter1' => __('validation.custom.of_the.vowel'),
'field2' => __('validation.attributes.image'),
'inter2' => __('validation.custom.of_the.female'),
'inter2' => __('validation.custom.of_the.male'),
'model' => __('models.classes.product'),
]),
'hasWordCounter' => true,
@ -253,7 +253,7 @@
'field1' => str(__('validation.custom.attribute_alt'))->ucFirst(),
'inter1' => __('validation.custom.of_the.vowel'),
'field2' => __('validation.attributes.image'),
'inter2' => __('validation.custom.of_the.female'),
'inter2' => __('validation.custom.of_the.male'),
'model' => __('models.classes.product'),
]),
])
@ -266,7 +266,7 @@
'field1' => str(__('validation.custom.attribute_title'))->ucFirst(),
'inter1' => __('validation.custom.of_the.vowel'),
'field2' => __('validation.attributes.image'),
'inter2' => __('validation.custom.of_the.female'),
'inter2' => __('validation.custom.of_the.male'),
'model' => __('models.classes.product'),
]),
'hasWordCounter' => true,
@ -278,7 +278,7 @@
'field1' => str(__('validation.custom.attribute_title'))->ucFirst(),
'inter1' => __('validation.custom.of_the.vowel'),
'field2' => __('validation.attributes.image'),
'inter2' => __('validation.custom.of_the.female'),
'inter2' => __('validation.custom.of_the.male'),
'model' => __('models.classes.product'),
]),
])
@ -311,19 +311,18 @@
'field1' => str(__('validation.custom.attribute_alt'))->ucFirst(),
'inter1' => __('validation.custom.of_the.vowel'),
'field2' => __('validation.attributes.image'),
'inter2' => __('validation.custom.of_the.female'),
'inter2' => __('validation.custom.of_the.male'),
'model' => __('models.classes.product'),
]),
'hasWordCounter' => true,
'name' => 'banner_alt',
'required' => true,
'model' => $productModel ?? null,
'helper' => __('crud.minicrud.picture_alt_helper'),
'placeholder' => __(':field1 :inter1:field2 :inter2:model', [
'field1' => str(__('validation.custom.attribute_alt'))->ucFirst(),
'inter1' => __('validation.custom.of_the.vowel'),
'field2' => __('validation.attributes.image'),
'inter2' => __('validation.custom.of_the.female'),
'inter2' => __('validation.custom.of_the.male'),
'model' => __('models.classes.product'),
]),
])
@ -336,19 +335,18 @@
'field1' => str(__('validation.custom.attribute_title'))->ucFirst(),
'inter1' => __('validation.custom.of_the.vowel'),
'field2' => __('validation.attributes.image'),
'inter2' => __('validation.custom.of_the.female'),
'inter2' => __('validation.custom.of_the.male'),
'model' => __('models.classes.product'),
]),
'hasWordCounter' => true,
'name' => 'banner_title',
'required' => true,
'model' => $productModel ?? null,
'helper' => __('crud.minicrud.picture_title_helper'),
'placeholder' => __(':field1 :inter1:field2 :inter2:model', [
'field1' => str(__('validation.custom.attribute_title'))->ucFirst(),
'inter1' => __('validation.custom.of_the.vowel'),
'field2' => __('validation.attributes.image'),
'inter2' => __('validation.custom.of_the.female'),
'inter2' => __('validation.custom.of_the.male'),
'model' => __('models.classes.product'),
]),
])
@ -361,7 +359,6 @@
'width' => 1440,
'height' => 420,
'model' => $productModel ?? null,
'required' => true,
'preview' => true,
])
</div>

View file

@ -80,6 +80,8 @@
'model' => __('models.classes.range'),
]))->ucfirst(),
'name' => 'color',
'value' => "#268DC6",
'presetColors' => ["#268DC6", "#EE7C28", "#C6725C", "#0F437E", "#AC283D", "#FDC331", "#FFDB9A", "#063"],
'model' => $rangeModel ?? null,
'required' => true,
'disabled' => false,

View file

@ -241,14 +241,14 @@
'model' => $recipeModel ?? null,
'step' => 1,
'unsigned' => true,
'min' => 1,
'min' => 0,
'max' => 1000,
'required' => true,
'required' => false,
'label' => str(__('validation.custom.cooking_time'))->ucFirst(),
'helper' => str(
__('validation.between.numeric', [
'attribute' => __('validation.custom.cooking_time'),
'min' => 1,
'min' => 0,
'max' => 1000,
]))->ucFirst(),
])
@ -295,19 +295,20 @@
['is_proportionnal', str(__('proportionnel'))->ucFirst()],
],
'itemType' => ['number', 'text', 'text', 'boolean'],
'itemLimit' => [1, 20],
'itemLimit' => [1, 25],
'inputPlaceholder' => [
str(__('validation.custom.ingredient'))->ucFirst(),
str(__('validation.custom.value'))->ucFirst(),
str(__('validation.custom.unit'))->ucFirst(),
],
'required' => true,
'step' => '0.5',
'helper' => str(
__('validation.list_items', [
'field' => __('validation.custom.ingredient'),
'min' => 3,
'lineMin' => 1,
'lineMax' => 20,
'lineMax' => 25,
]))->ucFirst(),
])
</div>
@ -337,7 +338,7 @@
'model' => __('models.classes.recipe'),
]),
'min' => 3,
'max' => 255,
'max' => 500,
]),
'placeholder' => __(':field :inter:model', [
'field' => str(__('validation.custom.tips'))->ucfirst(),

View file

@ -1,7 +1,6 @@
@use('\App\Enums\StaticPageType', 'StaticPageType')
<div class="row">
@if (!$staticPageModel->type->equals(StaticPageType::recipe) &&
!$staticPageModel->type->equals(StaticPageType::product))
@if (!$staticPageModel->type->equals(StaticPageType::recipe) && !$staticPageModel->type->equals(StaticPageType::product))
{{-- SEO_TITLE --}}
<div class="col-12 col-md-6 mb-3">
<fieldset class="h-100 border p-3">
@ -80,9 +79,10 @@
</fieldset>
</div>
@endif
@if (!$staticPageModel->type->equals(StaticPageType::recipe) &&
!$staticPageModel->type->equals(StaticPageType::product) &&
!$staticPageModel->type->equals(StaticPageType::home))
@if (
!$staticPageModel->type->equals(StaticPageType::recipe) &&
!$staticPageModel->type->equals(StaticPageType::product) &&
!$staticPageModel->type->equals(StaticPageType::home))
{{-- TITLE --}}
<div class="col-12 col-md-6 mb-3">
<fieldset class="h-100 border p-3">
@ -112,12 +112,13 @@
</fieldset>
</div>
@endif
@if (!$staticPageModel->type->equals(StaticPageType::recipe) &&
!$staticPageModel->type->equals(StaticPageType::product) &&
!$staticPageModel->type->equals(StaticPageType::legals) &&
!$staticPageModel->type->equals(StaticPageType::confidentiality) &&
!$staticPageModel->type->equals(StaticPageType::accessibility) &&
!$staticPageModel->type->equals(StaticPageType::selling))
@if (
!$staticPageModel->type->equals(StaticPageType::recipe) &&
!$staticPageModel->type->equals(StaticPageType::product) &&
!$staticPageModel->type->equals(StaticPageType::legals) &&
!$staticPageModel->type->equals(StaticPageType::confidentiality) &&
!$staticPageModel->type->equals(StaticPageType::accessibility) &&
!$staticPageModel->type->equals(StaticPageType::selling))
{{-- SUBTITLE --}}
<div class="col-12 col-md-6 mb-3">
<fieldset class="h-100 border p-3">
@ -142,7 +143,7 @@
'model' => trans_choice('models.classes.static_page', 1),
]),
'min' => 3,
'max' => 255,
'max' => 500,
]),
'placeholder' => __(':field :inter:model', [
'field' => str(__('validation.custom.subtitle'))->ucfirst(),
@ -155,10 +156,11 @@
</fieldset>
</div>
@endif
@if (!$staticPageModel->type->equals(StaticPageType::recruitment) &&
!$staticPageModel->type->equals(StaticPageType::recipe) &&
!$staticPageModel->type->equals(StaticPageType::product) &&
!$staticPageModel->type->equals(StaticPageType::home))
@if (
!$staticPageModel->type->equals(StaticPageType::recruitment) &&
!$staticPageModel->type->equals(StaticPageType::recipe) &&
!$staticPageModel->type->equals(StaticPageType::product) &&
!$staticPageModel->type->equals(StaticPageType::home))
{{-- CONTENT --}}
<div class="col-12 mb-3">
<fieldset class="border p-3">
@ -189,15 +191,16 @@
</fieldset>
</div>
@endif
@if (!$staticPageModel->type->equals(StaticPageType::recipes) &&
!$staticPageModel->type->equals(StaticPageType::recipe) &&
!$staticPageModel->type->equals(StaticPageType::products) &&
!$staticPageModel->type->equals(StaticPageType::product) &&
!$staticPageModel->type->equals(StaticPageType::home) &&
!$staticPageModel->type->equals(StaticPageType::legals) &&
!$staticPageModel->type->equals(StaticPageType::confidentiality) &&
!$staticPageModel->type->equals(StaticPageType::accessibility) &&
!$staticPageModel->type->equals(StaticPageType::selling))
@if (
!$staticPageModel->type->equals(StaticPageType::recipes) &&
!$staticPageModel->type->equals(StaticPageType::recipe) &&
!$staticPageModel->type->equals(StaticPageType::products) &&
!$staticPageModel->type->equals(StaticPageType::product) &&
!$staticPageModel->type->equals(StaticPageType::home) &&
!$staticPageModel->type->equals(StaticPageType::legals) &&
!$staticPageModel->type->equals(StaticPageType::confidentiality) &&
!$staticPageModel->type->equals(StaticPageType::accessibility) &&
!$staticPageModel->type->equals(StaticPageType::selling))
{{-- PICTURE SECTION --}}
<div class="col-12 pb-3">
<fieldset class="h-100 border p-3">

View file

@ -13,7 +13,7 @@
'value' => $value ?? old($name, $model->{$name} ?? ''),
'nullable' => !$required,
'disabled' => $disabled ?? false,
'presetColors' => ["#0f437e", "#4e3238", "#f3ebe4", "#1175b7", "#c7d400", "#fab7d8", "#063", "#e30513", "#212425", "#fbf8f5"],
'presetColors' => $presetColors ?? ["#0f437e", "#4e3238", "#f3ebe4", "#1175b7", "#c7d400", "#fab7d8", "#063", "#e30513", "#ce6118", "#212425", "#fbf8f5"],
];
@endphp
<div class="color-picker" data-json='@json($data)'></div>

View file

@ -11,6 +11,7 @@
'inputPlaceholder' => $inputPlaceholder,
'header' => $header ?? false,
'errors' => $errors->getBag('default')->getMessages() ?? [],
'step' => $step ?? null,
];
@endphp
<div class="list-item" data-json='@json($data)'></div>

View file

@ -6,38 +6,44 @@
@section('bg-offset', true)
@section('content')
<section id="home">
<section id="home" class="overflow-hidden">
{{-- HOT NEWS --}}
<div id="hot-news" @class([
'top-50 end-0 translate-middle-y position-fixed z-3 bg-white d-none line-border-small py-3',
'd-none position-fixed top-50 end-0 translate-middle-y bottom-left-shadow z-3',
'd-xl-block' => !cache('hotNewsIsDisplayed'),
])>
<div class="bg-primary position-absolute w-100 h-100 z-2 start-0 top-0 bg-opacity-50" id="hot-news-loader">
<div class="position-absolute start-50 top-50 translate-middle">
<div class="spinner-border" role="status">
<span class="visually-hidden">{{ __('Chargement...') }}</span>
<div class="line-border-small py-3 bg-white">
<div class="bg-primary position-absolute w-100 h-100 z-2 start-0 top-0 bg-opacity-50" id="hot-news-loader">
<div class="position-absolute start-50 top-50 translate-middle">
<div class="spinner-border" role="status">
<span class="visually-hidden">{{ __('Chargement...') }}</span>
</div>
</div>
</div>
<button class="btn-close position-absolute start-0 top-0 pt-3 ms-2 pe-2 mt-2 bg-white opacity-100" id="close-hot-news"
aria-label="Close"></button>
@include('fo.partials.hot-news')
</div>
<button class="btn-close position-absolute start-0 top-0 pt-3" id="close-hot-news" aria-label="Close"></button>
@include('fo.partials.hot-news')
</div>
{{-- MAIN SLIDES --}}
@if ($mainSlideModels->isNotEmpty())
<section class="container-fluid position-relative bg-light overflow-hidden p-0" id="main-slides">
<section class="container-fluid position-relative bg-light p-0" id="main-slides">
<div class="swiper swiper-main-slides overflow-visible" id="swiper-main-slides">
<div class="swiper-wrapper w-fit">
@foreach ($mainSlideModels as $mainSlideModel)
<div class="swiper-slide h-auto" style="background-color:{{ $mainSlideModel->color_block }}">
<div class="swiper-slide h-auto pb-5 pb-md-0" style="background-color:{{ $mainSlideModel->color_block }}">
<div class="swiper-background d-flex justify-content-center align-items-center">
<img src="{{ asset($mainSlideModel->background) }}" title="{{ $mainSlideModel->background_title }}"
<img src="{{ asset($mainSlideModel->background) }}"
title="{{ $mainSlideModel->background_title }}"
alt="{{ $mainSlideModel->background_alt }}">
</div>
<div
class="card d-flex flex-column-reverse flex-sm-row align-items-center align-items-sm-start justify-content-center align-items-md-center flex-row border-0 bg-transparent">
@if ($mainSlideModel->picture)
<img class="card-picture img-fluid ms-md-0 ms-sm-2 ms-0" src="{{ asset($mainSlideModel->picture) }}"
title="{{ $mainSlideModel->picture_title }}" alt="{{ $mainSlideModel->picture_alt }}">
<img class="card-picture img-fluid ms-md-0 ms-sm-2 ms-0"
src="{{ asset($mainSlideModel->picture) }}"
title="{{ $mainSlideModel->picture_title }}"
alt="{{ $mainSlideModel->picture_alt }}">
@endif
<div @class([
'card-body position-relative p-0',
@ -76,12 +82,14 @@
</div>
@endforeach
</div>
<button
class="position-absolute z-1 swiper-pagination-playpause btn btn-secondary btn-sm bg-secondary bottom-0 start-0 border-0 bg-opacity-50"
title="{{ __('Bouton pour mettre le carrousel en pause/en fonctionnement') }}">
<i class="fa-solid fa-xl fa-pause"></i>
<i class="fa-solid fa-xl fa-play d-none"></i>
</button>
@if ($mainSlideModels->count() >= 2)
<button
class="position-absolute z-1 swiper-pagination-playpause btn btn-secondary btn-sm bg-secondary bottom-0 start-0 border-0 bg-opacity-50"
title="{{ __('Bouton pour mettre le carrousel en pause/en fonctionnement') }}">
<i class="fa-solid fa-xl fa-pause"></i>
<i class="fa-solid fa-xl fa-play d-none"></i>
</button>
@endif
</div>
<button
class="swiper-button swiper-button-prev-custom swiper-main-slides-button-prev rounded-circle z-1 mx-3 border-0 bg-white">
@ -98,15 +106,18 @@
<img src="{{ Vite::asset('resources/assets/images/common/arrow-brown.svg') }}"
title="{{ __('Navigation du slider (droite)') }}" alt="{{ __('flèche vers la droite') }}">
</button>
<img class="w-100 d-none d-xl-block" src="{{ Vite::asset('resources/assets/images/home/bg-slider-wood.png') }}"
<img class="w-100 d-none d-xl-block"
src="{{ Vite::asset('resources/assets/images/home/bg-slider-wood.png') }}"
alt="{{ __('Footer imitation bois du slider') }}">
</section>
@endif
{{-- HOT NEWS DESKTOP --}}
<div class="position-relative d-block d-xl-none" id="hot-news-desktop">
<div class="wood-background w-100"></div>
<div class="w-75 d-block d-xl-none hot-news-position line-border-small mx-auto bg-white">
@include('fo.partials.hot-news')
<div class="position-absolute start-0 wood-background w-100"></div>
<div class="d-block d-xl-none hot-news-position position-relative bottom-left-shadow mx-auto">
<div class="line-border-small bg-white">
@include('fo.partials.hot-news')
</div>
</div>
</div>
{{-- RANGES/PRODUCTS --}}
@ -122,18 +133,18 @@
<div class="col-12">
@php
$data = [
'legendModels' => $rangeModels ?? [],
'legendImages' => true,
'legendField' => 'label',
'legendModels' => $rangeModels ?? [],
'legendImages' => true,
'legendField' => 'label',
'routeBtnIndex' => 'fo.products.index',
'routeBtnShow' => 'fo.products.search.range',
'routeAjax' => 'fo.home.products',
'contentViews' => $productViews,
'routeBtnShow' => 'fo.products.search.range',
'routeAjax' => 'fo.home.products',
'contentViews' => $productViews,
'contentSwiper' => true,
'texts' => [
'texts' => [
'helperNoItems' => __('Aucun produits disponibles dans cette gammes'),
'btn1Label' => str(__('découvrir tous les produits'))->upper(),
'btn2Label' => str(__('découvrir tous nos produits'))->upper(),
'btn1Label' => str(__('découvrir tous les produits'))->upper(),
'btn2Label' => str(__('découvrir tous nos produits'))->upper(),
],
];
@endphp
@ -154,9 +165,11 @@
<div class="swiper-wrapper w-fit">
@foreach ($demarcheSlideModels as $demarcheSlideModel)
<div class="swiper-slide position-relative p-lg-5 pb-lg-0 h-auto overflow-hidden p-0">
<div class="slide-background line-border-medium position-absolute start-50 translate-middle-x w-100">
<div
class="slide-background line-border-medium position-absolute start-50 translate-middle-x w-100">
<img src="{{ Vite::asset('resources/assets/images/home/bg-demarche-slider.jpg') }}"
title="{{ __('Image de fond du carrousel') }}" alt="{{ __('Paysage de champs') }}">
title="{{ __('Image de fond du carrousel') }}"
alt="{{ __('Paysage de champs') }}">
</div>
<div class="h-100 container">
<div class="slide-card position-relative h-100">
@ -168,9 +181,13 @@
alt="#FIXME:alt de l'image de la démarche">
</a>
<div class="slide-content position-relative pt-lg-0 pt-2">
<div class="line-border-medium bg-light position-absolute w-100 h-100 start-0 top-0"></div>
<div
class="line-border-medium bg-light position-absolute w-100 h-100 start-0 top-0">
</div>
<div class="slide-content-texts position-relative z-1 p-lg-5 p-3">
<h2 class="text-secondary fs-2">{{ $demarcheSlideModel->title }}</h2>
<h2 class="text-secondary fs-2">
{{ $demarcheSlideModel->title }}
</h2>
<div class="ck-editor">{!! clean($demarcheSlideModel->text) !!}</div>
</div>
<div
@ -199,12 +216,14 @@
<button
class="swiper-button swiper-button-prev-custom swiper-demarche-button-prev rounded-circle z-1 mx-3 border-0 bg-white">
<img src="{{ Vite::asset('resources/assets/images/common/arrow-brown.svg') }}"
title="{{ __('Navigation du slider (gauche)') }}" alt="{{ __('flèche vers la gauche') }}">
title="{{ __('Navigation du slider (gauche)') }}"
alt="{{ __('flèche vers la gauche') }}">
</button>
<button
class="swiper-button swiper-button-next-custom swiper-demarche-button-next rounded-circle z-1 mx-3 border-0 bg-white">
<img src="{{ Vite::asset('resources/assets/images/common/arrow-brown.svg') }}"
title="{{ __('Navigation du slider (droite)') }}" alt="{{ __('flèche vers la droite') }}">
title="{{ __('Navigation du slider (droite)') }}"
alt="{{ __('flèche vers la droite') }}">
</button>
</div>
</div>
@ -261,9 +280,11 @@
<div class="d-md-none">
@foreach ($newsModels->slice(1, 3) as $newsModel)
<li>
<a class="text-decoration-none" href="{{ route('fo.news.show', $newsModel->slug) }}"
<a class="text-decoration-none"
href="{{ route('fo.news.show', $newsModel->slug) }}"
title="{{ __('Voir l\'article :name', ['name' => $newsModel->title]) }}">
<p class="f-bakerie-rough mb-0">{{ now()->subDays(rand(1, 31))->format('d/m/Y') }}</p>
<p class="f-bakerie-rough mb-0">
{{ now()->subDays(rand(1, 31))->format('d/m/Y') }}</p>
<p>{{ $newsModel->title }}</p>
</a>
</li>
@ -271,9 +292,11 @@
</div>
@foreach ($newsModels->slice(4, count($newsModels)) as $newsModel)
<li>
<a class="text-decoration-none" href="{{ route('fo.news.show', $newsModel->slug) }}"
<a class="text-decoration-none"
href="{{ route('fo.news.show', $newsModel->slug) }}"
title="{{ __('Voir l\'article :name', ['name' => $newsModel->title]) }}">
<p class="f-bakerie-rough mb-0">{{ now()->subDays(rand(1, 31))->format('d/m/Y') }}</p>
<p class="f-bakerie-rough mb-0">
{{ now()->subDays(rand(1, 31))->format('d/m/Y') }}</p>
<p>{{ $newsModel->title }}</p>
</a>
</li>
@ -286,7 +309,8 @@
'justify-content-md-end' => $newsModels->slice(4, count($newsModels))->isNotEmpty(),
])>
<div>
<a class="btn btn-secondary" href="{{ route('fo.news.index') }}" title="{{ __('Voir toute l\'actualité') }}">
<a class="btn btn-secondary" href="{{ route('fo.news.index') }}"
title="{{ __('Voir toute l\'actualité') }}">
{{ __('Voir toute l\'actualité') }}
</a>
</div>

View file

@ -8,12 +8,12 @@
{{-- HEADER --}}
@include('fo.layouts.header-banner')
{{-- MAIN CONTENT --}}
<section id="video-section" class="position-relative bg-light line-border-large overflow-hidden pt-5">
<section class="position-relative bg-light line-border-large overflow-hidden pt-5" id="video-section">
<div class="bg-white-wood-full">
<div class="container">
<div class="row mb-5 mt-4 align-items-center">
@include('fo.pages.news.toggleButton')
<div class="row mb-2 justify-content-center">
<div class="row align-items-center mb-5 mt-4">
{{-- @include('fo.pages.news.toggleButton') --}}
<div class="row justify-content-center mb-2">
<div class="col-12 col-md-10 col-lg-8 ck-content">
{!! clean($staticPageModel->content) !!}
</div>
@ -21,22 +21,22 @@
<div class="row">
@php
$data = [
'legendModels' => $newsCategories ?? [],
'legendImages' => false,
'legendField' => 'title',
'routeAjax' => 'fo.news.filtered',
'contentViews' => $newsViews,
'contentSwiper' => false,
'legendModels' => $newsCategories ?? [],
'legendImages' => false,
'legendField' => 'title',
'routeAjax' => 'fo.news.filtered',
'contentViews' => $newsViews,
'contentSwiper' => false,
'legendFakeFirst' => __('Toutes les actus'),
'texts' => [
'helperNoItems' => __('Aucune actualités disponibles dans cette catégorie'),
'texts' => [
'helperNoItems' => __('Aucune actualités disponibles dans cette catégorie'),
'helperAllItems' => __('Toutes les actualités ont été chargées'),
],
];
@endphp
<div class="filter-cards" data-json='@json($data)'></div>
<div class="filter-cards" data-json='@json($data)'></div>
</div>
</div>
</div>
</div>
</section>
@endsection

View file

@ -293,8 +293,10 @@
@include('fo.partials.commitments.list-pages', [
'showBtn' => false,
])
<img class="line-border-large w-100" src="{{ asset($productModel->banner) }}"
title="{{ $productModel->banner_title }}" alt="{{ $productModel->banner_alt }}">
<img class="line-border-large w-100"
src="{{ asset($productModel->banner ? $productModel->banner : ($productModel->range ? $productModel->range->banner_ambiance : $productModel->subrange->range->banner_ambiance)) }}"
title="{{ $productModel->banner_title ? $productModel->banner_title : ($productModel->range ? $productModel->range->banner_ambiance_title : $productModel->subrange->range->banner_ambiance_title) }}"
alt="{{ $productModel->banner_alt ? $productModel->banner_alt : ($productModel->range ? $productModel->range->banner_ambiance_alt : $productModel->subrange->range->banner_ambiance_alt) }}">
</div>
</section>
{{-- PRODUCT ANIMATION --}}

View file

@ -115,13 +115,15 @@
{{ sprintf('%s de préparation', $recipeModel->convertTime($recipeModel->preparation_time)) }}
</p>
</li>
<li class="d-flex justify-content-center align-items-center me-md-4 my-2 w-fit">
<img src="{{ Vite::asset('resources/assets/images/recipe/cooking_time.svg') }}"
title="{{ __('Icône du temps de cuisson') }}" alt="{{ __('Soupière') }}">
<p class="f-bourton-base text-bg-secondary m-0 mx-2">
{{ sprintf('%s de cuisson', $recipeModel->convertTime($recipeModel->cooking_time)) }}
</p>
</li>
@if ($recipeModel->cooking_time > 0)
<li class="d-flex justify-content-center align-items-center me-md-4 my-2 w-fit">
<img src="{{ Vite::asset('resources/assets/images/recipe/cooking_time.svg') }}"
title="{{ __('Icône du temps de cuisson') }}" alt="{{ __('Soupière') }}">
<p class="f-bourton-base text-bg-secondary m-0 mx-2">
{{ sprintf('%s de cuisson', $recipeModel->convertTime($recipeModel->cooking_time)) }}
</p>
</li>
@endif
<li class="d-flex justify-content-center align-items-center my-2 w-fit">
<img src="{{ Vite::asset('resources/assets/images/recipe/difficulty.svg') }}"
title="{{ __('Icône de difficulté') }}" alt="{{ __('Toque') }}">

View file

@ -129,6 +129,24 @@
</div>
</div>
</section>
{{-- Video Modal --}}
<div class="modal fade translate-middle top-50 start-50" id="testimonial-video-modal" aria-labelledby="testimonialVideoModalLabel"
aria-hidden="true" tabindex="-1">
<div class="modal-dialog modal-lg modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<button class="btn-close" data-bs-dismiss="modal" type="button" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="video-inlaid ratio ratio-16x9" type="youtube"
href="https://www.youtube.com/embed/{{ $testimonialModels->first()->video_id }}"></div>
</div>
<div class="modal-footer">
<button class="btn btn-secondary" data-bs-dismiss="modal" type="button">{{ __('Fermer') }}</button>
</div>
</div>
</div>
</div>
@endif
{{-- ADVANTAGES --}}
<section class="joinus mb-3" id="recruitment-advantages">

View file

@ -1,26 +1,40 @@
<div class="container-fluid hot-news-content pt-3">
@foreach($newsModels->filter(fn ($newsModel) => $newsModel->highlight) as $newsModel)
<a class="text-decoration-none" href="{{ route('fo.news.show', $newsModel->slug) }}" title="{{ __('Accéder à l\'article : :name', ['name' => $newsModel->title]) }}">
<div class="row pt-2">
<div class="col-6 d-flex align-items-center justify-content-center">
<img class="img-fluid w-100" src="{{ asset($newsModel->thumbnail) }}" alt="{{ $newsModel->thumbnail_alt }}" title="{{ $newsModel->thumbnail_title }}">
<div class="container-fluid hot-news-content overflow-y-auto pb-3 py-xl-0">
<div class="row flex-column flex-sm-row flex-xl-column align-items-center w-100 mx-auto gx-0 gx-sm-4 gx-xl-0">
@php $highlightNewsModels = $newsModels->filter(fn($newsModel) => $newsModel->highlight); @endphp
@foreach ($highlightNewsModels as $newsModel)
<div @class(["col-12 col-sm-6 col-xl-12 border-custom py-3", ($highlightNewsModels->count() === 2) ? "col-md-4" : "col-md-6"])>
<a class="text-decoration-none" href="{{ route('fo.news.show', $newsModel->slug) }}"
title="{{ __('Accéder à l\'article : :name', ['name' => $newsModel->title]) }}">
<div class="row w-100 mx-auto">
<div class="col-6 d-flex align-items-center justify-content-center ps-0 pe-2">
<img class="img-fluid w-100" src="{{ asset($newsModel->thumbnail) }}"
alt="{{ $newsModel->thumbnail_alt }}" title="{{ $newsModel->thumbnail_title }}">
</div>
<div class="col-6 d-flex flex-column justify-content-center align-items-start ps-2 pe-0">
<div class="mb-1">
<span class="text-bg-quad px-2 py-1 f-bourton-base">
{{ $newsModel->newsCategory->title }}
</span>
</div>
<div>{{ str($newsModel->title)->limit(50) }}</div>
</div>
</div>
</a>
</div>
<div class="col-6">
<div class="mb-1"><span class="text-bg-quad px-1 f-bourton-base">{{ $newsModel->newsCategory->title }}</span></div>
<div>{{ str($newsModel->title)->limit(50) }}</div>
@endforeach
<div @class(["col-12 col-sm-6 col-xl-12", ($highlightNewsModels->count() === 2) ? "col-md-4 mx-auto" : "col-md-6"])>
<div class="rotate-left-5 f-bakerie-rough fs-4 fw-bolder px-0">
{!! clean($hotNewsSettings->value['text']) !!}
</div>
<div class="text-center">
<img class="w-100" src="{{ asset($hotNewsSettings->value['picture']) }}"
alt="{{ $hotNewsSettings->value['picture_alt'] }}"
title="{{ $hotNewsSettings->value['picture_title'] }}">
<div class="f-bourton-base bg-danger text-bg-danger px-2 py-1">
<span>@money($discountsTotal * 100)</span>
{{ __(' d\'économie') }}
</div>
</div>
</div>
</a>
<hr>
@endforeach
<div class="row">
<div class="col-6 rotate-left-5 f-bakerie-rough fs-4 fw-bolder">
{!! clean($hotNewsSettings->value['text']) !!}
</div>
</div>
<div class="row py-2">
<div class="col-12 text-center">
<img class="img-fluid" src="{{ asset($hotNewsSettings->value['picture']) }}" alt="{{ $hotNewsSettings->value['picture_alt'] }}" title="{{ $hotNewsSettings->value['picture_title'] }}">
</div>
</div>
</div>

View file

@ -24,11 +24,13 @@
title="{{ __('Icône du temps de préparation') }}" alt="{{ __('Horloge') }}" />
{{ $model->convertTime($model->preparation_time) }}
</p>
<p class="text-uppercase fs-5 f-bourton-base">
<img src="{{ Vite::asset('resources/assets/images/recipes/cooking-pot.svg') }}"
title="{{ __('Icône du temps de cuisson') }}" alt="{{ __('Soupière') }}" />
{{ $model->convertTime($model->cooking_time) }}
</p>
@if ($model->cooking_time)
<p class="text-uppercase fs-5 f-bourton-base">
<img src="{{ Vite::asset('resources/assets/images/recipes/cooking-pot.svg') }}"
title="{{ __('Icône du temps de cuisson') }}" alt="{{ __('Soupière') }}" />
{{ $model->convertTime($model->cooking_time) }}
</p>
@endif
<p class="text-uppercase fs-5 f-bourton-base">
<img src="{{ Vite::asset('resources/assets/images/recipes/toque.svg') }}" title="{{ __('Icône de difficulté') }}"
alt="{{ __('Toque') }}" />

View file

@ -1,12 +1,20 @@
<div class="testimonial-card bottom-left-shadow h-100 w-lg-75 ms-lg-auto">
<div class="position-relative d-flex justify-content-center testimonial-img-wrapper">
<div class="line-border-small w-fit bg-white p-2">
@if (!empty($model->video_id))
<a class="video-link" data-bs-toggle="modal" data-bs-target="#testimonial-video-modal"
data-video-link="https://www.youtube.com/embed/{{ $model->video_id }}">
<i class="fa-solid fa-xl fa-play position-absolute z-1 rounded-circle translate-middle top-50 start-50 bg-white p-3"></i>
@endif
<img class="w-100 line-border-medium testimonial-img" src="{{ asset($model->picture) }}" title="{{ $model->picture_title }}"
alt="{{ $model->picture_alt }}" />
@if (!empty($model->video_id))
</a>
@endif
</div>
</div>
<div
class="line-border-medium position-relative d-flex flex-column testimonial-card-bottom-part px-lg-5 px-lg-4 pb-lg-4 bg-light px-3 pt-4">
class="line-border-medium position-relative d-flex flex-column testimonial-card-bottom-part px-lg-5 px-lg-4 pb-lg-4 bg-light h-lg-100 px-3 pt-4">
<p class="text-uppercase fs-3 f-bourton-base mb-1">
{{ $model->identity }}
</p>