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 django.conf import settings
|
||||||
|
|
||||||
|
from participation.models import Tournament
|
||||||
|
|
||||||
|
|
||||||
def tfjm_context(request):
|
def tfjm_context(request):
|
||||||
return {
|
return {
|
||||||
'TFJM_APP': settings.TFJM_APP,
|
'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',
|
'output_filename': 'tfjm/js/bootstrap.bundle.min.js',
|
||||||
},
|
},
|
||||||
'bootstrap_select': {
|
'jquery': {
|
||||||
'source_filenames': {
|
'source_filenames': {
|
||||||
'jquery/jquery.min.js',
|
'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/bootstrap-select.min.js',
|
||||||
'bootstrap-select/js/defaults-fr_FR.min.js',
|
'bootstrap-select/js/defaults-fr_FR.min.js',
|
||||||
},
|
},
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
{# Bootstrap JavaScript #}
|
{# Bootstrap JavaScript #}
|
||||||
{% javascript 'bootstrap' %}
|
{% javascript 'bootstrap' %}
|
||||||
{# bootstrap-select for beautiful selects and JQuery dependency #}
|
{# bootstrap-select for beautiful selects and JQuery dependency #}
|
||||||
|
{% javascript 'jquery' %}
|
||||||
{% javascript 'bootstrap_select' %}
|
{% javascript 'bootstrap_select' %}
|
||||||
|
|
||||||
{# Si un formulaire requiert des données supplémentaires (notamment JS), les données sont chargées #}
|
{# 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>
|
<a href="{% url "index" %}" class="nav-link"><i class="fas fa-home"></i> {% trans "Home" %}</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item active">
|
<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">
|
<a href="#" class="nav-link" data-bs-toggle="modal" data-bs-target="#tournamentListModal">
|
||||||
<i class="fas fa-calendar-day"></i> {% trans "Tournaments" %}
|
<i class="fas fa-calendar-day"></i> {% trans "Tournaments" %}
|
||||||
</a>
|
</a>
|
||||||
|
{% endif %}
|
||||||
</li>
|
</li>
|
||||||
{% if user.is_authenticated and user.registration.is_admin %}
|
{% if user.is_authenticated and user.registration.is_admin %}
|
||||||
<li class="nav-item active">
|
<li class="nav-item active">
|
||||||
|
|
Loading…
Reference in New Issue