From c74cabb57362f46d6a7fc4697cd838d30870b590 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Setni=C4=8Dka?= <setnicka@seznam.cz> Date: Sun, 14 Nov 2021 14:20:44 +0100 Subject: [PATCH] =?UTF-8?q?Odkaz=20na=20sout=C4=9B=C5=BE=20z=20tabulky=20?= =?UTF-8?q?=C3=BA=C4=8Dastn=C3=ADk=C5=AF=20kola?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue #241 --- mo/web/org_contest.py | 4 ++-- mo/web/table.py | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mo/web/org_contest.py b/mo/web/org_contest.py index 83e7f661..6ad6f10a 100644 --- a/mo/web/org_contest.py +++ b/mo/web/org_contest.py @@ -26,7 +26,7 @@ from mo.web import app import mo.web.fields as mo_fields import mo.web.util from mo.web.util import PagerForm -from mo.web.table import CellCheckbox, Table, Row, Column, cell_pion_link, cell_place_link, cell_email_link, cell_email_link_flags +from mo.web.table import CellCheckbox, Table, Row, Column, cell_contest_place_link, cell_pion_link, cell_place_link, cell_email_link, cell_email_link_flags import wtforms.validators as validators from wtforms.widgets.html5 import NumberInput @@ -529,7 +529,7 @@ def make_contestant_table(query: Query, round: db.Round, add_checkbox: bool = Fa 'grade': pant.grade, 'born_year': pant.birth_year, 'region_code': cell_place_link(ct.place, ct.place.get_code()), - 'place_code': cell_place_link(pion.place, pion.place.get_code()), + 'place_code': cell_contest_place_link(ct, pion.place, pion.place.get_code()), 'status': pion.state.friendly_name(), 'checkbox': CellCheckbox('checked', u.user_id, False), }, diff --git a/mo/web/table.py b/mo/web/table.py index 72cbbcd1..a2f82605 100644 --- a/mo/web/table.py +++ b/mo/web/table.py @@ -215,3 +215,7 @@ def cell_pion_link(user: db.User, contest_id: int, text: str) -> CellLink: def cell_place_link(place: db.Place, text: str) -> CellLink: return CellLink(text, url_for('org_place', id=place.place_id), hint=place.name) + + +def cell_contest_place_link(contest: db.Contest, place: db.Place, text: str) -> CellLink: + return CellLink(text, url_for('org_contest', ct_id=contest.contest_id, site_id=place.place_id), hint=place.name) -- GitLab