From 324e2b6a4dc8aaaf2cb7b1b1618eacf7dcc97795 Mon Sep 17 00:00:00 2001
From: Martin Mares <mj@ucw.cz>
Date: Tue, 28 Sep 2021 20:46:48 +0200
Subject: [PATCH] =?UTF-8?q?UI=20k=20=C3=BAloh=C3=A1m=20zobrazuje/edituje?=
=?UTF-8?q?=20typy=20=C3=BAloh?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
mo/web/org_round.py | 1 +
mo/web/templates/org_contest.html | 6 ++++--
mo/web/templates/org_round.html | 2 ++
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/mo/web/org_round.py b/mo/web/org_round.py
index 5a12dbe9..dae1272b 100644
--- a/mo/web/org_round.py
+++ b/mo/web/org_round.py
@@ -284,6 +284,7 @@ class TaskEditForm(FlaskForm):
validators.Regexp(r'^[A-Za-z0-9-]+$', message="Kód úlohy smí obsahovat jen nediakritická písmena, čísla a znak -"),
], render_kw={'autofocus': True})
name = wtforms.StringField('Název úlohy')
+ type = wtforms.SelectField('Typ úlohy', choices=db.TaskType.choices(), coerce=db.TaskType.coerce)
max_points = mo_fields.Points(
'Maximum bodů', validators=[validators.Optional(), validators.NumberRange(min=0)],
description="Při nastavení maxima nelze udělit více bodů, pro zrušení uložte prázdnou hodnotu",
diff --git a/mo/web/templates/org_contest.html b/mo/web/templates/org_contest.html
index 0042d9ed..cbef413b 100644
--- a/mo/web/templates/org_contest.html
+++ b/mo/web/templates/org_contest.html
@@ -119,8 +119,9 @@
<tr>
<th>Kód
<th>Název
- <th>Odevzdaná řešení
- <th>Maximum bodů
+ <th>Typ
+ <th>Odevzdáno
+ <th>Max. bodů
<th>Jednotlivé akce
<th>Dávkové operace
</tr>
@@ -129,6 +130,7 @@
<tr>
<td>{{ task.code }}
<td>{{ task.name }}
+ <td>{{ task.type.friendly_name() }}
<td>{{ task.sol_count }}
<td>{{ task.max_points|decimal|none_value('–') }}
<td><div class="btn-group">
diff --git a/mo/web/templates/org_round.html b/mo/web/templates/org_round.html
index ddb74769..6d8ed7d1 100644
--- a/mo/web/templates/org_round.html
+++ b/mo/web/templates/org_round.html
@@ -173,6 +173,7 @@
<tr>
<th>Kód
<th>Název
+ <th>Typ
<th>Odevzdaná řešení
<th>Maximum bodů
{% if can_manage_round %}<th>Akce{% endif %}
@@ -183,6 +184,7 @@
<tr>
<td>{{ task.code }}
<td>{{ task.name }}
+ <td>{{ task.type.friendly_name() }}
<td>{{ sol_count }}
<td>{{ task.max_points|decimal|none_value('–') }}
{% if can_manage_round %}
--
GitLab