Skip to content
Snippets Groups Projects
Commit d4c91749 authored by Martin Mareš's avatar Martin Mareš
Browse files

Zobrazování stavu kola (též na stránce soutěže)

parent c81a8a06
No related branches found
No related tags found
1 merge request!9WIP: Zárodek uživatelské části webu a submitování
...@@ -35,6 +35,20 @@ root_logger.setLevel(logging.DEBUG) ...@@ -35,6 +35,20 @@ root_logger.setLevel(logging.DEBUG)
locale.setlocale(locale.LC_COLLATE, 'cs_CZ.UTF-8') locale.setlocale(locale.LC_COLLATE, 'cs_CZ.UTF-8')
# Naše filtry pro Jinju
def filter_timeformat(dt):
if dt is None:
return ''
else:
return dt.astimezone().strftime("%Y-%m-%d %H:%M")
app.jinja_env.filters['timeformat'] = filter_timeformat
# Inicializace požadavků a nucená autorizace
class NeedLoginError(werkzeug.exceptions.Forbidden): class NeedLoginError(werkzeug.exceptions.Forbidden):
description = 'Need to log in' description = 'Need to log in'
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<title>Odevzdávací systém MO</title> <title>Odevzdávací systém MO</title>
<link rel=stylesheet href="{{ url_for('static', filename='bootstrap.min.css') }}" type='text/css' media=all> <link rel=stylesheet href="{{ url_for('static', filename='bootstrap.min.css') }}" type='text/css' media=all>
<link rel=stylesheet href="{{ url_for('static', filename='mo.css') }}?v=1" type='text/css' media=all> <link rel=stylesheet href="{{ url_for('static', filename='mo.css') }}?v=2" type='text/css' media=all>
{% block head %}{% endblock %} {% block head %}{% endblock %}
</head> </head>
<body> <body>
......
...@@ -8,6 +8,10 @@ ...@@ -8,6 +8,10 @@
<tr><td>Pořadí<td>{{ contest.round.seq }} <tr><td>Pořadí<td>{{ contest.round.seq }}
<tr><td>Název<td>{{ contest.round.name }} <tr><td>Název<td>{{ contest.round.name }}
<tr><td>Oblast<td><a href='{{ url_for('org_place', id=contest.place.place_id) }}'>{{ contest.place.name }}</a> <tr><td>Oblast<td><a href='{{ url_for('org_place', id=contest.place.place_id) }}'>{{ contest.place.name }}</a>
<tr><td>Stav<td class='rstate-{{contest.round.state.name}}'>{{ contest.round.state.friendly_name() }}
<tr><td>Začátek odevzdávání<td>{{ contest.round.submit_start|timeformat }}
<tr><td>Konec pro účastníky<td>{{ contest.round.ct_submit_end|timeformat }}
<tr><td>Konec pro dozor<td>{{ contest.round.pr_submit_end|timeformat }}
</table> </table>
{% if can_manage %} {% if can_manage %}
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<th>Pořadí <th>Pořadí
<th>Oblast <th>Oblast
<th>Název <th>Název
<th>Stav
</thead> </thead>
{% for r in rounds %} {% for r in rounds %}
<tr> <tr>
...@@ -19,6 +20,7 @@ ...@@ -19,6 +20,7 @@
<td>{{ r.seq }} <td>{{ r.seq }}
<td>{{ level_names[r.level] }} <td>{{ level_names[r.level] }}
<td>{{ r.name }} <td>{{ r.name }}
<td class='rstate-{{r.state.name}}'>{{ r.state.friendly_name() }}
{% endfor %} {% endfor %}
</table> </table>
{% endblock %} {% endblock %}
...@@ -8,6 +8,10 @@ ...@@ -8,6 +8,10 @@
<tr><td>Pořadí<td>{{ round.seq }} <tr><td>Pořadí<td>{{ round.seq }}
<tr><td>Název<td>{{ round.name }} <tr><td>Název<td>{{ round.name }}
<tr><td>Oblast<td>{{ level_names[round.level] }} <tr><td>Oblast<td>{{ level_names[round.level] }}
<tr><td>Stav<td class='rstate-{{round.state.name}}'>{{ round.state.friendly_name() }}
<tr><td>Začátek odevzdávání<td>{{ round.submit_start|timeformat }}
<tr><td>Konec pro účastníky<td>{{ round.ct_submit_end|timeformat }}
<tr><td>Konec pro dozor<td>{{ round.pr_submit_end|timeformat }}
</table> </table>
{% if can_manage %} {% if can_manage %}
......
...@@ -68,3 +68,21 @@ nav#main-menu a.active { ...@@ -68,3 +68,21 @@ nav#main-menu a.active {
content:"*"; content:"*";
color:red; color:red;
} }
/* Round states */
.rstate-preparing {
color: red;
}
.rstate-running {
color: green;
}
.rstate-grading {
color: magenta;
}
.rstate-closed {
color: black;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment