Display popups to create and join team

This commit is contained in:
Yohann D'ANELLO 2020-09-22 20:41:42 +02:00
parent 016398dd8d
commit c7f74b68be
11 changed files with 399 additions and 195 deletions

View File

@ -0,0 +1,28 @@
from django import forms
from django.core.exceptions import ValidationError
from .models import Team
class TeamForm(forms.ModelForm):
class Meta:
model = Team
fields = ('name', 'trigram', 'grant_animath_access_videos',)
class JoinTeamForm(forms.ModelForm):
def clean_access_code(self):
access_code = self.cleaned_data["access_code"]
if not Team.objects.filter(access_code=access_code).exists():
raise ValidationError("No team was found with this access code.")
return access_code
def clean(self):
cleaned_data = super().clean()
if "access_code" in cleaned_data:
self.instance = Team.objects.get(access_code=cleaned_data["access_code"])
return cleaned_data
class Meta:
model = Team
fields = ('access_code',)

View File

@ -0,0 +1,13 @@
{% extends "base.html" %}
{% load crispy_forms_filters i18n %}
{% block content %}
<form method="post">
<div id="form-content">
{% csrf_token %}
{{ form|crispy }}
</div>
<button class="btn btn-success" type="submit">{% trans "Create" %}</button>
</form>
{% endblock content %}

View File

@ -0,0 +1,21 @@
{% load crispy_forms_filters i18n %}
<div id="createTeamModal" class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<form method="post" action="{% url "participation:create_team" %}">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">{% trans "Create team" %}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body"></div>
<div class="modal-footer">
<button type="submit" class="btn btn-success">{% trans "Create" %}</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">{% trans "Close" %}</button>
</div>
</div>
</form>
</div>
</div>

View File

@ -0,0 +1,13 @@
{% extends "base.html" %}
{% load crispy_forms_filters i18n %}
{% block content %}
<form method="post">
<div id="form-content">
{% csrf_token %}
{{ form|crispy }}
</div>
<button class="btn btn-primary" type="submit">{% trans "Join" %}</button>
</form>
{% endblock content %}

View File

@ -0,0 +1,21 @@
{% load crispy_forms_filters i18n %}
<div id="joinTeamModal" class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<form method="post" action="{% url "participation:join_team" %}">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">{% trans "Join team" %}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body"></div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">{% trans "Join" %}</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">{% trans "Close" %}</button>
</div>
</div>
</form>
</div>
</div>

View File

@ -1 +1,11 @@
urlpatterns = []
from django.urls import path
from .views import CreateTeamView, JoinTeamView
app_name = "participation"
urlpatterns = [
path("create_team/", CreateTeamView.as_view(), name="create_team"),
path("join_team/", JoinTeamView.as_view(), name="join_team"),
]

View File

@ -1,3 +1,20 @@
from django.shortcuts import render
from django.contrib.auth.mixins import LoginRequiredMixin
from django.utils.translation import gettext_lazy as _
from django.views.generic import CreateView, FormView
# Create your views here.
from participation.forms import TeamForm, JoinTeamForm
from participation.models import Team
class CreateTeamView(LoginRequiredMixin, CreateView):
model = Team
form_class = TeamForm
extra_context = dict(title=_("Create team"))
template_name = "participation/create_team.html"
class JoinTeamView(LoginRequiredMixin, FormView):
model = Team
form_class = JoinTeamForm
extra_context = dict(title=_("Join team"))
template_name = "participation/create_team.html"

View File

@ -55,6 +55,10 @@ class Registration(PolymorphicModel):
def type(self):
raise NotImplementedError
@property
def participates(self):
return isinstance(self, StudentRegistration) or isinstance(self, CoachRegistration)
def __str__(self):
return _("registration of {first_name} {last_name}")\
.format(first_name=self.user.first_name, last_name=self.user.last_name)

View File

@ -5,7 +5,7 @@ from .views import SignupView, UserValidationEmailSentView, UserResendValidation
app_name = "registration"
urlpatterns = [
path("signup", SignupView.as_view(), name="signup"),
path("signup/", SignupView.as_view(), name="signup"),
path('validate_email/sent/', UserValidationEmailSentView.as_view(), name='email_validation_sent'),
path('validate_email/resend/<int:pk>/', UserResendValidationEmailView.as_view(),
name='email_validation_resend'),

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Corres2math\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-09-22 18:49+0200\n"
"POT-Creation-Date: 2020-09-22 20:31+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Yohann D'ANELLO <yohann.danello@animath.fr>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -124,7 +124,7 @@ msgid "Team {name} ({trigram})"
msgstr "Équipe {name} ({trigram})"
#: apps/participation/models.py:38 apps/participation/models.py:49
#: apps/registration/models.py:70 apps/registration/models.py:103
#: apps/registration/models.py:78 apps/registration/models.py:111
msgid "team"
msgstr "équipe"
@ -195,6 +195,30 @@ msgstr "vidéo"
msgid "videos"
msgstr "vidéos"
#: apps/participation/templates/participation/create_team.html:10
#: apps/participation/templates/participation/create_team_modal.html:15
msgid "Create"
msgstr "Créer"
#: apps/participation/templates/participation/create_team_modal.html:8
#: templates/base.html:75
msgid "Create team"
msgstr "Créer une équipe"
#: apps/participation/templates/participation/create_team_modal.html:16
#: apps/participation/templates/participation/join_team_modal.html:16
msgid "Close"
msgstr "Fermer"
#: apps/participation/templates/participation/join_team_modal.html:8
#: templates/base.html:80
msgid "Join team"
msgstr "Rejoindre une équipe"
#: apps/participation/templates/participation/join_team_modal.html:15
msgid "Join"
msgstr "Rejoindre"
#: apps/registration/forms.py:11
msgid "role"
msgstr "rôle"
@ -203,7 +227,7 @@ msgstr "rôle"
msgid "participant"
msgstr "participant"
#: apps/registration/forms.py:14 apps/registration/models.py:112
#: apps/registration/forms.py:14 apps/registration/models.py:120
msgid "coach"
msgstr "encadrant"
@ -216,83 +240,268 @@ msgstr ""
msgid "email confirmed"
msgstr "email confirmé"
#: apps/registration/models.py:30
#: apps/registration/models.py:34
msgid "Activate your Correspondances account"
msgstr "Activez votre compte des Correspondances"
#: apps/registration/models.py:55
#: apps/registration/models.py:63
#, python-brace-format
msgid "registration of {first_name} {last_name}"
msgstr "inscription de {first_name} {last_name}"
#: apps/registration/models.py:59
#: apps/registration/models.py:67
msgid "registration"
msgstr "inscription"
#: apps/registration/models.py:60
#: apps/registration/models.py:68
msgid "registrations"
msgstr "inscriptions"
#: apps/registration/models.py:75
#: apps/registration/models.py:83
msgid "12th grade"
msgstr "Terminale"
#: apps/registration/models.py:76
#: apps/registration/models.py:84
msgid "11th grade"
msgstr "Première"
#: apps/registration/models.py:77
#: apps/registration/models.py:85
msgid "10th grade or lower"
msgstr "Seconde ou inférieur"
#: apps/registration/models.py:79
#: apps/registration/models.py:87
msgid "student class"
msgstr "classe"
#: apps/registration/models.py:84
#: apps/registration/models.py:92
msgid "school"
msgstr "école"
#: apps/registration/models.py:89
#: apps/registration/models.py:97
msgid "student"
msgstr "étudiant"
#: apps/registration/models.py:92
#: apps/registration/models.py:100
msgid "student registration"
msgstr "inscription d'élève"
#: apps/registration/models.py:93
#: apps/registration/models.py:101
msgid "student registrations"
msgstr "inscriptions d'élève"
#: apps/registration/models.py:107
#: apps/registration/models.py:115
msgid "professional activity"
msgstr "activité professionnelle"
#: apps/registration/models.py:115
#: apps/registration/models.py:123
msgid "coach registration"
msgstr "inscription d'encadrant"
#: apps/registration/models.py:116
#: apps/registration/models.py:124
msgid "coach registrations"
msgstr "inscriptions d'encadrants"
#: apps/registration/models.py:121
#: apps/registration/models.py:129
msgid "role of the administrator"
msgstr "rôle de l'administrateur"
#: apps/registration/models.py:126
#: apps/registration/models.py:134
msgid "admin"
msgstr "admin"
#: apps/registration/models.py:129
#: apps/registration/models.py:137
msgid "admin registration"
msgstr "inscription d'administrateur"
#: apps/registration/models.py:130
#: apps/registration/models.py:138
msgid "admin registrations"
msgstr "inscriptions d'administrateur"
#: apps/registration/templates/registration/email_validation_complete.html:15
msgid "Your email have successfully been validated."
msgstr "Votre email a été validé avec succès."
#: apps/registration/templates/registration/email_validation_complete.html:18
#, python-format
msgid "You can now <a href=\"%(login_url)s\">log in</a>."
msgstr "Vous pouvez désormais vous <a href=\"%(login_url)s\">connecter</a>."
#: apps/registration/templates/registration/email_validation_complete.html:22
msgid ""
"The link was invalid. The token may have expired. Please send us an email to "
"activate your account."
msgstr ""
"Le lien est invalide. Le jeton a peut-être expiré. Merci de nous envoyer un "
"mail pour activer votre compte."
#: apps/registration/templates/registration/email_validation_email_sent.html:10
msgid "Account activation"
msgstr "Activation du compte"
#: apps/registration/templates/registration/email_validation_email_sent.html:14
msgid ""
"An email has been sent. Please click on the link to activate your account."
msgstr ""
"Un email a été envoyé. Merci de cliquer sur le lien pour activer votre "
"compte."
#: apps/registration/templates/registration/logged_out.html:8
msgid "Thanks for spending some quality time with the Web site today."
msgstr "Merci d'avoir utilisé la plateforme des Correspondances."
#: apps/registration/templates/registration/logged_out.html:9
msgid "Log in again"
msgstr "Se reconnecter"
#: apps/registration/templates/registration/login.html:7
#: apps/registration/templates/registration/login.html:8
#: apps/registration/templates/registration/login.html:22
#: apps/registration/templates/registration/password_reset_complete.html:10
#: templates/base.html:105
msgid "Log in"
msgstr "Connexion"
#: apps/registration/templates/registration/login.html:13
#, python-format
msgid ""
"You are authenticated as %(user)s, but are not authorized to access this "
"page. Would you like to login to a different account?"
msgstr ""
"Vous êtes connectés en tant que %(user)s, mais n'êtes pas autorisés à "
"accéder à cette page. Voulez-vous vous reconnecter avec un autre compte ?"
#: apps/registration/templates/registration/login.html:23
msgid "Forgotten your password or username?"
msgstr "Mot de passe oublié ?"
#: apps/registration/templates/registration/mails/email_validation_email.html:12
#: apps/registration/templates/registration/mails/email_validation_email.txt:3
msgid "Hi"
msgstr "Bonjour"
#: apps/registration/templates/registration/mails/email_validation_email.html:16
#: apps/registration/templates/registration/mails/email_validation_email.txt:5
msgid ""
"You recently registered on the Correspondances platform. Please click on the "
"link below to confirm your registration."
msgstr ""
"Vous vous êtes inscrits sur la plateforme des Correspondances. Merci de "
"cliquer sur le lien ci-dessous pour confirmer votre inscription."
#: apps/registration/templates/registration/mails/email_validation_email.html:26
#: apps/registration/templates/registration/mails/email_validation_email.txt:9
msgid ""
"This link is only valid for a couple of days, after that you will need to "
"contact us to validate your email."
msgstr ""
"Ce lien n'est valide que pendant quelques jours, après cela vous devrez nous "
"contacter pour valider votre email."
#: apps/registration/templates/registration/mails/email_validation_email.html:30
#: apps/registration/templates/registration/mails/email_validation_email.txt:11
msgid "Thanks"
msgstr "Merci"
#: apps/registration/templates/registration/mails/email_validation_email.html:35
#: apps/registration/templates/registration/mails/email_validation_email.txt:13
msgid "The Correspondances team."
msgstr "L'équipe des Correspondances"
#: apps/registration/templates/registration/password_change_done.html:8
msgid "Your password was changed."
msgstr "Votre mot de passe a été changé."
#: apps/registration/templates/registration/password_change_form.html:9
msgid ""
"Please enter your old password, for security's sake, and then enter your new "
"password twice so we can verify you typed it in correctly."
msgstr ""
"Merci d'entrer votre ancien mot de passe pour des raisons de sécurité, et "
"d'entrer votre nouveau mot de passe deux fois afin de s'assurer que vous "
"l'ayez tapé correctement."
#: apps/registration/templates/registration/password_change_form.html:11
#: apps/registration/templates/registration/password_reset_confirm.html:12
msgid "Change my password"
msgstr "Changer mon mot de passe"
#: apps/registration/templates/registration/password_reset_complete.html:8
msgid "Your password has been set. You may go ahead and log in now."
msgstr "Votre mot de passe a été changé. Vous pouvez désormais vous connecter."
#: apps/registration/templates/registration/password_reset_confirm.html:9
msgid ""
"Please enter your new password twice so we can verify you typed it in "
"correctly."
msgstr ""
"Merci d'entrer votre nouveau mot de passe deux fois afin de vérifier que "
"vous l'ayez tapé correctement."
#: apps/registration/templates/registration/password_reset_confirm.html:15
msgid ""
"The password reset link was invalid, possibly because it has already been "
"used. Please request a new password reset."
msgstr ""
"Le lien de réinitialisation du mot de passe est invalide, probablement parce "
"qu'il a déjà été utilisé. Merci de demander une nouvelle réinitialisation du "
"mot de passe."
#: apps/registration/templates/registration/password_reset_done.html:8
msgid ""
"We've emailed you instructions for setting your password, if an account "
"exists with the email you entered. You should receive them shortly."
msgstr ""
"Nous vous avons envoyé un email contenant des instructions pour définir "
"votre mot de passe, si un compte existe avec l'adresse mail que vous avez "
"entrée. Vous devriez le recevoir très rapidement."
#: apps/registration/templates/registration/password_reset_done.html:9
msgid ""
"If you don't receive an email, please make sure you've entered the address "
"you registered with, and check your spam folder."
msgstr ""
"Si vous ne recevez pas de mail, merci de vous assurer que vous avez entré "
"l'adresse mail avec laquelle vous êtes inscrits, et de vérifier vos "
"courriers indésirables."
#: apps/registration/templates/registration/password_reset_form.html:8
msgid ""
"Forgotten your password? Enter your email address below, and we'll email "
"instructions for setting a new one."
msgstr ""
"Mot de passe oublié ? Entrez votre adresse mail ci-dessous, et nous vous "
"enverrons un mail avec les instructions pour en définir un nouveau."
#: apps/registration/templates/registration/password_reset_form.html:11
msgid "Reset my password"
msgstr "Réinitialiser mon mot de passe"
#: apps/registration/templates/registration/signup.html:5
#: apps/registration/templates/registration/signup.html:8
#: apps/registration/templates/registration/signup.html:20
msgid "Sign up"
msgstr "Inscription"
#: apps/registration/views.py:55
msgid "Email validation"
msgstr "Validation de l'adresse mail"
#: apps/registration/views.py:57
msgid "Validate email"
msgstr "Valider l'adresse mail"
#: apps/registration/views.py:96
msgid "Email validation unsuccessful"
msgstr "Échec de la validation de l'adresse mail"
#: apps/registration/views.py:107
msgid "Email validation email sent"
msgstr "Mail de confirmation de l'adresse mail envoyé"
#: apps/registration/views.py:115
msgid "Resend email validation link"
msgstr "Renvoyé le lien de validation de l'adresse mail"
#: corres2math/settings.py:148
msgid "English"
msgstr "Anglais"
@ -358,192 +567,30 @@ msgstr ""
msgid "Home"
msgstr "Accueil"
#: templates/base.html:74
#: templates/base.html:86
msgid "Make a gift"
msgstr "Faire un don"
#: templates/base.html:78
#: templates/base.html:90
msgid "Administration"
msgstr "Administration"
#: templates/base.html:85
#: templates/base.html:97
msgid "Return to admin view"
msgstr "Retourner à l'interface administrateur"
#: templates/base.html:90
#: templates/base.html:102
msgid "Register"
msgstr "S'inscrire"
#: templates/base.html:93 templates/registration/login.html:7
#: templates/registration/login.html:8 templates/registration/login.html:22
#: templates/registration/password_reset_complete.html:10
msgid "Log in"
msgstr "Connexion"
#: templates/base.html:97
#: templates/base.html:109
msgid "Log out"
msgstr "Déconnexion"
#: templates/base.html:121
#: templates/base.html:133
msgid "Contact us"
msgstr "Nous contacter"
#: templates/base.html:144
#: templates/base.html:156
msgid "Back to top"
msgstr "Retour en haut"
#: templates/registration/email_validation_complete.html:15
msgid "Your email have successfully been validated."
msgstr "Votre email a été validé avec succès."
#: templates/registration/email_validation_complete.html:18
#, python-format
msgid "You can now <a href=\"%(login_url)s\">log in</a>."
msgstr "Vous pouvez désormais vous <a href=\"%(login_url)s\">connecter</a>."
#: templates/registration/email_validation_complete.html:22
msgid ""
"The link was invalid. The token may have expired. Please send us an email to "
"activate your account."
msgstr ""
"Le lien est invalide. Le jeton a peut-être expiré. Merci de nous envoyer un "
"mail pour activer votre compte."
#: templates/registration/email_validation_email_sent.html:10
msgid "Account activation"
msgstr "Activation du compte"
#: templates/registration/email_validation_email_sent.html:14
msgid ""
"An email has been sent. Please click on the link to activate your account."
msgstr ""
"Un email a été envoyé. Merci de cliquer sur le lien pour activer votre "
"compte."
#: templates/registration/logged_out.html:8
msgid "Thanks for spending some quality time with the Web site today."
msgstr "Merci d'avoir utilisé la plateforme des Correspondances."
#: templates/registration/logged_out.html:9
msgid "Log in again"
msgstr "Se reconnecter"
#: templates/registration/login.html:13
#, python-format
msgid ""
"You are authenticated as %(user)s, but are not authorized to access this "
"page. Would you like to login to a different account?"
msgstr ""
"Vous êtes connectés en tant que %(user)s, mais n'êtes pas autorisés à "
"accéder à cette page. Voulez-vous vous reconnecter avec un autre compte ?"
#: templates/registration/login.html:23
msgid "Forgotten your password or username?"
msgstr "Mot de passe oublié ?"
#: templates/registration/mails/email_validation_email.html:12
#: templates/registration/mails/email_validation_email.txt:3
msgid "Hi"
msgstr "Bonjour"
#: templates/registration/mails/email_validation_email.html:16
#: templates/registration/mails/email_validation_email.txt:5
msgid ""
"You recently registered on the Correspondances platform. Please click on the "
"link below to confirm your registration."
msgstr ""
"Vous vous êtes inscrits sur la plateforme des Correspondances. Merci de "
"cliquer sur le lien ci-dessous pour confirmer votre inscription."
#: templates/registration/mails/email_validation_email.html:26
#: templates/registration/mails/email_validation_email.txt:9
msgid ""
"This link is only valid for a couple of days, after that you will need to "
"contact us to validate your email."
msgstr ""
"Ce lien n'est valide que pendant quelques jours, après cela vous devrez nous "
"contacter pour valider votre email."
#: templates/registration/mails/email_validation_email.html:30
#: templates/registration/mails/email_validation_email.txt:11
msgid "Thanks"
msgstr "Merci"
#: templates/registration/mails/email_validation_email.html:35
#: templates/registration/mails/email_validation_email.txt:13
msgid "The Correspondances team."
msgstr "L'équipe des Correspondances"
#: templates/registration/password_change_done.html:8
msgid "Your password was changed."
msgstr "Votre mot de passe a été changé."
#: templates/registration/password_change_form.html:9
msgid ""
"Please enter your old password, for security's sake, and then enter your new "
"password twice so we can verify you typed it in correctly."
msgstr ""
"Merci d'entrer votre ancien mot de passe pour des raisons de sécurité, et "
"d'entrer votre nouveau mot de passe deux fois afin de s'assurer que vous "
"l'ayez tapé correctement."
#: templates/registration/password_change_form.html:11
#: templates/registration/password_reset_confirm.html:12
msgid "Change my password"
msgstr "Changer mon mot de passe"
#: templates/registration/password_reset_complete.html:8
msgid "Your password has been set. You may go ahead and log in now."
msgstr "Votre mot de passe a été changé. Vous pouvez désormais vous connecter."
#: templates/registration/password_reset_confirm.html:9
msgid ""
"Please enter your new password twice so we can verify you typed it in "
"correctly."
msgstr ""
"Merci d'entrer votre nouveau mot de passe deux fois afin de vérifier que "
"vous l'ayez tapé correctement."
#: templates/registration/password_reset_confirm.html:15
msgid ""
"The password reset link was invalid, possibly because it has already been "
"used. Please request a new password reset."
msgstr ""
"Le lien de réinitialisation du mot de passe est invalide, probablement parce "
"qu'il a déjà été utilisé. Merci de demander une nouvelle réinitialisation du "
"mot de passe."
#: templates/registration/password_reset_done.html:8
msgid ""
"We've emailed you instructions for setting your password, if an account "
"exists with the email you entered. You should receive them shortly."
msgstr ""
"Nous vous avons envoyé un email contenant des instructions pour définir "
"votre mot de passe, si un compte existe avec l'adresse mail que vous avez "
"entrée. Vous devriez le recevoir très rapidement."
#: templates/registration/password_reset_done.html:9
msgid ""
"If you don't receive an email, please make sure you've entered the address "
"you registered with, and check your spam folder."
msgstr ""
"Si vous ne recevez pas de mail, merci de vous assurer que vous avez entré "
"l'adresse mail avec laquelle vous êtes inscrits, et de vérifier vos "
"courriers indésirables."
#: templates/registration/password_reset_form.html:8
msgid ""
"Forgotten your password? Enter your email address below, and we'll email "
"instructions for setting a new one."
msgstr ""
"Mot de passe oublié ? Entrez votre adresse mail ci-dessous, et nous vous "
"enverrons un mail avec les instructions pour en définir un nouveau."
#: templates/registration/password_reset_form.html:11
msgid "Reset my password"
msgstr "Réinitialiser mon mot de passe"
#: templates/registration/signup.html:5 templates/registration/signup.html:8
#: templates/registration/signup.html:20
msgid "Sign up"
msgstr "Inscription"

View File

@ -69,6 +69,18 @@
<li class="nav-item active">
<a href="{% url "index" %}" class="nav-link"><i class="fas fa-home"></i> {% trans "Home" %}</a>
</li>
{% if user.is_authenticated and user.registration.participates and not user.registration.team %}
<li class="nav-item active">
<a href="#" class="nav-link" data-toggle="modal" data-target="#createTeamModal">
<i class="fas fa-users"></i> {% trans "Create team" %}
</a>
</li>
<li class="nav-item active">
<a href="#" class="nav-link" data-toggle="modal" data-target="#joinTeamModal">
<i class="fas fa-users"></i> {% trans "Join team" %}
</a>
</li>
{% endif %}
<li class="nav-item active">
<a class="nav-link" href="https://www.helloasso.com/associations/animath/formulaires/5/widget"><i
class="fas fa-hand-holding-heart"></i> {% trans "Make a gift" %}</a>
@ -147,8 +159,26 @@
</div>
</footer>
{% if user.is_authenticated %}
{% include "participation/create_team_modal.html" %}
{% include "participation/join_team_modal.html" %}
{% endif %}
<script>
CSRF_TOKEN = "{{ csrf_token }}";
$(document).ready(function () {
$('a[data-target="#createTeamModal"]').click(function() {
let modalBody = $("#createTeamModal div.modal-body");
if (!modalBody.html().trim())
modalBody.load("{% url "participation:create_team" %} #form-content");
});
$('a[data-target="#joinTeamModal"]').click(function() {
let modalBody = $("#joinTeamModal div.modal-body");
if (!modalBody.html().trim())
modalBody.load("{% url "participation:join_team" %} #form-content");
});
});
</script>
{% block extrajavascript %}