1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-12-02 16:06:54 +00:00
plateforme-tfjm2/apps/registration/templates/registration/signup.html
Yohann D'ANELLO 1805f48fa0
Fix signup
2021-01-01 21:49:40 +01:00

44 lines
1.2 KiB
HTML

<!-- templates/signup.html -->
{% extends 'base.html' %}
{% load crispy_forms_filters %}
{% load i18n %}
{% block title %}{% trans "Sign up" %}{% endblock %}
{% block extracss %}
{{ student_registration_form.media }}
{% endblock %}
{% block content %}
<h2>{% trans "Sign up" %}</h2>
<form method="post">
{% csrf_token %}
{{ form|crispy }}
<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>
$("#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 %}