diff --git a/tfjm/context_processors.py b/tfjm/context_processors.py index f5d4c80..7a979e9 100644 --- a/tfjm/context_processors.py +++ b/tfjm/context_processors.py @@ -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, } diff --git a/tfjm/settings.py b/tfjm/settings.py index 759cae7..7eac8d8 100644 --- a/tfjm/settings.py +++ b/tfjm/settings.py @@ -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', }, diff --git a/tfjm/templates/base.html b/tfjm/templates/base.html index a35dd6c..4a392c5 100644 --- a/tfjm/templates/base.html +++ b/tfjm/templates/base.html @@ -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 #} diff --git a/tfjm/templates/navbar.html b/tfjm/templates/navbar.html index 2227c5d..4add947 100644 --- a/tfjm/templates/navbar.html +++ b/tfjm/templates/navbar.html @@ -19,9 +19,15 @@ {% trans "Home" %} {% if user.is_authenticated and user.registration.is_admin %}