mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2024-12-24 17:02:24 +00:00
Fix signup
This commit is contained in:
parent
9473e101b8
commit
1805f48fa0
@ -14,35 +14,30 @@
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<div id="student_registration_form">
|
||||
{{ student_registration_form|crispy }}
|
||||
</div>
|
||||
<div id="coach_registration_form" class="d-none">
|
||||
{{ coach_registration_form|crispy }}
|
||||
</div>
|
||||
<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 }}
|
||||
</div>
|
||||
<div id="coach_registration_form" class="d-none">
|
||||
{{ coach_registration_form|crispy }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block extrajavascript %}
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$("#id_role").change(function() {
|
||||
let selected_role = $("#id_role :selected");
|
||||
if (selected_role.val() === "participant") {
|
||||
$("#student_registration_form").removeClass("d-none");
|
||||
$("#coach_registration_form").addClass("d-none");
|
||||
}
|
||||
else {
|
||||
$("#student_registration_form").addClass("d-none");
|
||||
$("#coach_registration_form").removeClass("d-none");
|
||||
}
|
||||
});
|
||||
|
||||
$("#student_registration_form :input").removeAttr("required");
|
||||
$("#coach_registration_form :input").removeAttr("required");
|
||||
});
|
||||
$("#id_role").change(function() {
|
||||
let selected_role = $("#id_role :selected");
|
||||
if (selected_role.val() === "participant") {
|
||||
$("#registration_form").html($("#student_registration_form").html());
|
||||
}
|
||||
else {
|
||||
$("#registration_form").html($("#coach_registration_form").html());
|
||||
}
|
||||
}).change();
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
@ -687,7 +687,7 @@ msgstr "date de naissance"
|
||||
|
||||
#: apps/registration/models.py:128
|
||||
msgid "address"
|
||||
msgstr "Adresse IP"
|
||||
msgstr "adresse"
|
||||
|
||||
#: apps/registration/models.py:134
|
||||
msgid "phone number"
|
||||
|
Loading…
Reference in New Issue
Block a user