Merge branch 'develop' into trunk
This commit is contained in:
commit
c8ac89ca3a
7 changed files with 183 additions and 92 deletions
|
|
@ -28,8 +28,9 @@ class StoreSiteRequest extends FormRequest
|
|||
protected function prepareForValidation(): void
|
||||
{
|
||||
$this->merge([
|
||||
'published' => $this->boolean('published'),
|
||||
'pictos' => \collect($this->input('pictos'))->all(),
|
||||
'published' => $this->boolean('published'),
|
||||
'invert_director_block' => $this->boolean('invert_director_block'),
|
||||
'pictos' => \collect($this->input('pictos'))->all(),
|
||||
]);
|
||||
$this->mergePicture('logo');
|
||||
$this->mergePicture('picture_1');
|
||||
|
|
@ -45,40 +46,38 @@ class StoreSiteRequest extends FormRequest
|
|||
public function rules(): array
|
||||
{
|
||||
$rules = [
|
||||
'seo_title' => 'required|between:45,70',
|
||||
'seo_description' => 'required|between:50,160',
|
||||
'name' => 'required|string|between:3,100',
|
||||
'description' => 'required|string|between:3,255',
|
||||
'description_2' => 'nullable|string|between:3,255',
|
||||
'employees' => 'required|numeric|min:0',
|
||||
'pictos' => 'present|array',
|
||||
'pictos.*' => 'required|integer',
|
||||
'address' => 'required|string|between:3,255',
|
||||
'phone_number' => 'required|string|between:10,20',
|
||||
'access_line' => 'present|array',
|
||||
'access_line.*' => 'nullable|string|between:3,255',
|
||||
'director_name' => 'nullable|string|between:3,255',
|
||||
'director_speach' => 'required|string|min:15',
|
||||
'employee_name' => 'nullable|string|between:3,255',
|
||||
'employee_function' => 'nullable|string|between:3,255',
|
||||
'employee_speach' => 'nullable|string|min:15',
|
||||
'highlights' => 'nullable|string|min:15',
|
||||
'latitude' => 'required|numeric|between:-90,90',
|
||||
'longitude' => 'required|numeric|between:-180,180',
|
||||
'sticky_title' => 'required_with:sticky_link|nullable|string|between:3,255',
|
||||
'sticky_link' => 'required_with:sticky_title|nullable|string|between:3,255',
|
||||
'logo_alt' => 'required|string|between:3,255',
|
||||
'logo_title' => 'required|string|between:3,255',
|
||||
'picture_1_alt' => 'required|string|between:3,255',
|
||||
'picture_1_title' => 'required|string|between:3,255',
|
||||
'picture_2_alt' => 'required_with:picture_2|nullable|string|between:3,255',
|
||||
'picture_2_title' => 'required_with:picture_2|nullable|string|between:3,255',
|
||||
'picture_3_alt' => 'required_with:picture_3|nullable|string|between:3,255',
|
||||
'picture_3_title' => 'required_with:picture_3|nullable|string|between:3,255',
|
||||
'logos' => 'nullable|array',
|
||||
'logos.*.id' => 'required|exists:logos,id',
|
||||
|
||||
|
||||
'seo_title' => 'required|between:45,70',
|
||||
'seo_description' => 'required|between:50,160',
|
||||
'name' => 'required|string|between:3,100',
|
||||
'description' => 'required|string|between:3,255',
|
||||
'description_2' => 'nullable|string|between:3,255',
|
||||
'employees' => 'required|numeric|min:0',
|
||||
'pictos' => 'present|array',
|
||||
'pictos.*' => 'required|integer',
|
||||
'address' => 'required|string|between:3,255',
|
||||
'phone_number' => 'required|string|between:10,20',
|
||||
'access_line' => 'present|array',
|
||||
'access_line.*' => 'nullable|string|between:3,255',
|
||||
'director_name' => 'required|string|between:3,255',
|
||||
'director_function' => 'required|string|between:3,255',
|
||||
'director_speach' => 'required|string|min:15',
|
||||
'invert_director_block' => 'required|boolean',
|
||||
'employee_name' => 'nullable|string|between:3,255',
|
||||
'employee_function' => 'nullable|string|between:3,255',
|
||||
'employee_speach' => 'nullable|string|min:15',
|
||||
'highlights' => 'nullable|string|min:15',
|
||||
'latitude' => 'required|numeric|between:-90,90',
|
||||
'longitude' => 'required|numeric|between:-180,180',
|
||||
'logo_alt' => 'required|string|between:3,255',
|
||||
'logo_title' => 'required|string|between:3,255',
|
||||
'picture_1_alt' => 'required|string|between:3,255',
|
||||
'picture_1_title' => 'required|string|between:3,255',
|
||||
'picture_2_alt' => 'required_with:picture_2|nullable|string|between:3,255',
|
||||
'picture_2_title' => 'required_with:picture_2|nullable|string|between:3,255',
|
||||
'picture_3_alt' => 'required_with:picture_3|nullable|string|between:3,255',
|
||||
'picture_3_title' => 'required_with:picture_3|nullable|string|between:3,255',
|
||||
'logos' => 'nullable|array',
|
||||
'logos.*.id' => 'required|exists:logos,id',
|
||||
];
|
||||
return \array_merge(
|
||||
$rules,
|
||||
|
|
@ -97,31 +96,31 @@ class StoreSiteRequest extends FormRequest
|
|||
public function attributes(): array
|
||||
{
|
||||
return [
|
||||
'seo_title' => trans('validation.custom.seo_title'),
|
||||
'seo_description' => trans('validation.custom.seo_description'),
|
||||
'name' => trans('validation.attributes.name'),
|
||||
'description' => trans('validation.custom.description'),
|
||||
'description_2' => trans('validation.custom.description_2'),
|
||||
'employees' => trans('validation.custom.employees_count'),
|
||||
'pictos' => Str::plural(trans('validation.custom.picto')),
|
||||
'pictos.*' => trans('validation.custom.picto'),
|
||||
'address' => trans('validation.attributes.address'),
|
||||
'phone_number' => trans('validation.attributes.phone'),
|
||||
'access_line' => trans('validation.custom.access_line'),
|
||||
'access_line.*' => trans('ligne d\'accès au site'),
|
||||
'director_name' => trans('validation.custom.director_name'),
|
||||
'director_speach' => trans('validation.custom.director_speach'),
|
||||
'employee_name' => trans('validation.custom.employee_name'),
|
||||
'employee_function' => trans('validation.custom.employee_function'),
|
||||
'employee_speach' => trans('validation.custom.employee_speach'),
|
||||
'highlights' => Str::plural(trans('validation.custom.highlight')),
|
||||
'latitude' => trans('validation.custom.latitude'),
|
||||
'longitude' => trans('validation.custom.longitude'),
|
||||
'sticky_title' => trans('validation.custom.sticky_item.title'),
|
||||
'sticky_link' => trans('validation.custom.sticky_item.link'),
|
||||
'logos' => Str::plural(trans('models.classes.logo')),
|
||||
'logos.*' => trans('models.classes.logo'),
|
||||
'logo_alt' => trans(':field :inter:model', [
|
||||
'seo_title' => trans('validation.custom.seo_title'),
|
||||
'seo_description' => trans('validation.custom.seo_description'),
|
||||
'name' => trans('validation.attributes.name'),
|
||||
'description' => trans('validation.custom.description'),
|
||||
'description_2' => trans('validation.custom.description_2'),
|
||||
'employees' => trans('validation.custom.employees_count'),
|
||||
'pictos' => Str::plural(trans('validation.custom.picto')),
|
||||
'pictos.*' => trans('validation.custom.picto'),
|
||||
'address' => trans('validation.attributes.address'),
|
||||
'phone_number' => trans('validation.attributes.phone'),
|
||||
'access_line' => trans('validation.custom.access_line'),
|
||||
'access_line.*' => trans('ligne d\'accès au site'),
|
||||
'director_name' => trans('validation.custom.director_name'),
|
||||
'director_function' => trans('validation.custom.director_function'),
|
||||
'director_speach' => trans('validation.custom.director_speach'),
|
||||
'invert_director_block' => trans('validation.custom.invert_block'),
|
||||
'employee_name' => trans('validation.custom.employee_name'),
|
||||
'employee_function' => trans('validation.custom.employee_function'),
|
||||
'employee_speach' => trans('validation.custom.employee_speach'),
|
||||
'highlights' => Str::plural(trans('validation.custom.highlight')),
|
||||
'latitude' => trans('validation.custom.latitude'),
|
||||
'longitude' => trans('validation.custom.longitude'),
|
||||
'logos' => Str::plural(trans('models.classes.logo')),
|
||||
'logos.*' => trans('models.classes.logo'),
|
||||
'logo_alt' => trans(':field :inter:model', [
|
||||
'field' => trans('validation.custom.alt_attribute'),
|
||||
'inter' => trans('validation.custom.of_the.male'),
|
||||
'model' => trans('validation.custom.logo'),
|
||||
|
|
|
|||
|
|
@ -74,7 +74,9 @@ class Site extends Model implements Sitemapable
|
|||
'phone_number',
|
||||
'access_line',
|
||||
'director_name',
|
||||
'director_function',
|
||||
'director_speach',
|
||||
'invert_director_block',
|
||||
'employee_name',
|
||||
'employee_function',
|
||||
'employee_speach',
|
||||
|
|
@ -104,8 +106,9 @@ class Site extends Model implements Sitemapable
|
|||
* @var array<string, string>
|
||||
*/
|
||||
protected $casts = [
|
||||
'pictos' => 'array',
|
||||
'access_line' => 'array',
|
||||
'pictos' => 'array',
|
||||
'access_line' => 'array',
|
||||
'invert_director_block' => 'boolean'
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -18,37 +18,39 @@ class SiteFactory extends Factory
|
|||
$name = fake()->text(100);
|
||||
$pictos = \collect(SpeciesEnum::cases());
|
||||
return [
|
||||
'seo_title' => fake()->text(70),
|
||||
'seo_description' => fake()->text(160),
|
||||
'name' => $name,
|
||||
'slug' => Str::slug($name),
|
||||
'description' => fake()->text(35),
|
||||
'description_2' => fake()->text(35),
|
||||
'employees' => fake()->randomNumber(),
|
||||
'pictos' => $pictos->random(rand(0, $pictos->count())),
|
||||
'address' => fake()->address(),
|
||||
'phone_number' => fake()->phoneNumber(),
|
||||
'access_line' => [
|
||||
'seo_title' => fake()->text(70),
|
||||
'seo_description' => fake()->text(160),
|
||||
'name' => $name,
|
||||
'slug' => Str::slug($name),
|
||||
'description' => fake()->text(35),
|
||||
'description_2' => fake()->text(35),
|
||||
'employees' => fake()->randomNumber(),
|
||||
'pictos' => $pictos->random(rand(0, $pictos->count())),
|
||||
'address' => fake()->address(),
|
||||
'phone_number' => fake()->phoneNumber(),
|
||||
'access_line' => [
|
||||
fake()->sentence(),
|
||||
fake()->sentence(),
|
||||
fake()->sentence(),
|
||||
],
|
||||
'director_name' => fake()->name(),
|
||||
'director_speach' => \clean(\fake()->randomHtml()),
|
||||
'employee_name' => fake()->name(),
|
||||
'employee_function' => fake()->jobTitle(),
|
||||
'employee_speach' => \clean(\fake()->randomHtml()),
|
||||
'highlights' => \clean(\fake()->randomHtml()),
|
||||
'latitude' => fake()->latitude(),
|
||||
'longitude' => fake()->longitude(),
|
||||
'logo_alt' => fake()->sentence(),
|
||||
'logo_title' => fake()->sentence(),
|
||||
'picture_1_alt' => fake()->sentence(),
|
||||
'picture_1_title' => fake()->sentence(),
|
||||
'picture_2_alt' => fake()->sentence(),
|
||||
'picture_2_title' => fake()->sentence(),
|
||||
'picture_3_alt' => fake()->sentence(),
|
||||
'picture_3_title' => fake()->sentence(),
|
||||
'director_name' => fake()->name(),
|
||||
'director_function' => fake()->jobTitle(),
|
||||
'director_speach' => \clean(\fake()->randomHtml()),
|
||||
'invert_director_block' => fake()->boolean(),
|
||||
'employee_name' => fake()->name(),
|
||||
'employee_function' => fake()->jobTitle(),
|
||||
'employee_speach' => \clean(\fake()->randomHtml()),
|
||||
'highlights' => \clean(\fake()->randomHtml()),
|
||||
'latitude' => fake()->latitude(),
|
||||
'longitude' => fake()->longitude(),
|
||||
'logo_alt' => fake()->sentence(),
|
||||
'logo_title' => fake()->sentence(),
|
||||
'picture_1_alt' => fake()->sentence(),
|
||||
'picture_1_title' => fake()->sentence(),
|
||||
'picture_2_alt' => fake()->sentence(),
|
||||
'picture_2_title' => fake()->sentence(),
|
||||
'picture_3_alt' => fake()->sentence(),
|
||||
'picture_3_title' => fake()->sentence(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
30
database/migrations/2026_03_04_113259_alter_sites_table.php
Normal file
30
database/migrations/2026_03_04_113259_alter_sites_table.php
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?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('sites', function (Blueprint $table) {
|
||||
$table->string('director_function')->comment('Fonction du directeur associé au speach')->after('director_name');
|
||||
$table->boolean('invert_director_block')->default(false)->comment('Inverser le bloc directeur et employé')->after('director_speach');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('sites', function (Blueprint $table) {
|
||||
$table->dropColumn('director_function');
|
||||
$table->dropColumn('invert_director_block');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -249,7 +249,9 @@ return [
|
|||
'description' => 'description',
|
||||
'displayed_date' => 'date affichée',
|
||||
'director_name' => 'nom du directeur',
|
||||
'director_function' => 'fonction du directeur',
|
||||
'director_speach' => 'mot du directeur',
|
||||
'invert_block' => 'inverser le bloc',
|
||||
'employee_function' => 'fonction de l\'employé',
|
||||
'employee_name' => 'nom de l\'employé',
|
||||
'employee_speach' => 'mot de l\'employé',
|
||||
|
|
|
|||
|
|
@ -371,6 +371,35 @@
|
|||
]),
|
||||
])
|
||||
</div>
|
||||
{{-- DIRECTOR_FUNCTION --}}
|
||||
<div class="col-12 col-md-6 m-md-0 mb-3">
|
||||
@include('bo.partials.inputs.varchar', [
|
||||
'id' => 'siteDirectorFunction',
|
||||
'label' => __(':field :inter:model', [
|
||||
'field' => Str::ucfirst(__('validation.custom.director_function')),
|
||||
'inter' => __('validation.custom.of_the.male'),
|
||||
'model' => trans_choice('models.classes.site', 1),
|
||||
]),
|
||||
'hasWordCounter' => true,
|
||||
'name' => 'director_function',
|
||||
'required' => true,
|
||||
'model' => $siteModel ?? null,
|
||||
'helper' => __('validation.between.string', [
|
||||
'attribute' => __(':field :inter:model', [
|
||||
'field' => __('validation.custom.director_function'),
|
||||
'inter' => __('validation.custom.of_the.male'),
|
||||
'model' => trans_choice('models.classes.site', 1),
|
||||
]),
|
||||
'min' => 3,
|
||||
'max' => 255,
|
||||
]),
|
||||
'placeholder' => __(':field :inter:model', [
|
||||
'field' => Str::ucfirst(__('validation.custom.director_function')),
|
||||
'inter' => __('validation.custom.of_the.male'),
|
||||
'model' => trans_choice('models.classes.site', 1),
|
||||
]),
|
||||
])
|
||||
</div>
|
||||
{{-- DIRECTOR_SPEACH --}}
|
||||
<div class="col-12 m-md-0 mb-3">
|
||||
@include('bo.partials.inputs.text-html', [
|
||||
|
|
@ -389,6 +418,29 @@
|
|||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
{{-- INVERT_DIRECTOR_BLOCK --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="h-100 border p-3">
|
||||
<legend>{{ Str::ucfirst(__('validation.custom.invert_block')) }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@include('bo.partials.inputs.tinyint-boolean', [
|
||||
'id' => 'siteDirectorInvertBlock',
|
||||
'name' => 'invert_director_block',
|
||||
'model' => $siteModel ?? null,
|
||||
'label' => __(':field :inter:model', [
|
||||
'field' => Str::ucfirst(__('validation.custom.invert_block')),
|
||||
'inter' => __('validation.custom.of_the.male'),
|
||||
'model' => __('validation.custom.director_speach'),
|
||||
]),
|
||||
'helper' => __('Cocher pour :field', [
|
||||
'field' => __('validation.custom.invert_block'),
|
||||
]),
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
{{-- EMPLOYEE PART --}}
|
||||
<div class="col-12 pb-3">
|
||||
<fieldset class="h-100 border p-3">
|
||||
|
|
|
|||
|
|
@ -186,9 +186,12 @@
|
|||
<div class="col-12 position-relative">
|
||||
<div class="swiper swiper-sites-words mt-lg-0 mt-5 h-fit overflow-visible" id="swiper-sites-words">
|
||||
<div class="swiper-wrapper h-fit">
|
||||
<div class="swiper-slide h-auto">
|
||||
<div @class([
|
||||
'swiper-slide h-auto',
|
||||
'order-1' => $siteModel->invert_director_block
|
||||
])>
|
||||
@include('fo.partials.testimonials.card', [
|
||||
'job' => __('Directeur du site'),
|
||||
'job' => $siteModel->director_function,
|
||||
'name' => $siteModel->director_name,
|
||||
'speach' => $siteModel->director_speach,
|
||||
'bgClass' => 'bg-primary',
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue