mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-06-23 12:36:35 +02:00
Add team table
This commit is contained in:
@ -70,7 +70,11 @@
|
||||
<a href="#" class="nav-link" data-toggle="modal" data-target="#calendarModal"><i class="fas fa-calendar"></i> {% trans "Calendar" %}</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% if user.is_authenticated and user.registration.participates %}
|
||||
{% if user.is_authenticated and user.registration.is_admin %}
|
||||
<li class="nav-item active">
|
||||
<a href="#" class="nav-link" data-toggle="modal" data-target="#teamsModal"><i class="fas fa-users"></i> {% trans "Teams" %}</a>
|
||||
</li>
|
||||
{% elif user.is_authenticated and user.registration.participates %}
|
||||
{% if not user.registration.team %}
|
||||
<li class="nav-item active">
|
||||
<a href="#" class="nav-link" data-toggle="modal" data-target="#createTeamModal">
|
||||
@ -216,21 +220,28 @@
|
||||
|
||||
{% trans "Calendar" as modal_title %}
|
||||
{% include "base_modal.html" with modal_id="calendar" modal_additional_class="modal-lg" %}
|
||||
{% trans "Search results" as modal_title %}
|
||||
{% include "base_modal.html" with modal_id="search" modal_form_method="get" modal_additional_class="modal-lg" %}
|
||||
{% trans "Log in" as modal_title %}
|
||||
{% trans "Log in" as modal_button %}
|
||||
{% url "login" as modal_action %}
|
||||
{% include "base_modal.html" with modal_id="login" %}
|
||||
|
||||
{% if user.is_authenticated %}
|
||||
{% trans "All teams" as modal_title %}
|
||||
{% include "base_modal.html" with modal_id="teams" modal_additional_class="modal-lg" %}
|
||||
|
||||
{% trans "Search results" as modal_title %}
|
||||
{% include "base_modal.html" with modal_id="search" modal_form_method="get" modal_additional_class="modal-lg" %}
|
||||
|
||||
{% trans "Join team" as modal_title %}
|
||||
{% trans "Join" as modal_button %}
|
||||
{% url "participation:join_team" as modal_action %}
|
||||
|
||||
{% include "base_modal.html" with modal_id="joinTeam" %}
|
||||
{% trans "Create team" as modal_title %}
|
||||
{% trans "Create" as modal_button %}
|
||||
{% url "participation:create_team" as modal_action %}
|
||||
{% include "base_modal.html" with modal_id="createTeam" modal_button_type="success" %}
|
||||
{% else %}
|
||||
{% trans "Log in" as modal_title %}
|
||||
{% trans "Log in" as modal_button %}
|
||||
{% url "login" as modal_action %}
|
||||
{% include "base_modal.html" with modal_id="login" %}
|
||||
{% endif %}
|
||||
|
||||
<script>
|
||||
@ -243,26 +254,39 @@
|
||||
if (!modalBody.html().trim())
|
||||
modalBody.load("{% url "participation:calendar" %} #form-content")
|
||||
});
|
||||
$('button[data-target="#searchModal"]').click(function() {
|
||||
let modalBody = $("#searchModal div.modal-body");
|
||||
let q = encodeURI($("#search-term").val());
|
||||
modalBody.load("{% url "haystack_search" %}?q=" + q + " #search-results");
|
||||
});
|
||||
{% if user.is_authenticated and user.registration.is_admin %}
|
||||
$('a[data-target="#teamsModal"]').click(function() {
|
||||
let modalBody = $("#teamsModal div.modal-body");
|
||||
if (!modalBody.html().trim())
|
||||
modalBody.load("{% url "participation:team_list" %} #form-content")
|
||||
});
|
||||
$('button[data-target="#searchModal"]').click(function() {
|
||||
let modalBody = $("#searchModal div.modal-body");
|
||||
let q = encodeURI($("#search-term").val());
|
||||
modalBody.load("{% url "haystack_search" %}?q=" + q + " #search-results");
|
||||
});
|
||||
{% endif %}
|
||||
|
||||
{% if not user.is_authenticated %}
|
||||
$('a[data-target="#loginModal"]').click(function() {
|
||||
let modalBody = $("#loginModal div.modal-body");
|
||||
if (!modalBody.html().trim())
|
||||
modalBody.load("{% url "login" %} #form-content")
|
||||
});
|
||||
$('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");
|
||||
});
|
||||
let modalBody = $("#loginModal div.modal-body");
|
||||
if (!modalBody.html().trim())
|
||||
modalBody.load("{% url "login" %} #form-content")
|
||||
});
|
||||
{% endif %}
|
||||
|
||||
{% if user.is_authenticated and user.registration.participates and not user.registration.team %}
|
||||
$('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");
|
||||
});
|
||||
{% endif %}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
Reference in New Issue
Block a user