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

Merge branch 'honza/mr9' into 'devel'

user_index: Přehlednější vstupní stránka pro účastníka

See merge request !67
parents 0e64d7f1 08dd1466
No related branches found
No related tags found
1 merge request!67user_index: Přehlednější vstupní stránka pro účastníka
......@@ -8,23 +8,39 @@
<table class="table">
<thead>
<tr>
<th title='ročník MO'>Roč.
<th title='kategorie'>Kat.
<th>Kategorie
<th>Kolo
<th>Oblast
<th>Stav
<th>Akce
<th>Stav účasti
<th>Stav soutěže
<th>Odkazy
<tbody>
{% for pion, contest, round in pions %}
{% set state = contest.ct_state() %}
<tr>
<td>{{ round.year }}
<td>{{ round.category }}
<td>{{ round.name }}
<td>{{ contest.place.name }}
<td class="text-center" style="font-size: 1.2em"><b>{{ round.category }}</b>
<td>{{ round.name }} {{ contest.place.name_locative() if contest.place.level > 0 else '' }}
<td>{{ pion.state.friendly_name() }}
<td>{{ contest.ct_long_state() }}
<td><div class="btn-group">
<a class='btn btn-xs btn-primary' href='{{ url_for('user_contest', id=contest.contest_id) }}'>Detail kola</a>
</div>
<td>
{% if contest.ct_task_statement_available() %}
<a class='btn btn-xs btn-success' href='{{ url_for('user_task_statement', id=contest.contest_id) }}'>Zadání</a>
{% endif %}
{% if state != RoundState.preparing %}
<a class='btn btn-xs btn-primary' href='{{ url_for('user_contest', id=contest.contest_id) }}'>
{% if state == RoundState.running %}
Odevzdat řešení
{% elif state == RoundState.grading %}
Odevzdaná řešení
{% elif state == RoundState.closed %}
Prohlédnout opravy
{% else %}
Detail kola
{% endif %}
</a>
{% endif %}
{% if state == RoundState.closed %}
<a class="btn btn-xs btn-warning" href='{{ url_for('public_score', contest_id=contest.contest_id) }}'>Výsledky</a>
{% endif %}
{% endfor %}
</table>
{% else %}
......
......@@ -37,6 +37,7 @@ def load_pcrs() -> List[Tuple[db.Participation, db.Contest, db.Round]]:
.join(db.Contest, db.Contest.master_contest_id == db.Participation.contest_id)
.join(db.Round)
.filter(db.Participation.user == g.user)
.filter(db.Round.year == mo.current_year)
.options(joinedload(db.Contest.place))
.order_by(db.Round.year.desc(), db.Round.category, db.Round.seq, db.Round.part)
.all())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment