diff --git a/app/Enums/StaticPageType.php b/app/Enums/StaticPageType.php
index ce0664e..afb8f08 100644
--- a/app/Enums/StaticPageType.php
+++ b/app/Enums/StaticPageType.php
@@ -59,20 +59,22 @@ enum StaticPageType: int
* Does the static page need to fill its 'content' column ?
*
* @return boolean
+ * @phpcs:disable Generic.Metrics.CyclomaticComplexity.TooHigh
*/
public function containsContent(): bool
{
+ // @phpcs:enable
return match ($this) {
- self::contact,
- self::legals,
+ self::contact => false,
+ self::legals => false,
self::confidentiality => true,
- self::home,
- self::unveil,
- self::we_hire,
- self::we_commit,
- self::we_move,
- self::we_produce,
- self::we_listen => false,
+ self::home => false,
+ self::unveil => false,
+ self::we_hire => false,
+ self::we_commit => false,
+ self::we_move => false,
+ self::we_produce => false,
+ self::we_listen => true,
};
}
}
diff --git a/app/Http/Requests/Bo/StaticPages/UpdateStaticPageRequest.php b/app/Http/Requests/Bo/StaticPages/UpdateStaticPageRequest.php
index ebb0746..ab3786b 100644
--- a/app/Http/Requests/Bo/StaticPages/UpdateStaticPageRequest.php
+++ b/app/Http/Requests/Bo/StaticPages/UpdateStaticPageRequest.php
@@ -26,7 +26,9 @@ class UpdateStaticPageRequest extends FormRequest
public function prepareForValidation(): void
{
$this->merge([
- 'content' => Str::of($this->input('content'))->value()
+ 'content' => (empty(Str::of($this->input('content'))->value())) ?
+ null :
+ Str::of($this->input('content'))->value()
]);
}
@@ -37,12 +39,16 @@ 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',
- 'content' => 'present',
+ 'content' => 'sometimes|nullable',
];
+ if (request()->route()->parameters()['static_page']->type->containsContent()) {
+ $rules = array_merge($rules, ['content' => 'required|string|min:15']);
+ }
+ return $rules;
}
/**
diff --git a/app/Mail/SendConfirmationMail.php b/app/Mail/SendConfirmationMail.php
index 63fb839..a7b8797 100644
--- a/app/Mail/SendConfirmationMail.php
+++ b/app/Mail/SendConfirmationMail.php
@@ -18,7 +18,7 @@ class SendConfirmationMail extends Mailable
use SerializesModels;
/**
- * @var \App\Mail\Contact
+ * @var \stdClass
*/
private \stdClass $data;
@@ -89,24 +89,3 @@ class SendConfirmationMail extends Mailable
);
}
}
-
-/**
- * @property \App\Enums\Contact\ObjectEnum $type
- * @property string|null $first_name
- * @property string $last_name
- * @property string|null $phone
- * @property string $email
- * @property string|null $address
- * @property string|null $city
- * @property string|null $postal_code
- * @property string $message
- * @property boolean $terms
- * @property \Illuminate\Http\UploadedFile|null $file
- * @property \App\Models\Product|null $product
- * @property \Carbon\Carbon|null $expiration_date
- * @property integer|null $batch_number
- * @phpcs:disable PSR1.Classes.ClassDeclaration.MultipleClasses
- */
-class ContactConfirmation extends \stdClass
-{
-}
diff --git a/app/Mail/SendContactMail.php b/app/Mail/SendContactMail.php
index f667e26..6d22619 100644
--- a/app/Mail/SendContactMail.php
+++ b/app/Mail/SendContactMail.php
@@ -20,7 +20,7 @@ class SendContactMail extends Mailable
use SerializesModels;
/**
- * @var \App\Mail\Contact
+ * @var \stdClass
*/
private \stdClass $data;
@@ -49,7 +49,6 @@ class SendContactMail extends Mailable
*/
private function sanitizeStringInputs(): void
{
- // @phpstan-ignore-next-line
$this->data = (object)Arr::map((array)$this->data, function ($el) {
if (is_string($el)) {
$el = \htmlspecialchars(\strip_tags(Blade::render(
@@ -109,24 +108,3 @@ class SendContactMail extends Mailable
return $attachments;
}
}
-
-/**
- * @property \App\Enums\Contact\ObjectEnum $type
- * @property string|null $first_name
- * @property string $last_name
- * @property string|null $phone
- * @property string $email
- * @property string|null $address
- * @property string|null $city
- * @property string|null $postal_code
- * @property string $message
- * @property boolean $terms
- * @property \Illuminate\Http\UploadedFile|null $file
- * @property \App\Models\Product|null $product
- * @property \Carbon\Carbon|null $expiration_date
- * @property integer|null $batch_number
- * @phpcs:disable PSR1.Classes.ClassDeclaration.MultipleClasses
- */
-class Contact extends \stdClass
-{
-}
diff --git a/app/Models/ActivityLog.php b/app/Models/ActivityLog.php
index e421ecd..a49799f 100644
--- a/app/Models/ActivityLog.php
+++ b/app/Models/ActivityLog.php
@@ -13,7 +13,7 @@ use Illuminate\Support\Str;
* @property string $model_id Id of the target model.
* @property \App\Enums\ActivityLogs\ActivityLogsEventEnum $event Event of this activity (ActivityLogsEventEnum).
* @property array $data Changes.
- * @property-read \Illuminate\Support\Carbon $created_at Created date.
+ * @property \Illuminate\Support\Carbon $created_at Created date.
*
* @property-read \App\Models\User $user User BelongsTo relation.
*/
diff --git a/database/migrations/2023_10_19_094711_create_static_pages.php b/database/migrations/2023_10_19_094711_create_static_pages.php
index 78fda28..04f0a9c 100644
--- a/database/migrations/2023_10_19_094711_create_static_pages.php
+++ b/database/migrations/2023_10_19_094711_create_static_pages.php
@@ -15,12 +15,12 @@ return new class extends Migration
{
Schema::create('static_pages', function (Blueprint $table) {
$table->id();
- $table->unsignedTinyInteger('type')->unique()->comment('Page type (StaticPageEnum)');
- $table->string('seo_title')->comment('Seo title about 70 chars as recommended');
- $table->string('seo_description')->comment('Seo description about 160 chars as recommended');
- $table->string('title')->comment('Title for the page');
- $table->string('slug')->unique()->comment('Unique title slug');
- $table->text('content')->comment('WYSIWYG text content using ckeditor');
+ $table->unsignedTinyInteger('type')->unique()->comment('Type of the static page (StaticPageEnum).');
+ $table->string('seo_title')->comment('Seo title of the static page.');
+ $table->string('seo_description')->comment('Seo description of the static page.');
+ $table->string('title')->comment('Title of the static page.');
+ $table->string('slug')->unique()->comment('Title slug of the static page.');
+ $table->text('content')->nullable()->comment('Content of the static page (WYSIWYG).');
$table->timestamps();
});
}
diff --git a/resources/sass/fo/pages/_unveil.scss b/resources/sass/fo/pages/_unveil.scss
index 569fd63..affb0f9 100644
--- a/resources/sass/fo/pages/_unveil.scss
+++ b/resources/sass/fo/pages/_unveil.scss
@@ -104,7 +104,7 @@
transform: rotate(-15deg);
@include media-breakpoint-up(lg) {
- left: 0;
+ left: 2rem;
}
}
diff --git a/resources/ts/fo/base/common.ts b/resources/ts/fo/base/common.ts
index bfc669f..1d999e9 100644
--- a/resources/ts/fo/base/common.ts
+++ b/resources/ts/fo/base/common.ts
@@ -67,7 +67,7 @@ document.addEventListener("DOMContentLoaded", function () {
"swiper-news": {
modules: [Navigation, Keyboard],
grabCursor: true,
- slidesPerView: 2.3,
+ slidesPerView: 1.1,
centeredSlides: true,
spaceBetween: 10,
navigation: {
@@ -76,7 +76,15 @@ document.addEventListener("DOMContentLoaded", function () {
},
keyboard: {
enabled: true,
- }
+ },
+ breakpoints: {
+ 576: {
+ slidesPerView: 1.3,
+ },
+ 768: {
+ slidesPerView: 2.3,
+ },
+ },
},
"swiper-we-move": {
modules: [Navigation, Keyboard],
@@ -311,6 +319,16 @@ document.addEventListener("DOMContentLoaded", function () {
element: htmlElt,
swiper: swiper,
});
+ if (swiper.el.id === "swiper-teams") {
+ const btnPlayPause = document.querySelector(".swiper-pagination-playpause");
+ btnPlayPause?.addEventListener("click", function () {
+ const svgs = btnPlayPause.querySelectorAll("svg");
+ svgs?.forEach(svg => {
+ svg.classList.toggle("d-none");
+ });
+ (swiper.autoplay.paused) ? swiper.autoplay.start() : swiper.autoplay.pause();
+ });
+ }
}
// GoToTop Button
diff --git a/resources/ts/fo/utilities/fontawesome.ts b/resources/ts/fo/utilities/fontawesome.ts
index eef9b3c..0a1ccb0 100644
--- a/resources/ts/fo/utilities/fontawesome.ts
+++ b/resources/ts/fo/utilities/fontawesome.ts
@@ -10,7 +10,9 @@ import {
faLocationDot,
faMagnifyingGlass,
faMinus,
+ faPause,
faPaw,
+ faPlay,
faPlus,
faQuestionCircle,
faUserGroup
@@ -31,5 +33,7 @@ library.add(faUserGroup);
library.add(faPaw);
library.add(faMinus);
library.add(faPlus);
+library.add(faPlay);
+library.add(faPause);
dom.watch();
diff --git a/resources/views/bo/pages/static_pages/form.blade.php b/resources/views/bo/pages/static_pages/form.blade.php
index d9c2abf..1371a2b 100644
--- a/resources/views/bo/pages/static_pages/form.blade.php
+++ b/resources/views/bo/pages/static_pages/form.blade.php
@@ -115,28 +115,30 @@
- {{-- CONTENT --}}
-
-