mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-01-24 19:41:18 +00:00
Hugs
This commit is contained in:
parent
36bbe95fc3
commit
4093411260
@ -208,6 +208,10 @@ class Team(models.Model):
|
|||||||
return ['<a href="{url}">'.format(url=reverse_lazy("member:information", args=(user.pk,))) + str(user) + '</a>'
|
return ['<a href="{url}">'.format(url=reverse_lazy("member:information", args=(user.pk,))) + str(user) + '</a>'
|
||||||
for user in self.participants]
|
for user in self.participants]
|
||||||
|
|
||||||
|
@property
|
||||||
|
def future_tournament(self):
|
||||||
|
return Tournament.get_final() if self.selected_for_final else self.tournament
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def can_validate(self):
|
def can_validate(self):
|
||||||
# TODO In a normal time, team needs a motivation letter and authorizations.
|
# TODO In a normal time, team needs a motivation letter and authorizations.
|
||||||
|
@ -227,7 +227,10 @@ class SolutionsView(TeamMixin, BaseFormView, SingleTableView):
|
|||||||
|
|
||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
self.object_list = self.get_queryset()
|
self.object_list = self.get_queryset()
|
||||||
return super().get_context_data(**kwargs)
|
context = super().get_context_data(**kwargs)
|
||||||
|
context["now"] = timezone.now()
|
||||||
|
context["real_deadline"] = self.request.user.team.tournament.date_solutions + timedelta(minutes=30)
|
||||||
|
return context
|
||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
qs = super().get_queryset()
|
qs = super().get_queryset()
|
||||||
@ -341,7 +344,9 @@ class SynthesesView(TeamMixin, BaseFormView, SingleTableView):
|
|||||||
|
|
||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
self.object_list = self.get_queryset()
|
self.object_list = self.get_queryset()
|
||||||
return super().get_context_data(**kwargs)
|
context = super().get_context_data(**kwargs)
|
||||||
|
context["now"] = timezone.now()
|
||||||
|
return context
|
||||||
|
|
||||||
def form_valid(self, form):
|
def form_valid(self, form):
|
||||||
synthesis = form.instance
|
synthesis = form.instance
|
||||||
|
@ -4,6 +4,20 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% if form %}
|
{% if form %}
|
||||||
|
{% if now < user.team.future_tournament.date_solutions %}
|
||||||
|
<div class="alert alert-warning">
|
||||||
|
{% blocktrans with deadline=user.team.future_tournament.date_solutions %}You can upload your solutions until {{ deadline }}.{% endblocktrans %}
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
|
<div class="alert alert-danger">
|
||||||
|
{% if now < real_deadline %}
|
||||||
|
{% trans "The deadline to send your solutions is reached. However, you have an extra time of 30 minutes to send your papers, no panic :)" %}
|
||||||
|
{% else %}
|
||||||
|
{% trans "You can't upload your solutions anymore." %}
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<form method="post" enctype="multipart/form-data">
|
<form method="post" enctype="multipart/form-data">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
{{ form|crispy }}
|
{{ form|crispy }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user