1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-29 18:31:10 +02:00

First interface to start draws

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello
2023-03-22 18:44:49 +01:00
parent 88823b5252
commit bde3758c50
8 changed files with 182 additions and 71 deletions

View File

@ -2,8 +2,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later
from django.contrib.auth.mixins import LoginRequiredMixin
from django.db.models import Q
from django.views.generic import TemplateView
from django.views.generic import TemplateView, DetailView
from participation.models import Tournament
@ -16,12 +15,18 @@ class DisplayView(LoginRequiredMixin, TemplateView):
reg = self.request.user.registration
if reg.is_admin:
tournaments = Tournament.objects.all()
tournaments = Tournament.objects.order_by('id').all()
elif reg.is_volunteer:
tournaments = reg.interesting_tournaments
tournaments = reg.interesting_tournaments.order_by('id').all()
else:
tournaments = [reg.team.participation.tournament]
context['tournaments'] = [{'id': t.id, 'name': t.name} for t in tournaments]
context['tournaments'] = tournaments
context['tournaments_simplified'] = [{'id': t.id, 'name': t.name} for t in tournaments]
return context
class DisplayContentView(LoginRequiredMixin, DetailView):
model = Tournament
template_name = 'draw/tournament_content.html'