diff --git a/apps/participation/forms.py b/apps/participation/forms.py index cce1358..1b9a974 100644 --- a/apps/participation/forms.py +++ b/apps/participation/forms.py @@ -101,8 +101,12 @@ class TournamentForm(forms.ModelForm): format=formats.get_format_lazy(format_type="DATETIME_INPUT_FORMATS", use_l10n=True)[0]) self.fields["solution_limit"].widget = DateTimePickerInput( format=formats.get_format_lazy(format_type="DATETIME_INPUT_FORMATS", use_l10n=True)[0]) + self.fields["solutions_draw"].widget = DateTimePickerInput( + format=formats.get_format_lazy(format_type="DATETIME_INPUT_FORMATS", use_l10n=True)[0]) self.fields["syntheses_first_phase_limit"].widget = DateTimePickerInput( format=formats.get_format_lazy(format_type="DATETIME_INPUT_FORMATS", use_l10n=True)[0]) + self.fields["solutions_available_second_phase"].widget = DateTimePickerInput( + format=formats.get_format_lazy(format_type="DATETIME_INPUT_FORMATS", use_l10n=True)[0]) self.fields["syntheses_second_phase_limit"].widget = DateTimePickerInput( format=formats.get_format_lazy(format_type="DATETIME_INPUT_FORMATS", use_l10n=True)[0]) diff --git a/apps/participation/migrations/0004_tournament_price.py b/apps/participation/migrations/0004_tournament_price.py new file mode 100644 index 0000000..d6ad916 --- /dev/null +++ b/apps/participation/migrations/0004_tournament_price.py @@ -0,0 +1,18 @@ +# Generated by Django 3.0.11 on 2021-01-01 10:39 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('participation', '0003_tournament_max_teams'), + ] + + operations = [ + migrations.AddField( + model_name='tournament', + name='price', + field=models.PositiveSmallIntegerField(default=21, verbose_name='price'), + ), + ] diff --git a/apps/participation/migrations/0005_auto_20210101_1149.py b/apps/participation/migrations/0005_auto_20210101_1149.py new file mode 100644 index 0000000..909c5fc --- /dev/null +++ b/apps/participation/migrations/0005_auto_20210101_1149.py @@ -0,0 +1,24 @@ +# Generated by Django 3.0.11 on 2021-01-01 10:49 + +from django.db import migrations, models +import django.utils.timezone + + +class Migration(migrations.Migration): + + dependencies = [ + ('participation', '0004_tournament_price'), + ] + + operations = [ + migrations.AddField( + model_name='tournament', + name='solutions_available_second_phase', + field=models.DateTimeField(default=django.utils.timezone.now, verbose_name='date when the solutions for the second round become available'), + ), + migrations.AddField( + model_name='tournament', + name='solutions_draw', + field=models.DateTimeField(default=django.utils.timezone.now, verbose_name='random draw for solutions'), + ), + ] diff --git a/apps/participation/models.py b/apps/participation/models.py index f81dcda..c405c3d 100644 --- a/apps/participation/models.py +++ b/apps/participation/models.py @@ -143,6 +143,11 @@ class Tournament(models.Model): default=9, ) + price = models.PositiveSmallIntegerField( + verbose_name=_("price"), + default=21, + ) + inscription_limit = models.DateTimeField( verbose_name=_("limit date for registrations"), default=timezone.now, @@ -153,11 +158,21 @@ class Tournament(models.Model): default=timezone.now, ) + solutions_draw = models.DateTimeField( + verbose_name=_("random draw for solutions"), + default=timezone.now, + ) + syntheses_first_phase_limit = models.DateTimeField( verbose_name=_("limit date to upload the syntheses for the first phase"), default=timezone.now, ) + solutions_available_second_phase = models.DateTimeField( + verbose_name=_("date when the solutions for the second round become available"), + default=timezone.now, + ) + syntheses_second_phase_limit = models.DateTimeField( verbose_name=_("limit date to upload the syntheses for the second phase"), default=timezone.now, diff --git a/apps/participation/tables.py b/apps/participation/tables.py index 11d517d..e3ebd0e 100644 --- a/apps/participation/tables.py +++ b/apps/participation/tables.py @@ -16,17 +16,12 @@ class TeamTable(tables.Table): verbose_name=lambda: _("name").capitalize(), ) - problem = tables.Column( - accessor="participation__problem", - verbose_name=lambda: _("problem number").capitalize(), - ) - class Meta: attrs = { 'class': 'table table condensed table-striped', } model = Team - fields = ('name', 'trigram', 'problem',) + fields = ('name', 'trigram',) template_name = 'django_tables2/bootstrap4.html' @@ -44,16 +39,12 @@ class ParticipationTable(tables.Table): accessor="team__trigram", ) - problem = tables.Column( - verbose_name=lambda: _("problem number").capitalize(), - ) - class Meta: attrs = { 'class': 'table table condensed table-striped', } model = Team - fields = ('name', 'trigram', 'problem',) + fields = ('name', 'trigram', 'valid',) template_name = 'django_tables2/bootstrap4.html' diff --git a/apps/participation/templates/participation/tournament_detail.html b/apps/participation/templates/participation/tournament_detail.html new file mode 100644 index 0000000..81523c8 --- /dev/null +++ b/apps/participation/templates/participation/tournament_detail.html @@ -0,0 +1,63 @@ +{% extends "base.html" %} + +{% load getconfig i18n django_tables2 %} + +{% block content %} +