1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-12-25 06:22:22 +00:00

Fix signup

This commit is contained in:
Yohann D'ANELLO 2021-01-01 21:49:40 +01:00
parent 9473e101b8
commit 1805f48fa0
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
2 changed files with 18 additions and 23 deletions

View File

@ -14,35 +14,30 @@
<form method="post"> <form method="post">
{% csrf_token %} {% csrf_token %}
{{ form|crispy }} {{ form|crispy }}
<div id="student_registration_form"> <div id="registration_form"></div>
<button class="btn btn-success" type="submit">
{% trans "Sign up" %}
</button>
</form>
<div id="student_registration_form" class="d-none">
{{ student_registration_form|crispy }} {{ student_registration_form|crispy }}
</div> </div>
<div id="coach_registration_form" class="d-none"> <div id="coach_registration_form" class="d-none">
{{ coach_registration_form|crispy }} {{ coach_registration_form|crispy }}
</div> </div>
<button class="btn btn-success" type="submit">
{% trans "Sign up" %}
</button>
</form>
{% endblock %} {% endblock %}
{% block extrajavascript %} {% block extrajavascript %}
<script> <script>
$(document).ready(function() {
$("#id_role").change(function() { $("#id_role").change(function() {
let selected_role = $("#id_role :selected"); let selected_role = $("#id_role :selected");
if (selected_role.val() === "participant") { if (selected_role.val() === "participant") {
$("#student_registration_form").removeClass("d-none"); $("#registration_form").html($("#student_registration_form").html());
$("#coach_registration_form").addClass("d-none");
} }
else { else {
$("#student_registration_form").addClass("d-none"); $("#registration_form").html($("#coach_registration_form").html());
$("#coach_registration_form").removeClass("d-none");
} }
}); }).change();
$("#student_registration_form :input").removeAttr("required");
$("#coach_registration_form :input").removeAttr("required");
});
</script> </script>
{% endblock %} {% endblock %}

View File

@ -687,7 +687,7 @@ msgstr "date de naissance"
#: apps/registration/models.py:128 #: apps/registration/models.py:128
msgid "address" msgid "address"
msgstr "Adresse IP" msgstr "adresse"
#: apps/registration/models.py:134 #: apps/registration/models.py:134
msgid "phone number" msgid "phone number"