Skip to content
Snippets Groups Projects

Tabulka Moje soutěže

Closed Jan Prachař requested to merge honza/mr7 into devel
3 files
+ 68
52
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -6,51 +6,49 @@
<h3>Moje soutěže</h3>
<table class="table table-bordered">
{% set curr = namespace(level = -1) %}
{% for c, role in contests %}
{% set cr = gatekeeper.rights_for_contest(c) %}
{% if curr.level != c.round.level %}
<thead><tr>
<th>Kategorie
<th>Kolo
<th>{{ c.round.get_level().name|capitalize }}
<th>Stav
<th>Zadání
<th>Moje role
<th>Odkazy
</thead>
{% for c,role,r in contests %}
{% set rr = gatekeeper.rights_for_contest(c) %}
{% if c.state == RoundState.preparing %}
<tr class="warning">
{% elif c.state == RoundState.running %}
<tr class="success">
{% elif c.state == RoundState.grading %}
<tr class="info">
{% else %}
<tr>
{% set curr.level = c.round.level %}
{% endif %}
<td class="text-center" style="font-size: 1.2em"><b>{{ r.category }}</b>
<td>{{ r.name }} {{ c.place.name_locativ() if c.place.level > 0 else '' }}
<tr class="rstate-{{c.state.name}}">
<td class="text-center"><b>{{ c.round.category }}</b>
<td>{{ c.round.name }}
<td>{{ c.place.name }}
<td>{{ c.state.friendly_name() }}
<td>
{% if rr.can_view_statement() %}
<a href='{{ url_for('org_task_statement', id=r.round_id) }}'>stáhnout</a>
{% set can, reason = cr.can_view_statement_with_reason() %}
{% if can %}
<a href='{{ url_for('org_task_statement', id=c.round_id) }}'>stáhnout</a>
{% else %}
{{ rr.cannot_view_statement_reason() }}
{{ reason }}
{% endif %}
<td>{{ role_names[role] }}
<td>
<a class="btn btn-xs btn-primary" href='{{ url_for('org_contest', id=c.contest_id) }}'>Detail</a>
<a class="btn btn-xs btn-default" href='{{ url_for('org_contest_list', id=c.contest_id) }}'>Účastníci</a>
{% if rr.can_view_submits() and c.state != RoundState.preparing %}
{% if cr.have_right(Right.view_submits) and c.state != RoundState.preparing %}
<a class="btn btn-xs btn-success" href='{{ url_for('org_contest_solutions', id=c.contest_id) }}'>Odevzdaná řešení</a>
{% endif %}
{% if (c.state == RoundState.grading and rr.can_view_submits()) or c.state == RoundState.closed %}
{% if (c.state == RoundState.grading and cr.have_right(Right.view_submits)) or c.state == RoundState.closed %}
<a class="btn btn-xs btn-warning" href='{{ url_for('org_score', contest_id=c.contest_id) }}'>Výsledky</a>
{% endif %}
{% if rr.have_right(Right.manage_contest) and c.state != RoundState.closed %}
<a class="btn btn-xs btn-primary" href='{{ url_for('org_contest_add_user', id=c.contest_id) }}'>+ Přidat účastníka</a>
{% if cr.have_right(Right.manage_contest) and c.state == RoundState.preparing %}
<a class="btn btn-xs btn-default" href='{{ url_for('org_contest_import', id=c.contest_id) }}'>Import</a>
{% endif %}
</td>
</tr>
{% endfor %}
{% endfor %}
</table>
{% endif %}
Loading