Teams tab is only accessible to admins

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello 2024-02-23 21:48:39 +01:00
parent de504398d2
commit 5cbc72b41f
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
2 changed files with 2 additions and 6 deletions

View File

@ -68,9 +68,6 @@
{% include "base_modal.html" with modal_id="tournamentList" modal_additional_class="modal-lg" %}
{% 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" %}
@ -101,7 +98,6 @@
initModal("tournamentList", "{% url "participation:tournament_list" %}")
{% if user.is_authenticated and user.registration.is_admin %}
initModal("teams", "{% url "participation:team_list" %}")
initModal("search",
() => "{% url "haystack_search" %}?q=" + encodeURI(document.getElementById("search-term").value),
"search-results")

View File

@ -21,12 +21,12 @@
<i class="fas fa-calendar-day"></i> {% trans "Tournaments" %}
</a>
</li>
{% if user.is_authenticated and user.registration.is_volunteer %}
{% if user.is_authenticated and user.registration.is_admin %}
<li class="nav-item active">
<a href="{% url "registration:user_list" %}" class="nav-link"><i class="fas fa-user"></i> {% trans "Users" %}</a>
</li>
<li class="nav-item active">
<a href="#" class="nav-link" data-bs-toggle="modal" data-bs-target="#teamsModal"><i class="fas fa-users"></i> {% trans "Teams" %}</a>
<a href="{% url "participation:team_list" %}" class="nav-link"><i class="fas fa-users"></i> {% trans "Teams" %}</a>
</li>
{% elif user.is_authenticated and user.registration.participates %}
{% if not user.registration.team %}