From 145d5c88949519dd8955f2a821e3e1f83c51c632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Fri, 8 Dec 2023 18:52:21 +0100 Subject: [PATCH] Refactor register inputs + add profil-verify form --- .../auth/partials/form-address-info.blade.php | 38 ++++ .../partials/form-personal-info.blade.php | 26 +++ .../partials/form-security-info.blade.php | 28 +++ views/auth/partials/inputs/address.blade.php | 18 ++ views/auth/partials/inputs/address2.blade.php | 18 ++ .../auth/partials/inputs/birth_date.blade.php | 17 ++ views/auth/partials/inputs/city.blade.php | 16 ++ views/auth/partials/inputs/country.blade.php | 37 ++++ views/auth/partials/inputs/email.blade.php | 16 ++ .../auth/partials/inputs/first_name.blade.php | 16 ++ .../auth/partials/inputs/last_name.blade.php | 16 ++ views/auth/partials/inputs/password.blade.php | 21 ++ .../inputs/password_confirmation.blade.php | 21 ++ views/auth/partials/inputs/phone.blade.php | 18 ++ .../partials/inputs/postal_code.blade.php | 18 ++ views/auth/profil-verify.blade.php | 135 +++++++++++ views/auth/register.blade.php | 209 ++---------------- views/layouts/header.blade.php | 2 +- .../pages/participation/parts/prize.blade.php | 2 +- .../winning-proof-form/coordinates.blade.php | 147 +----------- 20 files changed, 491 insertions(+), 328 deletions(-) create mode 100644 views/auth/partials/form-address-info.blade.php create mode 100644 views/auth/partials/form-personal-info.blade.php create mode 100644 views/auth/partials/form-security-info.blade.php create mode 100644 views/auth/partials/inputs/address.blade.php create mode 100644 views/auth/partials/inputs/address2.blade.php create mode 100644 views/auth/partials/inputs/birth_date.blade.php create mode 100644 views/auth/partials/inputs/city.blade.php create mode 100644 views/auth/partials/inputs/country.blade.php create mode 100644 views/auth/partials/inputs/email.blade.php create mode 100644 views/auth/partials/inputs/first_name.blade.php create mode 100644 views/auth/partials/inputs/last_name.blade.php create mode 100644 views/auth/partials/inputs/password.blade.php create mode 100644 views/auth/partials/inputs/password_confirmation.blade.php create mode 100644 views/auth/partials/inputs/phone.blade.php create mode 100644 views/auth/partials/inputs/postal_code.blade.php create mode 100644 views/auth/profil-verify.blade.php diff --git a/views/auth/partials/form-address-info.blade.php b/views/auth/partials/form-address-info.blade.php new file mode 100644 index 0000000..147a66d --- /dev/null +++ b/views/auth/partials/form-address-info.blade.php @@ -0,0 +1,38 @@ +
+ {{ __('Vos coordonnées') }} + + {{-- ADDRESS --}} +
+
+ @include('theme::auth.partials.inputs.address', ['required' => true]) +
+
+ + {{-- ADDRESS2 --}} +
+
+ @include('theme::auth.partials.inputs.address2') +
+
+ + {{-- CITY --}} +
+
+ @include('theme::auth.partials.inputs.city', ['required' => true]) +
+
+ + {{-- POSTCODE --}} +
+
+ @include('theme::auth.partials.inputs.postal_code', ['required' => true]) +
+
+ + {{-- COUNTRY --}} +
+
+ @include('theme::auth.partials.inputs.country', ['required' => true]) +
+
+
diff --git a/views/auth/partials/form-personal-info.blade.php b/views/auth/partials/form-personal-info.blade.php new file mode 100644 index 0000000..a281857 --- /dev/null +++ b/views/auth/partials/form-personal-info.blade.php @@ -0,0 +1,26 @@ +
+ {{ __('Votre profil') }} + +
+ {{-- FIRST_NAME --}} +
+
+ @include('theme::auth.partials.inputs.first_name', ['required' => true]) +
+
+ + {{-- LAST NAME --}} +
+
+ @include('theme::auth.partials.inputs.last_name', ['required' => true]) +
+
+ + {{-- BIRTH_DATE --}} +
+
+ @include('theme::auth.partials.inputs.birth_date', ['required' => true]) +
+
+
+
diff --git a/views/auth/partials/form-security-info.blade.php b/views/auth/partials/form-security-info.blade.php new file mode 100644 index 0000000..05a29e4 --- /dev/null +++ b/views/auth/partials/form-security-info.blade.php @@ -0,0 +1,28 @@ +
+ {{ __('Vos identifiants') }} + +
+ {{-- EMAIL --}} +
+
+ @include('theme::auth.partials.inputs.email', ['required' => true]) +
+
+ + {{-- PASSWORD --}} +
+
+ @include('theme::auth.partials.inputs.password', ['required' => true]) +
+
+ + {{-- PASSWORD CONFIRMATION --}} +
+
+ @include('theme::auth.partials.inputs.password_confirmation', ['required' => true]) +
+
+ + @include('theme::auth.password-min-strength') +
+
diff --git a/views/auth/partials/inputs/address.blade.php b/views/auth/partials/inputs/address.blade.php new file mode 100644 index 0000000..fb1c433 --- /dev/null +++ b/views/auth/partials/inputs/address.blade.php @@ -0,0 +1,18 @@ +
+ $errors->has('address'), + ]) autocomplete="address-line1" @readonly(!empty($readonly)) @disabled(!empty($disabled)) @required(!empty($required)) /> + + @foreach ($errors->get('address') as $message) +
{{ $message }}
+ @endforeach +
diff --git a/views/auth/partials/inputs/address2.blade.php b/views/auth/partials/inputs/address2.blade.php new file mode 100644 index 0000000..f13fb73 --- /dev/null +++ b/views/auth/partials/inputs/address2.blade.php @@ -0,0 +1,18 @@ +
+ $errors->has('address2'), + ]) autocomplete="address-line2" @readonly(!empty($readonly)) @disabled(!empty($disabled)) @required(!empty($required)) /> + + @foreach ($errors->get('address2') as $message) +
{{ $message }}
+ @endforeach +
diff --git a/views/auth/partials/inputs/birth_date.blade.php b/views/auth/partials/inputs/birth_date.blade.php new file mode 100644 index 0000000..025643c --- /dev/null +++ b/views/auth/partials/inputs/birth_date.blade.php @@ -0,0 +1,17 @@ +
+ @php + $dataBirthDate = [ + 'id' => 'register-birth_date', + 'class' => 'form-control mx-auto ' . ($errors->has('birth_date') ? 'is-invalid' : ''), + 'name' => 'birth_date', + 'placeholder' => Str::ucfirst(__('validation.attributes.date_of_birth')) . (!empty($required) ? '*' : ''), + 'autocomplete' => 'bday', + 'required' => !empty($required), + 'value' => old('birth_date', $crmCustomer->birth_date ?? null), + ]; + @endphp +
+ @foreach ($errors->get('birth_date') as $message) +
{{ $message }}
+ @endforeach +
diff --git a/views/auth/partials/inputs/city.blade.php b/views/auth/partials/inputs/city.blade.php new file mode 100644 index 0000000..f05e80e --- /dev/null +++ b/views/auth/partials/inputs/city.blade.php @@ -0,0 +1,16 @@ +
+ $errors->has('city'), + ]) + placeholder="{{ __('validation.attributes.city') }}*" autocomplete="address-level2" @readonly(!empty($readonly)) @disabled(!empty($disabled)) + @required(!empty($required)) /> + + @foreach ($errors->get('city') as $message) +
{{ $message }}
+ @endforeach +
diff --git a/views/auth/partials/inputs/country.blade.php b/views/auth/partials/inputs/country.blade.php new file mode 100644 index 0000000..461d0e9 --- /dev/null +++ b/views/auth/partials/inputs/country.blade.php @@ -0,0 +1,37 @@ +
+ @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::getValidCountries())->filter(fn($enum) => !$franceCountries->contains($enum)); + $old_country = old('country', optional($crmCustomer->country ?? null)->value ?: null); + @endphp + + + @foreach ($errors->get('country') as $message) +
{{ $message }}
+ @endforeach +
diff --git a/views/auth/partials/inputs/email.blade.php b/views/auth/partials/inputs/email.blade.php new file mode 100644 index 0000000..8962130 --- /dev/null +++ b/views/auth/partials/inputs/email.blade.php @@ -0,0 +1,16 @@ +
+ $errors->has('email'), + ]) placeholder="{{ __('validation.attributes.email') }}*" autocomplete="email" @readonly(!empty($readonly)) + @readonly(!empty($readonly)) @disabled(!empty($disabled)) @required(!empty($required)) /> + + @foreach ($errors->get('email') as $message) +
{{ $message }}
+ @endforeach +
diff --git a/views/auth/partials/inputs/first_name.blade.php b/views/auth/partials/inputs/first_name.blade.php new file mode 100644 index 0000000..5bf7cb6 --- /dev/null +++ b/views/auth/partials/inputs/first_name.blade.php @@ -0,0 +1,16 @@ +
+ $errors->has('lastname'), + ]) placeholder="{{ __('validation.attributes.last_name') }}*" autocomplete="given-name" @readonly(!empty($readonly)) + @disabled(!empty($disabled)) @required(!empty($required)) /> + + @foreach ($errors->get('lastname') as $message) +
{{ $message }}
+ @endforeach +
diff --git a/views/auth/partials/inputs/last_name.blade.php b/views/auth/partials/inputs/last_name.blade.php new file mode 100644 index 0000000..0974cf3 --- /dev/null +++ b/views/auth/partials/inputs/last_name.blade.php @@ -0,0 +1,16 @@ +
+ $errors->has('firstname'), + ]) placeholder="{{ __('validation.attributes.first_name') }}*" autocomplete="family-name" @readonly(!empty($readonly)) + @disabled(!empty($disabled)) @required(!empty($required)) /> + + @foreach ($errors->get('firstname') as $message) +
{{ $message }}
+ @endforeach +
diff --git a/views/auth/partials/inputs/password.blade.php b/views/auth/partials/inputs/password.blade.php new file mode 100644 index 0000000..5440be4 --- /dev/null +++ b/views/auth/partials/inputs/password.blade.php @@ -0,0 +1,21 @@ +
+
+ $errors->has('password'), + ]) + placeholder="{{ __('validation.attributes.password') }}*" autocomplete="new-password" @readonly(!empty($readonly)) + @disabled(!empty($disabled)) @required(!empty($required)) /> + +
+ @php $dataPassword = ['inputId' => 'register-password']; @endphp + + @foreach ($errors->get('password') as $message) +
{{ $message }}
+ @endforeach +
diff --git a/views/auth/partials/inputs/password_confirmation.blade.php b/views/auth/partials/inputs/password_confirmation.blade.php new file mode 100644 index 0000000..6cc38a5 --- /dev/null +++ b/views/auth/partials/inputs/password_confirmation.blade.php @@ -0,0 +1,21 @@ +
+
+ $errors->has('password_confirmation'), + ]) + placeholder="{{ __('validation.attributes.password_confirmation') }}*" autocomplete="new-password" @readonly(!empty($readonly)) + @disabled(!empty($disabled)) @required(!empty($required)) /> + +
+ @php $dataConfirmPassword = ['inputId' => 'register-password-confirmation']; @endphp + + @foreach ($errors->get('password_confirmation') as $message) +
{{ $message }}
+ @endforeach +
diff --git a/views/auth/partials/inputs/phone.blade.php b/views/auth/partials/inputs/phone.blade.php new file mode 100644 index 0000000..92f7b52 --- /dev/null +++ b/views/auth/partials/inputs/phone.blade.php @@ -0,0 +1,18 @@ +
+ $errors->has('phone'), + ]) autocomplete="tel" @readonly(!empty($readonly)) @disabled(!empty($disabled)) @required(!empty($required)) /> + + @foreach ($errors->get('phone') as $message) +
{{ $message }}
+ @endforeach +
diff --git a/views/auth/partials/inputs/postal_code.blade.php b/views/auth/partials/inputs/postal_code.blade.php new file mode 100644 index 0000000..c43687e --- /dev/null +++ b/views/auth/partials/inputs/postal_code.blade.php @@ -0,0 +1,18 @@ +
+ $errors->has('postal_code'), + ]) autocomplete="postal-code" @readonly(!empty($readonly)) @disabled(!empty($disabled)) @required(!empty($required)) /> + + @foreach ($errors->get('postal_code') as $message) +
{{ $message }}
+ @endforeach +
diff --git a/views/auth/profil-verify.blade.php b/views/auth/profil-verify.blade.php new file mode 100644 index 0000000..84268f9 --- /dev/null +++ b/views/auth/profil-verify.blade.php @@ -0,0 +1,135 @@ +@extends('theme::layout') + +@section('title', __('Vérifier mes informations')) +@section('description', __('Vérifier mes informations pour participer au jeu')) + +@section('content') +
+
+
+

+ {{ __('Mon compte du club :company', ['company' => $settingsGlobal->company]) }}

+ +
+ @csrf + +
+
+ {{ __("Pour pouvoir jouer, merci de renseigner/compléter les champs ci-dessous\u{00A0}:") }} +
+
+ +
+ {{ __('Vos coordonnées') }} + + {{-- Force next columns to break to new line --}} +
+ + {{-- FIRST_NAME --}} +
+ @include('theme::auth.partials.inputs.first_name', ['required' => true]) +
+ + {{-- LAST_NAME --}} +
+ @include('theme::auth.partials.inputs.last_name', ['required' => true]) +
+ + {{-- ADDRESS --}} +
+ @include('theme::auth.partials.inputs.address', ['required' => true]) +
+ + {{-- ADDRESS2 --}} +
+ @include('theme::auth.partials.inputs.address2') +
+ + {{-- POSTAL_CODE --}} +
+ @include('theme::auth.partials.inputs.postal_code', ['required' => true]) +
+ + {{-- CITY --}} +
+ @include('theme::auth.partials.inputs.city', ['required' => true]) +
+ + {{-- COUNTRY --}} +
+ @include('theme::auth.partials.inputs.country', ['required' => true]) +
+ + {{-- PHONE --}} +
+ @include('theme::auth.partials.inputs.phone') +
+ + {{-- EMAIL --}} +
+ @include('theme::auth.partials.inputs.email', ['readonly' => true]) +
+ +
+ + {{-- CHECKBOXES --}} +
+
+
+ $errors->has('opt_in'), + ]) + @checked($crmCustomer->opt_in)> + +
+ @foreach ($errors->get('opt_in') as $message) +
{{ $message }}
+ @endforeach +
+
+
+
+
+ $errors->has('ok_cgv'), + ]) required /> + +
+ @foreach ($errors->get('ok_cgv') as $message) +
{{ $message }}
+ @endforeach +
+
+ +
+
+ +
+
+ +
+
+ {{ __('* champs obligatoires') }} +
+
+
+
+
+
+@endsection diff --git a/views/auth/register.blade.php b/views/auth/register.blade.php index e8b0d75..ef5c3bd 100644 --- a/views/auth/register.blade.php +++ b/views/auth/register.blade.php @@ -19,197 +19,28 @@ -
- {{ __('Votre profil') }} + {{-- PERSONAL INFO --}} + @include('theme::auth.partials.form-personal-info', [ + 'colClasses' => 'col col-md-10 col-lg-8 py-2', + ]) -
-
-
-
- - - @foreach ($errors->get('lastname') as $message) -
{{ $message }}
- @endforeach -
-
-
+ {{-- ADDRESS INFO --}} + @include('theme::auth.partials.form-address-info', [ + 'colClasses' => 'col col-md-10 col-lg-8 py-2', + ]) -
-
-
- - - @foreach ($errors->get('firstname') as $message) -
{{ $message }}
- @endforeach -
-
-
- -
-
-
- @php - $dataBirthDate = [ - 'id' => 'register-birth_date', - 'class' => 'form-control mx-auto ' . ($errors->has('birth_date') ? 'is-invalid' : ''), - 'name' => 'birth_date', - 'placeholder' => __('Date de naissance'), - 'autocomplete' => 'bday', - 'required' => true, - 'value' => old('birth_date', $crmCustomer->birth_date ?? null), - ]; - @endphp -
- @foreach ($errors->get('birth_date') as $message) -
{{ $message }}
- @endforeach -
-
-
-
-
- -
- {{ __('Vos coordonnées') }} - -
-
-
- - - @foreach ($errors->get('address') as $message) -
{{ $message }}
- @endforeach -
-
-
- -
-
-
- - - @foreach ($errors->get('address2') as $message) -
{{ $message }}
- @endforeach -
-
-
- -
-
-
- - - @foreach ($errors->get('city') as $message) -
{{ $message }}
- @endforeach -
-
-
- -
-
-
- - - @foreach ($errors->get('postcode') as $message) -
{{ $message }}
- @endforeach -
-
-
-
- -
- {{ __('Vos identifiants') }} - -
-
-
-
- - - @foreach ($errors->get('email') as $message) -
{{ $message }}
- @endforeach -
-
-
- - @if (empty($displayEdit)) -
-
-
-
- - -
- @php $dataPassword = ['inputId' => 'register-password']; @endphp - - @foreach ($errors->get('password') as $message) -
{{ $message }}
- @endforeach -
-
-
- -
-
-
-
- - -
- @php $dataConfirmPassword = ['inputId' => 'register-password-confirmation']; @endphp - - @foreach ($errors->get('password_confirmation') as $message) -
{{ $message }}
- @endforeach -
-
-
- - @include('theme::auth.password-min-strength') - @endif -
-
+ {{-- SECURITY INFO --}} + @include('theme::auth.partials.form-security-info') + {{-- CHECKBOXES --}}
- + $errors->has('opt_in'), + ])> @@ -219,12 +50,14 @@ @endforeach
-
- + $errors->has('ok_cgv'), + ]) required />