1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-12-24 03:02:23 +00:00

Add single tournament mode

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello 2024-06-07 15:18:59 +02:00
parent 85b3da09f6
commit ec2fa43e20
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
4 changed files with 19 additions and 4 deletions

View File

@ -1,7 +1,10 @@
from django.conf import settings
from participation.models import Tournament
def tfjm_context(request):
return {
'TFJM_APP': settings.TFJM_APP,
'SINGLE_TOURNAMENT': Tournament.objects.first() if Tournament.objects.exists() and settings.TFJM_APP else None,
}

View File

@ -212,9 +212,14 @@ PIPELINE = {
},
'output_filename': 'tfjm/js/bootstrap.bundle.min.js',
},
'bootstrap_select': {
'jquery': {
'source_filenames': {
'jquery/jquery.min.js',
},
'output_filename': 'tfjm/js/jquery.min.js',
},
'bootstrap_select': {
'source_filenames': {
'bootstrap-select/js/bootstrap-select.min.js',
'bootstrap-select/js/defaults-fr_FR.min.js',
},

View File

@ -25,6 +25,7 @@
{# Bootstrap JavaScript #}
{% javascript 'bootstrap' %}
{# bootstrap-select for beautiful selects and JQuery dependency #}
{% javascript 'jquery' %}
{% javascript 'bootstrap_select' %}
{# Si un formulaire requiert des données supplémentaires (notamment JS), les données sont chargées #}

View File

@ -19,9 +19,15 @@
<a href="{% url "index" %}" class="nav-link"><i class="fas fa-home"></i> {% trans "Home" %}</a>
</li>
<li class="nav-item active">
<a href="#" class="nav-link" data-bs-toggle="modal" data-bs-target="#tournamentListModal">
<i class="fas fa-calendar-day"></i> {% trans "Tournaments" %}
</a>
{% if SINGLE_TOURNAMENT %}
<a href="{% url 'participation:tournament_detail' pk=SINGLE_TOURNAMENT.pk %}" class="nav-link">
<i class="fas fa-calendar-day"></i> {% trans "Tournament" %}
</a>
{% else %}
<a href="#" class="nav-link" data-bs-toggle="modal" data-bs-target="#tournamentListModal">
<i class="fas fa-calendar-day"></i> {% trans "Tournaments" %}
</a>
{% endif %}
</li>
{% if user.is_authenticated and user.registration.is_admin %}
<li class="nav-item active">