From: Stephen Cameron Date: Thu, 16 Apr 2020 17:00:12 +0000 (+0200) Subject: Training request form + other adjustments. WIP #3588 @7 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=9f2ef65b5220b60ab27a46a6b725d8737f6c012e;p=ccv-wordpress.git Training request form + other adjustments. WIP #3588 @7 --- diff --git a/wp-content/mu-plugins/cube/src/Forms/Base.php b/wp-content/mu-plugins/cube/src/Forms/Base.php index be60094..5e2baf5 100644 --- a/wp-content/mu-plugins/cube/src/Forms/Base.php +++ b/wp-content/mu-plugins/cube/src/Forms/Base.php @@ -72,6 +72,7 @@ class Base 'input_class' => '', 'show_title' => true, 'show_labels' => true, + 'show_icon' => true, 'placeholder' => $field['title'], 'field_before' => '', 'field_after' => '', @@ -203,8 +204,12 @@ class Base wp_enqueue_script('cube-flatpickr'); $res = '
'; - $res .= ''; - $res .= ''; + $res .= ''; + + if ($settings['show_icon']) { + $res .= ''; + } + $res .= '
'; return $res; diff --git a/wp-content/mu-plugins/cube/src/Forms/Training.php b/wp-content/mu-plugins/cube/src/Forms/Training.php new file mode 100644 index 0000000..125ecbf --- /dev/null +++ b/wp-content/mu-plugins/cube/src/Forms/Training.php @@ -0,0 +1,63 @@ +addField('last-name', _x('Nom', 'Nom de famille', 'ccv'), self::TEXT); + $this->addField('first-name', __('Prénom', 'ccv'), self::TEXT); + $this->addField('birth-date', __('Date de naissance', 'ccv'), self::DATE); + $this->addField('phone', __('Tel', 'ccv'), self::TEXT); + $this->addField('email', __('Mail', 'ccv'), self::EMAIL); + $this->addField('country-residence', __('Pays de résidence', 'ccv'), self::TEXT); + $this->addField('country-training', __('Pays de formation chirurgicale', 'ccv'), self::TEXT); + + $this->addField('speciality', __('Spécialité chirurgicale', 'ccv'), self::RADIO, + [ + __('Neurochirurgien', 'ccv'), + __('Chirurgien orthopédiste avec chirurgie du rachis exclusif', 'ccv'), + __('Chirurgien orthopédiste généraliste', 'ccv'), + ] + ); + + $this->addField('status', __('Statut', 'ccv'), self::RADIO, + [ + __('Etudiant (interne, fellow)', 'ccv'), + __('Chirurgien en activité', 'ccv'), + ] + ); + + //== AREA OF INTERVENTION + $this->addField('experience-lumbar-anterior', __("Quel niveau d'expertise avez-vous dans ce domaine ?", 'ccv'), self::RADIO, + [ + __("Pas d'expérience", 'ccv'), + __('Moins de 20 chirurgies', 'ccv'), + __('Entre 20 et 100', 'ccv'), + __('Plus de 100 chirurgies', 'ccv'), + ] + ); + + $this->addField('experience-scoliosis', __("Quel niveau d’expertise avez-vous dans la chirurgie de la scoliose ?", 'ccv'), self::RADIO, + [ + __("Pas d'expérience", 'ccv'), + __('Moins de 20 chirurgies', 'ccv'), + __('Entre 20 et 100', 'ccv'), + __('Plus de 100 chirurgies', 'ccv'), + ] + ); + + //== TYPE OF TRAINING + // Since this question has a complex layout, the options are set in the template (formation.blade.php) + $this->addField('training-type', __('Par quel type de formation au CCV Montpellier êtes-vous intéressé ?', 'ccv'), self::RADIO, null); + } +} diff --git a/wp-content/mu-plugins/cube/src/Shortcodes/CCVForm.php b/wp-content/mu-plugins/cube/src/Shortcodes/CCVForm.php index 9e3f8bf..090f92e 100644 --- a/wp-content/mu-plugins/cube/src/Shortcodes/CCVForm.php +++ b/wp-content/mu-plugins/cube/src/Shortcodes/CCVForm.php @@ -32,6 +32,7 @@ class CCVForm { // List of all possible forms $templates = [ 'consultation' => Forms\Consultation::class, + 'training' => Forms\Training::class, ]; if (array_key_exists($name, $templates)) { diff --git a/wp-content/themes/CCV/resources/assets/styles/components/forms.styl b/wp-content/themes/CCV/resources/assets/styles/components/forms.styl index 0ba0f1b..d7e7bc2 100644 --- a/wp-content/themes/CCV/resources/assets/styles/components/forms.styl +++ b/wp-content/themes/CCV/resources/assets/styles/components/forms.styl @@ -102,7 +102,7 @@ input[type="submit"] // Common form styling .form-field-title font-weight: 400 - margin-bottom: 0.5em + margin-bottom: 0.75em .form-field-input > *:not(:last-child) @@ -112,7 +112,7 @@ input[type="submit"] white-space: nowrap // Ensure text stays beside input control .form-field-date - input + &.date-field-compact input width: 5.5em text-align: center padding: 0 diff --git a/wp-content/themes/CCV/resources/views/forms/consultation.blade.php b/wp-content/themes/CCV/resources/views/forms/consultation.blade.php index f352b43..bcbce10 100644 --- a/wp-content/themes/CCV/resources/views/forms/consultation.blade.php +++ b/wp-content/themes/CCV/resources/views/forms/consultation.blade.php @@ -1,29 +1,42 @@ {{-- CONSULTATION FORM --}} @php /* @var $form \Cube\Forms\Consultation */ @endphp -{{--Todo: check out Tailwind forms: https://tailwindcss-custom-forms.netlify.com/ --}} -{{--Todo: check visibleIf for ideas: https://www.useragentman.com/blog/2010/06/20/visibleif-html5-custom-data-attributes-with-javascript-make-dynamic-interactive-forms/--}} - -{{-- -LINKS - -https://www.smashingmagazine.com/2012/07/12-commandments-software-localization/ -https://www.cleverbridge.com/corporate/3-tips-to-localize-your-form-fields/ - -https://parsleyjs.org/doc/#installation-localization -https://github.com/flatpickr/flatpickr ---}} - {{-- SYMPTOMS --}}
-

{{ __('1. Vos symptômes') }}

+

{{ __('1. Vos symptômes', 'ccv') }}

+ + @php $date_placeholder = __('JJ/MM/AAAA', 'ccv'); @endphp
  • {!! $form->field('main-problem') !!}
  • -
  • {!! $form->field('date-first-symptoms', ['class' => 'flex items-center spaced-horizontal', 'title_class' => 'mb-0', 'flatpickr' => ['maxDate' => 'today']]) !!}
  • -
  • {!! $form->field('date-pain-since', ['class' => 'flex items-center spaced-horizontal', 'title_class' => 'mb-0', 'flatpickr' => ['maxDate' => 'today']]) !!}
  • +
  • + {!! + $form->field('date-first-symptoms', [ + 'placeholder' => $date_placeholder, + 'class' => 'flex items-center spaced-horizontal', + 'title_class' => 'mb-0', + 'input_class' => 'date-field-compact', + 'flatpickr' => [ + 'maxDate' => 'today' + ] + ]) + !!} +
  • +
  • + {!! + $form->field('date-pain-since', [ + 'placeholder' => $date_placeholder, + 'class' => 'flex items-center spaced-horizontal', + 'title_class' => 'mb-0', + 'input_class' => 'date-field-compact', + 'flatpickr' => [ + 'maxDate' => 'today' + ] + ]) + !!} +
  • {!! $form->field('pain-arms-legs') !!} @@ -49,9 +62,33 @@ https://github.com/flatpickr/flatpickr
    • {!! $form->field('main-pain') !!}
    • {!! $form->field('tingling-numbness') !!}
    • -
    • {!! $form->field('tingling-numbness-date', ['class' => 'flex items-center spaced-horizontal', 'title_class' => 'mb-0', 'flatpickr' => ['maxDate' => 'today']]) !!}
    • +
    • + {!! + $form->field('tingling-numbness-date', [ + 'placeholder' => $date_placeholder, + 'class' => 'flex items-center spaced-horizontal', + 'title_class' => 'mb-0', + 'input_class' => 'date-field-compact', + 'flatpickr' => [ + 'maxDate' => 'today' + ] + ]) + !!} +
    • {!! $form->field('strength-loss') !!}
    • -
    • {!! $form->field('strength-loss-date', ['class' => 'flex items-center spaced-horizontal', 'title_class' => 'mb-0', 'flatpickr' => ['maxDate' => 'today']]) !!}
    • +
    • + {!! + $form->field('strength-loss-date', [ + 'placeholder' => $date_placeholder, + 'class' => 'flex items-center spaced-horizontal', + 'title_class' => 'mb-0', + 'input_class' => 'date-field-compact', + 'flatpickr' => [ + 'maxDate' => 'today' + ] + ]) + !!} +
@@ -60,7 +97,7 @@ https://github.com/flatpickr/flatpickr {{-- TREATMENTS --}}
-

{{ __('2. Vos traitements réalisés') }}

+

{{ __('2. Vos traitements réalisés', 'ccv') }}

{!! $form->field('medication', ['title_class' => 'font-light']) !!} @@ -79,7 +116,7 @@ https://github.com/flatpickr/flatpickr {{-- IMAGERY --}}
-

{{ __('3. Votre imagerie') }}

+

{{ __('3. Votre imagerie', 'ccv') }}

{{ __("IRM, Scanner, Radiographies, faites-nous parvenir vos imageries les plus récentes en utilisant l'une des méthodes suivantes :", 'ccv') }} @@ -93,26 +130,26 @@ https://github.com/flatpickr/flatpickr

- {{ __('Vos images sont sur un CD ?') }} + {{ __('Vos images sont sur un CD ?', 'ccv') }}

{{ __("Envoyez-nous l'ensemble des fichiers contenus sur votre CD en cliquant sur le lien ci-dessous :", "ccv") }}

- {{ __('Envoyer vos fichiers') }} + {{ __('Envoyer vos fichiers', 'ccv') }}
{{-- IMAGES ONLINE --}}
- +
- {{ __('Vous avez reçu un lien pour consulter vos images en ligne ?') }} + {{ __('Vous avez reçu un lien pour consulter vos images en ligne ?', 'ccv') }}

- {{ __('Collez votre lien ci-dessous ainsi que vos identifiant et mot de passe :') }} + {{ __('Collez votre lien ci-dessous ainsi que vos identifiant et mot de passe :', 'ccv') }}

@@ -124,22 +161,22 @@ https://github.com/flatpickr/flatpickr
- {{ __('Vous remplissez cette demande depuis votre téléphone ?') }} + {{ __('Vous remplissez cette demande depuis votre téléphone ?', 'ccv') }}

- {{ __('Prenez vos images en photo et envoyez-les directement depuis votre téléphone.') }} + {{ __('Prenez vos images en photo et envoyez-les directement depuis votre téléphone.', 'ccv') }}

- {{ __('Parcourir') }} + {{ __('Parcourir') }}
{{-- IMAGES SENT BY POST --}}
- +
- {{ __('Vous pouvez aussi nous envoyer vos images par courrier :') }} + {{ __('Vous pouvez aussi nous envoyer vos images par courrier :', 'ccv') }}

CCV MONTPELLIER
@@ -148,10 +185,10 @@ https://github.com/flatpickr/flatpickr 34170 Castelnau-le-Lez

-
+
@@ -166,7 +203,7 @@ https://github.com/flatpickr/flatpickr {{-- CONTACT DETAILS --}}
-

{{ __('4. Vos informations') }}

+

{{ __('4. Vos informations', 'ccv') }}

@@ -187,7 +224,7 @@ https://github.com/flatpickr/flatpickr 'title_class' => 'font-light mb-0', 'input_class' => 'flex items-center w-16', 'placeholder' => '', - 'field_after' => __('ans') + 'field_after' => __('ans', 'ccv') ]) !!} {!! $form->field('message', ['title_class' => 'font-light']) !!} @@ -211,6 +248,6 @@ https://github.com/flatpickr/flatpickr
- +
diff --git a/wp-content/themes/CCV/resources/views/forms/training.blade.php b/wp-content/themes/CCV/resources/views/forms/training.blade.php new file mode 100644 index 0000000..918372b --- /dev/null +++ b/wp-content/themes/CCV/resources/views/forms/training.blade.php @@ -0,0 +1,132 @@ +{{-- TRAINING FORM --}} +@php /* @var $form \Cube\Forms\Training */ @endphp + +{{-- IDENTITY --}} +
+

{{ __('1. Votre identité', 'ccv') }}

+ +
+ +
+ {!! $form->field('last-name', ['show_title' => false]) !!} + {!! + $form->field('birth-date', [ + 'show_title' => false, + 'placeholder' => __('Date de naissance (JJ/MM/AAAA)', 'ccv'), + 'class' => 'flex items-center spaced-horizontal', + 'title_class' => 'mb-0', + 'input_class' => 'w-full', + 'show_icon' => false, + ]) + !!} + {!! $form->field('phone', ['show_title' => false]) !!} + {!! $form->field('country-residence', ['show_title' => false]) !!} +
+ +
+ {!! $form->field('first-name', ['show_title' => false]) !!} + {!! $form->field('email', ['show_title' => false]) !!} + {!! $form->field('country-training', ['show_title' => false]) !!} +
+ +
+ +
+ {!! $form->field('speciality') !!} + {!! $form->field('status') !!} +
+ +
+ +{{-- AREA OF INTERVENTION --}} +
+

{{ __('2. Domaine d’intervention', 'ccv') }}

+ +
+ +

+ {{ __('Êtes-vous intéressé principalement par la chirurgie lombaire par voie antérieure (TDR & ALIF) ?', 'ccv') }} +

+
    +
  • {!! $form->field('experience-lumbar-anterior') !!}
  • +
+ +

+ {{ __('Êtes-vous intéressé principalement par la chirurgie percutanée de la scoliose avec pré-implantation scanner ?', 'ccv') }} +

+
    +
  • {!! $form->field('experience-scoliosis') !!}
  • +
+ +
+ +
+ +{{-- TYPE OF TRAINING --}} +
+

{{ __('3. Type de formation', 'ccv') }}

+ + @php + $training_field = 'training-type'; // Field name + $training = [ // Text used for radio values and labels + __('Visite ponctuelle sur 1 journée avec 2 à 5 interventions', 'ccv'), + __('Formation sur 3 à 5 jours aux côtés des différents chirurgiens du CCV', 'ccv'), + __('Fellowship au CCV pour une durée variable', 'ccv'), + ]; + @endphp + + {!! $form->title($training_field, ['title_class' => 'text-lg font-normal']) !!} + +
+ + {{-- OPTION 1 --}} +
+ +
+ + {{-- OPTION 2 --}} +
+ +
+ + {{-- OPTION 3 --}} +
+ +
+ +
+ + + +
diff --git a/wp-content/themes/CCV/resources/views/partials/header.blade.php b/wp-content/themes/CCV/resources/views/partials/header.blade.php index f404030..f13b62a 100644 --- a/wp-content/themes/CCV/resources/views/partials/header.blade.php +++ b/wp-content/themes/CCV/resources/views/partials/header.blade.php @@ -15,6 +15,7 @@