From 42c4cc0817d505a523627b6b2a2e3f63a31fae67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Wed, 6 Dec 2023 16:01:23 +0100 Subject: [PATCH] Win page form proof ok --- sass/pages/_won.scss | 18 ++ ts/pages/won.ts | 6 +- .../pages/participation/parts/prize.blade.php | 18 +- .../winning-proof-form/coordinates.blade.php | 176 ++++++++++++++++++ .../parts/winning-proof-form/proof.blade.php | 55 ++++++ .../parts/winning-proof.blade.php | 160 ++++++++-------- views/pages/participation/won.blade.php | 9 +- 7 files changed, 348 insertions(+), 94 deletions(-) create mode 100644 views/pages/participation/parts/winning-proof-form/coordinates.blade.php create mode 100644 views/pages/participation/parts/winning-proof-form/proof.blade.php diff --git a/sass/pages/_won.scss b/sass/pages/_won.scss index 3e263f6..d7e27e0 100644 --- a/sass/pages/_won.scss +++ b/sass/pages/_won.scss @@ -6,4 +6,22 @@ width: 16rem; margin: 0 auto; } + + @include media-breakpoint-up(md) { + .prize-rotate { + transform: rotateZ(-3deg); + } + + .anti-rotate { + transform: rotateZ(3deg); + } + } + + .wide-banner { + position: relative; + + @include media-breakpoint-up(md) { + right: -2rem; + } + } } diff --git a/ts/pages/won.ts b/ts/pages/won.ts index 6b2bd32..7113005 100644 --- a/ts/pages/won.ts +++ b/ts/pages/won.ts @@ -7,7 +7,8 @@ document.addEventListener("DOMContentLoaded", function () { spinWheelInner = wheelWrapper?.querySelector(".wheel-inner") as HTMLElement | null | undefined, spinWheelBtnList = wheelWrapper?.querySelectorAll(".wheel-spin") as NodeListOf | undefined, prizeSection = document.getElementById("prize-section"), - discountSection = document.getElementById("discount-section"); + discountSection = document.getElementById("discount-section"), + winningProofSection = document.getElementById("winning-proof-section"); /** Hide animation and show win sections */ const toggleAnimationPhase = () => { @@ -21,6 +22,9 @@ document.addEventListener("DOMContentLoaded", function () { } else { throw new Error("No section to toggle"); } + if (winningProofSection) { + winningProofSection.classList.remove("d-none"); + } }; if (wheelWrapper && spinWheelInner && spinWheelBtnList && spinWheelBtnList.length) { diff --git a/views/pages/participation/parts/prize.blade.php b/views/pages/participation/parts/prize.blade.php index c251e4f..b778985 100644 --- a/views/pages/participation/parts/prize.blade.php +++ b/views/pages/participation/parts/prize.blade.php @@ -1,15 +1,16 @@ -
+
{{ $prizeModel->picture_alt }}
-
-
- {{ __("Félicitations\u{00A0}!") }} -

{{ __('Vous avez gagné un :model !', [ - 'model' => $prizeModel->label, - ]) }} +

+
+ {{ __("Félicitations\u{00A0}!") }} +

+ {{ __('Vous avez gagné un :model !', [ + 'model' => $prizeModel->label, + ]) }}
@if ($settingsGlobal->winning_proof) {{ __('Pour recevoir votre cadeau, vous devez envoyer vos preuves d\'achat. Voir modalités ci dessous.') }} @@ -18,7 +19,8 @@ @endif

@if ($settingsGlobal->winning_proof) - » + » @endif
diff --git a/views/pages/participation/parts/winning-proof-form/coordinates.blade.php b/views/pages/participation/parts/winning-proof-form/coordinates.blade.php new file mode 100644 index 0000000..691efc2 --- /dev/null +++ b/views/pages/participation/parts/winning-proof-form/coordinates.blade.php @@ -0,0 +1,176 @@ +
+ {{ __('Vos coordonées') }} + + {{-- Force next columns to break to new line --}} +
+ + {{-- FIRST_NAME --}} +
+
+ $errors->has('first_name'), + ]) autocomplete="given-name" /> + + @foreach ($errors->get('first_name') as $message) +
{{ $message }}
+ @endforeach +
+
+ + {{-- LAST_NAME --}} +
+
+ $errors->has('last_name'), + ]) autocomplete="given-name" /> + + @foreach ($errors->get('last_name') as $message) +
{{ $message }}
+ @endforeach +
+
+ + {{-- ADDRESS --}} +
+
+ $errors->has('address'), + ]) autocomplete="address-line1" /> + + @foreach ($errors->get('address') as $message) +
{{ $message }}
+ @endforeach +
+
+ + {{-- ADDRESS2 --}} +
+
+ $errors->has('address2'), + ]) autocomplete="address-line2" /> + + @foreach ($errors->get('address2') as $message) +
{{ $message }}
+ @endforeach +
+
+ + {{-- POSTAL_CODE --}} +
+
+ $errors->has('postal_code'), + ]) autocomplete="postal-code" /> + + @foreach ($errors->get('postal_code') as $message) +
{{ $message }}
+ @endforeach +
+
+ + {{-- CITY --}} +
+
+ $errors->has('city'), + ]) autocomplete="address-level2" /> + + @foreach ($errors->get('city') as $message) +
{{ $message }}
+ @endforeach +
+
+ + {{-- COUNTRY --}} +
+
+ @php + // * Avoir les DROM-COM + France + $franceCountries = collect(\LDC\LDCCRM\Enums\Country::getValidCountries())->filter(fn($enum) => !in_array($enum, [LDC\LDCCRM\Enums\Country::belgium(), LDC\LDCCRM\Enums\Country::luxembourg()])); + $countries = collect(\LDC\LDCCRM\Enums\Country::toArray())->filter(fn($enum) => !$franceCountries->contains($enum)); + @endphp + + + @foreach ($errors->get('country') as $message) +
{{ $message }}
+ @endforeach +
+
+ + {{-- PHONE --}} +
+
+ $errors->has('phone'), + ]) autocomplete="tel" /> + + @foreach ($errors->get('phone') as $message) +
{{ $message }}
+ @endforeach +
+
+ +
diff --git a/views/pages/participation/parts/winning-proof-form/proof.blade.php b/views/pages/participation/parts/winning-proof-form/proof.blade.php new file mode 100644 index 0000000..396002f --- /dev/null +++ b/views/pages/participation/parts/winning-proof-form/proof.blade.php @@ -0,0 +1,55 @@ +
+ {{ __('Vos preuves d\'achat') }} + + {{-- Force next columns to break to new line --}} +
+ + {{-- FILE CODE --}} +
+ + $errors->has('file_code'), + ]) + accept=".jpg,.jpeg,.png,.pdf" required> + @foreach ($errors->get('file_code') as $message) +
{{ $message }}
+ @endforeach +
+ + {{-- Force next columns to break to new line --}} +
+ + {{-- FILE RECEIPT --}} +
+ + $errors->has('file_receipt'), + ]) + accept=".jpg,.jpeg,.png,.pdf" required> + @foreach ($errors->get('file_receipt') as $message) +
{{ $message }}
+ @endforeach +
+ + {{-- Force next columns to break to new line --}} +
+ + {{-- FILE STICKER --}} +
+ + $errors->has('file_sticker'), + ]) + accept=".jpg,.jpeg,.png,.pdf" required> + @foreach ($errors->get('file_sticker') as $message) +
{{ $message }}
+ @endforeach +
+ +
diff --git a/views/pages/participation/parts/winning-proof.blade.php b/views/pages/participation/parts/winning-proof.blade.php index 52f1859..fad4626 100644 --- a/views/pages/participation/parts/winning-proof.blade.php +++ b/views/pages/participation/parts/winning-proof.blade.php @@ -1,95 +1,87 @@ -
-
- -
+
diff --git a/views/pages/participation/won.blade.php b/views/pages/participation/won.blade.php index a0a4618..1dd22de 100644 --- a/views/pages/participation/won.blade.php +++ b/views/pages/participation/won.blade.php @@ -3,7 +3,7 @@ @section('title', __('Vous avez gagné !')) @section('description', __('Vous avez gagné un Lot cliquez sur la roue pour découvrir lequel')) -@section('main-class', 'won-page') +@section('main-class', 'won-page g-0') @section('content') {{-- SPIN WHEEL --}} @@ -32,4 +32,11 @@ @endphp @endif + @if ($settingsGlobal->winning_proof) + {{-- WINNING PROOF SUBMIT PART --}} + @include('theme::pages.participation.parts.winning-proof', [ + 'sectionId' => 'winning-proof-section', + ]) + @endif + @endsection