From 8f31c8a419a21903f160abe800789851285f7d1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Wed, 13 Dec 2023 10:01:36 +0100 Subject: [PATCH] SYNC 22 Submit winning proof + notifications ok --- ts/base/common.ts | 7 +++ views/mails/submited-proof.blade.php | 16 +++++ views/mails/won-discount.blade.php | 24 +++---- views/mails/won-prize.blade.php | 19 +++--- .../winning-proof-email.blade.php | 19 ------ .../pages/participation/parts/prize.blade.php | 9 ++- .../winning-proof-form/coordinates.blade.php | 14 ++--- .../parts/winning-proof-form/proof.blade.php | 39 ++++++++---- .../parts/winning-proof.blade.php | 11 +++- .../participation/won-form-only.blade.php | 27 ++++++++ views/pages/participation/won.blade.php | 2 + views/replay.blade.php | 18 ------ views/winning-proof.blade.php | 63 ------------------- 13 files changed, 125 insertions(+), 143 deletions(-) create mode 100644 views/mails/submited-proof.blade.php delete mode 100644 views/notif.remove/winning-proof-email.blade.php create mode 100644 views/pages/participation/won-form-only.blade.php delete mode 100644 views/replay.blade.php delete mode 100644 views/winning-proof.blade.php diff --git a/ts/base/common.ts b/ts/base/common.ts index 5036ec0..90ddad4 100644 --- a/ts/base/common.ts +++ b/ts/base/common.ts @@ -70,6 +70,13 @@ document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", function () { document.querySelectorAll("input.is-invalid").forEach((input) => { let timer: NodeJS.Timeout|null = null; + input.addEventListener("change", () => { + const parent = input.parentElement; + input.classList.remove("is-invalid"); + if (parent && parent.classList.contains("is-invalid")) { + parent.classList.remove("is-invalid"); + } + }); input.addEventListener("input", () => { if (timer) { clearTimeout(timer); diff --git a/views/mails/submited-proof.blade.php b/views/mails/submited-proof.blade.php new file mode 100644 index 0000000..3a7cadf --- /dev/null +++ b/views/mails/submited-proof.blade.php @@ -0,0 +1,16 @@ +{{-- blade-formatter-disable --}} + +# {{ __('Merci :first_name ,', ['first_name' => $first_name]) }} + +{{ __('Nous avons bien recu à ce jour vos preuves de gains.') }} + +{{ __('Vous recevrez prochainement votre dotation à votre domicile.') }} + + +{{ __('Nous vous remercions de votre participation.') }} +{{ __('L\'équipe :game_name .', ['game_name' => Str::ucfirst($game_name)]) }} + +{{ __('Si vous avez des questions, n\'hésitez pas à nous contacter via notre [formulaire de contact](:url).', [ + 'url' => 'https://www.legaulois.fr/contactez-nous' +]) }} + diff --git a/views/mails/won-discount.blade.php b/views/mails/won-discount.blade.php index b9de905..c0217d3 100644 --- a/views/mails/won-discount.blade.php +++ b/views/mails/won-discount.blade.php @@ -1,25 +1,25 @@ {{-- blade-formatter-disable --}} -# Bravo {{ $first_name }} ! +# {{ __('Bravo :first_name !', ['first_name' => $first_name]) }} -Vous venez de gagner un bon d'achat de {{ number_format($discount->face_value / 100, 2, ',') }}€ -en participant à notre jeu {{ Str::ucfirst($game_name) }} ! +{{ __('Vous venez de gagner un bon d\'achat de :face_value € en participant à notre grand jeu :game_name .', [ + 'face_value' => number_format($discount->face_value / 100, 2, ','), + 'game_name' => Str::ucfirst($game_name), +]) }} - Cliquez ici pour accéder à la page d'impression de votre bon +{{ __('Cliquez ici pour accéder à la page d\'impression de votre bon') }} - -Assurez-vous d'être équipé d'une imprimante en état de marche -avant de lancer l'impression de votre bon, il ne pourra être imprimé et -utilisé qu'une seule fois. +{{ __('Assurez-vous d\'être équipé d\'une imprimante en état de marche avant de lancer l\'impression de votre bon, il ne pourra être imprimé et utilisé qu\'une seule fois.') }} -Nous vous remercions de votre participation. -L'équipe {{ Str::ucfirst($game_name) }}. +{{ __('Nous vous remercions de votre participation.') }} +{{ __('L\'équipe :game_name .', ['game_name' => Str::ucfirst($game_name)]) }} -Si vous avez des questions, n'hésitez pas à nous contacter via notre -[formulaire de contact](https://www.legaulois.fr/contactez-nous). +{{ __('Si vous avez des questions, n\'hésitez pas à nous contacter via notre [formulaire de contact](:url).', [ + 'url' => 'https://www.legaulois.fr/contactez-nous' +]) }} diff --git a/views/mails/won-prize.blade.php b/views/mails/won-prize.blade.php index ebb53a3..a6e0e72 100644 --- a/views/mails/won-prize.blade.php +++ b/views/mails/won-prize.blade.php @@ -1,15 +1,18 @@ {{-- blade-formatter-disable --}} -# Bravo {{ $first_name }} ! +# {{ __('Bravo :first_name !', ['first_name' => $first_name]) }} -Vous venez de gagner 1 {{ $prize_label }} en participant à -notre grand jeu {{ Str::ucfirst($game_name) }}! +{{ __('Vous venez de gagner 1 :prize en participant à notre grand jeu :game_name .', [ + 'prize' => Str::ucfirst($prize_label), + 'game_name' => Str::ucfirst($game_name), +]) }} -Vous recevrez prochainement votre dotation à votre domicile. +{{ __('Vous recevrez prochainement votre dotation à votre domicile.') }} -Nous vous remercions de votre participation. -L'équipe {{ Str::ucfirst($game_name) }}. +{{ __('Nous vous remercions de votre participation.') }} +{{ __('L\'équipe :game_name .', ['game_name' => Str::ucfirst($game_name)]) }} -Si vous avez des questions, n'hésitez pas à nous contacter via notre -[formulaire de contact](https://www.legaulois.fr/contactez-nous). +{{ __('Si vous avez des questions, n\'hésitez pas à nous contacter via notre [formulaire de contact](:url).', [ + 'url' => 'https://www.legaulois.fr/contactez-nous' +]) }} diff --git a/views/notif.remove/winning-proof-email.blade.php b/views/notif.remove/winning-proof-email.blade.php deleted file mode 100644 index b0f0fb3..0000000 --- a/views/notif.remove/winning-proof-email.blade.php +++ /dev/null @@ -1,19 +0,0 @@ -

Bonjour,

-

Vous trouverez en PJ les preuves de gain du joueur suivant :

-

- Lot : {{ $participation->instantWin()->first()->prize->label ?? '' }}
- {{ $user->lastname }} {{ $user->firstname }}
- {{ $user->address }}
- @if ($user->address2 !== null) - {{ $user->address2 }}
- @endif - {{ $user->postal_code }} {{ $user->town }} - {{ $user->country }}
- {{ $user->email }} -

-

Codes utilisés :

-

- @if ($settings->use_ean_codes) - Code On Pack : {{ $participation->codeEan->code }}
- @endif - Code Unique : {{ $participation->code->code_unique ?? '' }} -

diff --git a/views/pages/participation/parts/prize.blade.php b/views/pages/participation/parts/prize.blade.php index 8785bae..ed00c6c 100644 --- a/views/pages/participation/parts/prize.blade.php +++ b/views/pages/participation/parts/prize.blade.php @@ -1,4 +1,11 @@ -
+
empty($noHide), +])>
- @include('theme::auth.partials.inputs.first_name') + @include('theme::auth.partials.inputs.first_name', ['required' => true])
{{-- LAST_NAME --}}
- @include('theme::auth.partials.inputs.last_name') + @include('theme::auth.partials.inputs.last_name', ['required' => true])
{{-- ADDRESS --}}
- @include('theme::auth.partials.inputs.address') + @include('theme::auth.partials.inputs.address', ['required' => true])
{{-- ADDRESS2 --}} @@ -26,22 +26,22 @@ {{-- POSTAL_CODE --}}
- @include('theme::auth.partials.inputs.postal_code') + @include('theme::auth.partials.inputs.postal_code', ['required' => true])
{{-- CITY --}}
- @include('theme::auth.partials.inputs.city') + @include('theme::auth.partials.inputs.city', ['required' => true])
{{-- COUNTRY --}}
- @include('theme::auth.partials.inputs.country') + @include('theme::auth.partials.inputs.country', ['required' => true])
{{-- PHONE --}}
- @include('theme::auth.partials.inputs.phone') + @include('theme::auth.partials.inputs.phone', ['required' => true])
diff --git a/views/pages/participation/parts/winning-proof-form/proof.blade.php b/views/pages/participation/parts/winning-proof-form/proof.blade.php index 396002f..40e145a 100644 --- a/views/pages/participation/parts/winning-proof-form/proof.blade.php +++ b/views/pages/participation/parts/winning-proof-form/proof.blade.php @@ -6,16 +6,21 @@ {{-- FILE CODE --}}
- - {{ Str::ucfirst(__('validation.custom.barcode')) }} * + $errors->has('file_code'), + 'is-invalid' => $errors->has('barcode'), + ]) @class([ + 'form-control', + 'form-control-lg', + 'is-invalid' => $errors->has('barcode'), ]) accept=".jpg,.jpeg,.png,.pdf" required> - @foreach ($errors->get('file_code') as $message) + @foreach ($errors->get('barcode') as $message)
{{ $message }}
@endforeach + {{ __('Image ou pdf, 2 Mo maximum') }}
{{-- Force next columns to break to new line --}} @@ -23,16 +28,21 @@ {{-- FILE RECEIPT --}}
- - {{ Str::ucfirst(__('validation.custom.ticket')) }} * + $errors->has('file_receipt'), + 'is-invalid' => $errors->has('ticket'), + ]) @class([ + 'form-control', + 'form-control-lg', + 'is-invalid' => $errors->has('ticket'), ]) accept=".jpg,.jpeg,.png,.pdf" required> - @foreach ($errors->get('file_receipt') as $message) + @foreach ($errors->get('ticket') as $message)
{{ $message }}
@endforeach + {{ __('Image ou pdf, 2 Mo maximum') }}
{{-- Force next columns to break to new line --}} @@ -40,16 +50,21 @@ {{-- FILE STICKER --}}
- - {{ Str::ucfirst(__('validation.custom.sticker')) }} * + $errors->has('file_sticker'), + 'is-invalid' => $errors->has('sticker'), + ]) @class([ + 'form-control', + 'form-control-lg', + 'is-invalid' => $errors->has('sticker'), ]) accept=".jpg,.jpeg,.png,.pdf" required> - @foreach ($errors->get('file_sticker') as $message) + @foreach ($errors->get('sticker') as $message)
{{ $message }}
@endforeach + {{ __('Image ou pdf, 2 Mo maximum') }}
diff --git a/views/pages/participation/parts/winning-proof.blade.php b/views/pages/participation/parts/winning-proof.blade.php index e46a0e0..4afee5f 100644 --- a/views/pages/participation/parts/winning-proof.blade.php +++ b/views/pages/participation/parts/winning-proof.blade.php @@ -1,4 +1,9 @@ -
+
empty($noHide), +])>
{{ __('Envoyez vos preuves de gain') }} @@ -16,9 +21,9 @@
-
- @method('PUT') + @method('POST') @csrf @include('theme::pages.participation.parts.winning-proof-form.coordinates') diff --git a/views/pages/participation/won-form-only.blade.php b/views/pages/participation/won-form-only.blade.php new file mode 100644 index 0000000..8253062 --- /dev/null +++ b/views/pages/participation/won-form-only.blade.php @@ -0,0 +1,27 @@ +@extends('theme::layout') + +@section('title', __('Vous avez gagné !')) +@section('description', __('Vous avez gagné un Lot, veuillez compléter le formulaire de preuve de gains')) + +@section('main-class', 'won-page g-0') +@section('content') + + {{-- LOT --}} + @include('theme::pages.participation.parts.prize', [ + 'noHide' => true, + 'sectionId' => 'prize-section', + 'prizeModel' => $prizeModel, + 'participationModel' => $participationModel, + 'winProofAnchor' => 'winning-proof-section', + ]) + + @if ($settingsGlobal->winning_proof and !empty($prizeModel)) + {{-- WINNING PROOF SUBMIT PART --}} + @include('theme::pages.participation.parts.winning-proof', [ + 'noHide' => true, + 'sectionId' => 'winning-proof-section', + 'participationModel' => $participationModel, + ]) + @endif + +@endsection diff --git a/views/pages/participation/won.blade.php b/views/pages/participation/won.blade.php index 28e835b..d1bca0a 100644 --- a/views/pages/participation/won.blade.php +++ b/views/pages/participation/won.blade.php @@ -18,6 +18,7 @@ @include('theme::pages.participation.parts.prize', [ 'sectionId' => 'prize-section', 'prizeModel' => $prizeModel, + 'participationModel' => $participationModel, 'winProofAnchor' => 'winning-proof-section', ]) @elseif (!empty($discount)) @@ -36,6 +37,7 @@ {{-- WINNING PROOF SUBMIT PART --}} @include('theme::pages.participation.parts.winning-proof', [ 'sectionId' => 'winning-proof-section', + 'participationModel' => $participationModel, ]) @endif diff --git a/views/replay.blade.php b/views/replay.blade.php deleted file mode 100644 index 4156b25..0000000 --- a/views/replay.blade.php +++ /dev/null @@ -1,18 +0,0 @@ -@extends('theme::layout') - -@section('title', 'Rejouer') - -@section('content') -
-
-
-

Félicitations pour votre gain !

-

Vous possédez un autre code ?

-

 

-

 

-
- Je rejoue -
-
-
-@endsection diff --git a/views/winning-proof.blade.php b/views/winning-proof.blade.php deleted file mode 100644 index 125adb3..0000000 --- a/views/winning-proof.blade.php +++ /dev/null @@ -1,63 +0,0 @@ -@extends('theme::layout') - -@section('title', 'Preuve de gain') - -@section('content') -

Envoyer vos preuves de gain

- - @method('PUT') - @csrf - @if ($errors->any()) -
-
    - @foreach ($errors->all() as $error) -
  • {{ $error }}
  • - @endforeach -
-
- @endif -
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
- -
-
-
- -
-
-
- -
-
- -
-
-@endsection