Skip to content
Snippets Groups Projects
Commit 45abcdcc authored by Jan Prachař's avatar Jan Prachař
Browse files

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

Přidán odkaz na veřejnou výsledkovou listinu.
parent 6de80886
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,37 @@ ...@@ -8,23 +8,37 @@
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
<th title='ročník MO'>Roč. <th>Kategorie
<th title='kategorie'>Kat.
<th>Kolo <th>Kolo
<th>Oblast
<th>Stav <th>Stav
<th>Akce <th>Odkazy
<tbody> <tbody>
{% for pion, contest, round in pions %} {% for pion, contest, round in pions %}
{% set state = contest.ct_state() %}
<tr> <tr>
<td>{{ round.year }} <td class="text-center" style="font-size: 1.2em"><b>{{ round.category }}</b>
<td>{{ round.category }} <td>{{ round.name }} {{ contest.place.name_locativ() if contest.place.level > 0 else '' }}
<td>{{ round.name }}
<td>{{ contest.place.name }}
<td>{{ contest.ct_long_state() }} <td>{{ contest.ct_long_state() }}
<td><div class="btn-group"> <td>
<a class='btn btn-xs btn-primary' href='{{ url_for('user_contest', id=contest.contest_id) }}'>Detail kola</a> {% if contest.ct_task_statement_available() %}
</div> <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 %} {% endfor %}
</table> </table>
{% else %} {% else %}
......
...@@ -37,6 +37,7 @@ def load_pcrs() -> List[Tuple[db.Participation, db.Contest, db.Round]]: ...@@ -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.Contest, db.Contest.master_contest_id == db.Participation.contest_id)
.join(db.Round) .join(db.Round)
.filter(db.Participation.user == g.user) .filter(db.Participation.user == g.user)
.filter(db.Round.year == mo.current_year)
.options(joinedload(db.Contest.place)) .options(joinedload(db.Contest.place))
.order_by(db.Round.year.desc(), db.Round.category, db.Round.seq, db.Round.part) .order_by(db.Round.year.desc(), db.Round.category, db.Round.seq, db.Round.part)
.all()) .all())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment