1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-07-03 19:22:51 +02:00

Send solutions

This commit is contained in:
Yohann D'ANELLO
2020-05-04 23:37:21 +02:00
parent 9499e10524
commit 26eacad2fd
9 changed files with 118 additions and 21 deletions

View File

@ -2,6 +2,7 @@ import django_tables2 as tables
from django.utils.translation import gettext as _
from django_tables2 import A
from member.models import Solution
from .models import Tournament, Team
@ -41,6 +42,39 @@ class TeamTable(tables.Table):
class SolutionTable(tables.Table):
team = tables.LinkColumn(
"tournament:team_detail",
args=[A("team.pk")],
)
tournament = tables.LinkColumn(
"tournament:detail",
args=[A("team.tournament.pk")],
accessor=A("team.tournament"),
)
file = tables.LinkColumn(
"document",
args=[A("file")],
attrs={
"a": {
"data-turbolinks": "false",
}
}
)
def render_file(self):
return _("Download")
class Meta:
model = Solution
fields = ("team", "tournament", "problem", "uploaded_at", "file", )
attrs = {
'class': 'table table-condensed table-striped table-hover'
}
class SynthesisTable(tables.Table):
file = tables.LinkColumn(
"document",
args=[A("file")],
@ -56,7 +90,7 @@ class SolutionTable(tables.Table):
class Meta:
model = Team
fields = ("team", "team.tournament", "problem", "uploaded_at", "file", )
fields = ("team", "team.tournament", "round", "dest", "uploaded_at", "file", )
attrs = {
'class': 'table table-condensed table-striped table-hover'
}