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:
@ -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'
|
||||
}
|
||||
|
Reference in New Issue
Block a user