diff --git a/lemarche/templates/auth/signup.html b/lemarche/templates/auth/signup.html index b5e39e3a1..5055eb0db 100644 --- a/lemarche/templates/auth/signup.html +++ b/lemarche/templates/auth/signup.html @@ -38,19 +38,24 @@

Inscription

{% bootstrap_form_errors form type="all" %} + +
Vous êtes * {% bootstrap_field form.kind %}

+ +
Contact {% bootstrap_field form.first_name %} {% bootstrap_field form.last_name %} {% bootstrap_field form.phone form_group_class="phone-form-group form-group" %} -

+ +
Informations structure {% bootstrap_field form.buyer_kind_detail form_group_class="buyer-kind-detail-form-group form-group form-group-required d-none" %} @@ -66,12 +71,17 @@

Inscription


+ +
Création du mot de passe {% bootstrap_field form.email %} {% bootstrap_field form.password1 %} {% bootstrap_field form.password2 %}
+
+ +

@@ -86,6 +96,8 @@

Inscription

{% bootstrap_field form.accept_share_contact_to_external_partners form_group_class="form-group accept-survey-form-group d-none" %}

+ +
@@ -117,6 +129,8 @@

Inscription

* - add buyer_kind_detail field (and make it required) * - add position field (and make it required) * - add survey checkbox for newsletter + * - if the user is an INDIVIDUAL: + * - hide company section */ document.addEventListener('DOMContentLoaded', function() { let phoneInput = document.getElementById('id_phone'); @@ -164,10 +178,11 @@

Inscription

} else { toggleInputElement(false, element=partnerKindInput, required=false); } - if(radio.value){ - infoStructuresFieldset.classList.remove('d-none'); - } else { //empty + + if (radio.value === 'INDIVIDUAL') { infoStructuresFieldset.classList.add('d-none'); + } else { + infoStructuresFieldset.classList.remove('d-none'); } })); }); diff --git a/lemarche/users/models.py b/lemarche/users/models.py index 21802bb96..89b95f0ef 100644 --- a/lemarche/users/models.py +++ b/lemarche/users/models.py @@ -137,6 +137,7 @@ class User(AbstractUser): KIND_SIAE = user_constants.KIND_SIAE KIND_BUYER = user_constants.KIND_BUYER KIND_PARTNER = user_constants.KIND_PARTNER + KIND_INDIVIDUAL = user_constants.KIND_INDIVIDUAL KIND_ADMIN = user_constants.KIND_ADMIN username = None diff --git a/lemarche/www/auth/forms.py b/lemarche/www/auth/forms.py index a43a83af1..1c82d7bbc 100644 --- a/lemarche/www/auth/forms.py +++ b/lemarche/www/auth/forms.py @@ -14,6 +14,7 @@ class SignupForm(UserCreationForm): (User.KIND_SIAE, "Une entreprise sociale inclusive (SIAE ou structure du handicap, GEIQ)"), (User.KIND_BUYER, "Un acheteur"), (User.KIND_PARTNER, "Un partenaire (réseaux, facilitateurs)"), + (User.KIND_INDIVIDUAL, "Un particulier"), ) FORM_PARTNER_KIND_CHOICES = EMPTY_CHOICE + user_constants.PARTNER_KIND_CHOICES