-
+{% block content %}
+
{% endblock content %}
{% block extra_js %}
@@ -147,19 +185,30 @@
Inscription
let positionInput = document.getElementById('id_position');
let acceptSurveyInput = document.getElementById('id_accept_survey');
let acceptShareContactInput = document.getElementById('id_accept_share_contact_to_external_partners');
- let statsSignupBuyerContent = document.getElementById('statsSignupBuyer');
- let sectorsInput = document.getElementById('id_sectors_multiselect');
+ let statsSignupBuyerContent = document.getElementById('statsSignupBuyerFieldset');
+ let sectorsInput = document.getElementById('id_sectors');
+ let phoneFieldsetElement = document.getElementById('phoneFieldsetElement');
let infoStructuresFieldset = document.getElementById('infoStructuresFieldset');
+ let buyerKindDetailFieldsetElement = document.getElementById('buyerKindDetailFieldsetElement');
+ let partnerKindFieldsetElement = document.getElementById('partnerKindFieldsetElement');
+ let companyNameFieldsetElement = document.getElementById('companyNameFieldsetElement');
+ let positionFieldsetElement = document.getElementById('positionFieldsetElement');
+ let acceptSurveyFieldsetElement = document.getElementById('acceptSurveyFielsetElement');
+ let acceptShareContactFieldsetElement = document.getElementById('shareContactFielsetElement');
+ let sectorsFieldsetElement = document.getElementById('sectorsFieldsetElement');
+
let kindRadios = document.querySelectorAll('input[type=radio][name="kind"]');
kindRadios.forEach(radio => radio.addEventListener('change', () => {
if (radio.value === 'SIAE') {
- companyNameSiaeFormGroupDiv.classList.remove('d-none');
+ companyNameSiaeFormGroupDiv.classList.remove('fr-hidden');
+ companyNameFieldsetElement.classList.add('fr-hidden');
toggleInputElement(false, element=companyNameInput, required=false);
toggleInputElement(false, element=acceptSurveyInput);
toggleInputElement(true, element=acceptShareContactInput);
} else {
- companyNameSiaeFormGroupDiv.classList.add('d-none');
+ companyNameSiaeFormGroupDiv.classList.add('fr-hidden');
+ companyNameFieldsetElement.classList.remove('fr-hidden');
toggleInputElement(true, element=companyNameInput, required=true);
toggleInputElement(true, element=acceptSurveyInput);
toggleInputElement(false, element=acceptShareContactInput);
@@ -169,13 +218,13 @@
Inscription
toggleInputElement(true, element=buyerKindDetailInput, required=true);
toggleInputElement(true, element=positionInput, required=true);
toggleInputElement(true, element=phoneInput, required=true);
- statsSignupBuyerContent.classList.remove('d-none');
+ statsSignupBuyerContent.classList.remove('fr-hidden');
toggleInputElement(true, element=sectorsInput, required=false);
} else {
toggleInputElement(false, element=buyerKindDetailInput, required=false);
toggleInputElement(false, element=positionInput, required=false);
toggleInputElement(true, element=phoneInput, required=false);
- statsSignupBuyerContent.classList.add('d-none');
+ statsSignupBuyerContent.classList.add('fr-hidden');
toggleInputElement(false, element=sectorsInput, required=false);
}
@@ -187,9 +236,9 @@
Inscription
if (radio.value === 'INDIVIDUAL') {
toggleInputElement(false, element=companyNameInput, required=false);
- infoStructuresFieldset.classList.add('d-none');
+ infoStructuresFieldset.classList.add('fr-hidden');
} else {
- infoStructuresFieldset.classList.remove('d-none');
+ infoStructuresFieldset.classList.remove('fr-hidden');
}
}));
});
diff --git a/lemarche/templates/layouts/base.html b/lemarche/templates/layouts/base.html
index 1a4fb20f7..8fbb86e6a 100644
--- a/lemarche/templates/layouts/base.html
+++ b/lemarche/templates/layouts/base.html
@@ -57,7 +57,8 @@
{% endblock footer %}
{% dsfr_js nonce=request.csp_nonce %}
-
+
+
{% block extra_js %}
{% endblock extra_js %}