Add single tournament mode
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
parent
85b3da09f6
commit
ec2fa43e20
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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',
|
||||
},
|
||||
|
|
|
@ -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 #}
|
||||
|
|
|
@ -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">
|
||||
{% 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">
|
||||
|
|
Loading…
Reference in New Issue