1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-22 17:58:26 +02:00

Move apps in main directory

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello
2023-03-22 11:11:35 +01:00
parent 2a545dae10
commit 1d81213773
132 changed files with 534 additions and 547 deletions

View File

@ -0,0 +1,46 @@
<!-- 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>
document.addEventListener('DOMContentLoaded', () => {
let role_elem = document.getElementById("id_role")
function updateView () {
let selected_role = role_elem.options[role_elem.selectedIndex].value
if (selected_role === "participant")
document.getElementById("registration_form").innerHTML = document.getElementById("student_registration_form").innerHTML
else
document.getElementById("registration_form").innerHTML = document.getElementById("coach_registration_form").innerHTML
}
role_elem.addEventListener('change', updateView)
updateView()
})
</script>
{% endblock %}