1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-30 19:21:20 +02:00

Compare commits

..

3 Commits

Author SHA1 Message Date
0e7a275a28 Order participations by validity status and by trigram
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
2023-04-11 22:46:15 +02:00
59268f2d1e Add synthesis sheet template as DOCX format
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
2023-04-11 22:23:30 +02:00
2ad7799b38 Fix the display of the draw button
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
2023-04-11 22:20:15 +02:00
9 changed files with 52 additions and 18 deletions

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: TFJM\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-04-10 17:24+0200\n"
"POT-Creation-Date: 2023-04-11 22:22+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Emmy D'Anello <emmy.danello@animath.fr>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -477,7 +477,7 @@ msgstr "Ce trigramme est déjà utilisé."
msgid "No team was found with this access code."
msgstr "Aucune équipe n'a été trouvée avec ce code d'accès."
#: participation/forms.py:86 participation/forms.py:352
#: participation/forms.py:86 participation/forms.py:351
#: registration/forms.py:122 registration/forms.py:144
#: registration/forms.py:166 registration/forms.py:188
#: registration/forms.py:233
@ -502,7 +502,7 @@ msgstr "Message à adresser à l'équipe :"
msgid "The uploaded file size must be under 5 Mo."
msgstr "Le fichier envoyé doit peser moins de 5 Mo."
#: participation/forms.py:158 participation/forms.py:354
#: participation/forms.py:158 participation/forms.py:353
msgid "The uploaded file must be a PDF file."
msgstr "Le fichier envoyé doit être au format PDF."
@ -547,16 +547,16 @@ msgstr ""
msgid "The following note is higher of the maximum expected value:"
msgstr "La note suivante est supérieure au maximum attendu :"
#: participation/forms.py:318
#: participation/forms.py:317
msgid "The following user was not found:"
msgstr "L'utilisateur⋅rice suivant n'a pas été trouvé :"
#: participation/forms.py:335
#: participation/forms.py:334
msgid "The defender, the opponent and the reporter must be different."
msgstr ""
"Læ défenseur⋅se, l'opposant⋅e et læ rapporteur⋅e doivent être différent⋅es."
#: participation/forms.py:339
#: participation/forms.py:338
msgid "This defender did not work on this problem."
msgstr "Ce⋅tte défenseur⋅se ne travaille pas sur ce problème."
@ -1011,7 +1011,7 @@ msgstr "Envoyer une solution"
#: participation/templates/participation/upload_motivation_letter.html:13
#: participation/templates/participation/upload_notes.html:17
#: participation/templates/participation/upload_solution.html:11
#: participation/templates/participation/upload_synthesis.html:16
#: participation/templates/participation/upload_synthesis.html:17
#: registration/templates/registration/upload_health_sheet.html:17
#: registration/templates/registration/upload_parental_authorization.html:17
#: registration/templates/registration/upload_photo_authorization.html:18
@ -1472,6 +1472,10 @@ msgstr "Télécharger la fiche de notation vierge"
msgid "Templates:"
msgstr "Modèles :"
#: participation/templates/participation/upload_synthesis.html:12
msgid "Warning: non-free format"
msgstr "Attention : format non libre"
#: participation/views.py:52 tfjm/templates/base.html:73
#: tfjm/templates/base.html:256
msgid "Create team"
@ -1600,11 +1604,11 @@ msgstr "Læ juré⋅e {name} a été ajouté⋅e avec succès !"
msgid "The following user is not registered as a jury:"
msgstr "L'utilisateur⋅rice suivant n'est pas inscrit⋅e en tant que juré⋅e :"
#: participation/views.py:825
#: participation/views.py:829
msgid "Notes were successfully uploaded."
msgstr "Les notes ont bien été envoyées."
#: participation/views.py:1489
#: participation/views.py:1493
msgid "You can't upload a synthesis after the deadline."
msgstr "Vous ne pouvez pas envoyer de note de synthèse après la date limite."

View File

@ -0,0 +1,20 @@
# Generated by Django 4.2 on 2023-04-11 20:41
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("participation", "0007_note_observer_oral_passage_observer"),
]
operations = [
migrations.AlterModelOptions(
name="participation",
options={
"ordering": ("valid", "team__trigram"),
"verbose_name": "participation",
"verbose_name_plural": "participations",
},
),
]

View File

@ -341,6 +341,7 @@ class Participation(models.Model):
class Meta:
verbose_name = _("participation")
verbose_name_plural = _("participations")
ordering = ('valid', 'team__trigram',)
class Pool(models.Model):

View File

@ -54,6 +54,7 @@ class ParticipationTable(tables.Table):
}
model = Team
fields = ('name', 'trigram', 'valid',)
order = ('-valid',)
class TournamentTable(tables.Table):

View File

@ -7,8 +7,9 @@
<div id="form-content">
<div class="alert alert-info">
{% trans "Templates:" %}
<a class="alert-link" href="{% static "Fiche_synthèse.pdf" %}"> PDF</a> -
<a class="alert-link" href="{% static "Fiche_synthèse.tex" %}"> TEX</a>
<a class="alert-link" href="{% static "Fiche_synthèse.pdf" %}"> PDF</a>
<a class="alert-link" href="{% static "Fiche_synthèse.tex" %}"> TEX</a>
<a class="alert-link" href="{% static "Fiche_synthèse.docx" %}" title="{% trans "Warning: non-free format" %}"> DOCX</a>
</div>
{% csrf_token %}
{{ form|crispy }}

View File

@ -24,7 +24,7 @@ from django.utils.crypto import get_random_string
from django.utils.translation import gettext_lazy as _
from django.views.generic import CreateView, DetailView, FormView, RedirectView, TemplateView, UpdateView, View
from django.views.generic.edit import FormMixin, ProcessFormView
from django_tables2 import SingleTableView
from django_tables2 import SingleTableView, MultiTableMixin
from magic import Magic
from odf.opendocument import OpenDocumentSpreadsheet
from odf.style import Style, TableCellProperties, TableColumnProperties, TextProperties
@ -555,16 +555,24 @@ class TournamentUpdateView(VolunteerMixin, UpdateView):
return super().dispatch(request, *args, **kwargs)
class TournamentDetailView(DetailView):
class TournamentDetailView(MultiTableMixin, DetailView):
"""
Display tournament detail.
"""
model = Tournament
def dispatch(self, request, *args, **kwargs):
self.tables = [
ParticipationTable(self.get_object().participations.all()),
PoolTable(self.get_object().pools.order_by('id').all()),
]
return super().dispatch(request, *args, **kwargs)
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context["teams"] = ParticipationTable(self.object.participations.all())
context["pools"] = PoolTable(self.object.pools.order_by('id').all())
tables = context['tables']
context["teams"] = tables[0]
context["pools"] = tables[1]
notes = dict()
for participation in self.object.participations.all():

View File

@ -19,8 +19,7 @@ class RegistrationTable(tables.Table):
)
def order_type(self, queryset, desc):
types = ["volunteerregistration", "-volunteerregistration__admin", "participantregistration"]
return queryset.order_by(*(("-" if desc else "") + t for t in types)), True
return queryset.order_by(('-' if desc else '') + 'polymorphic_ctype'), True
class Meta:
attrs = {

Binary file not shown.

View File

@ -92,7 +92,7 @@
{% endif %}
{% endif %}
{% if user.is_authenticated %}
{% if user.is_volunteer or user.registration.team %}
{% if user.registration.is_volunteer or user.registration.team %}
<li class="nav-item active">
<a class="nav-link" href="{% url 'draw:index' %}">
<i class="fas fa-archive"></i> {% trans "Draw" %}