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

Oprava pravidel pro zobrazování tlačítek na stránce soutěže

Některá tlačítka se ukazovala, i když uživatel neměl na akci právo.
parent e457eba1
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,8 @@
{% set can_edit_points = not site and rights.can_edit_points() %}
{% set can_create_solutions = rights.can_upload_feedback() or rights.can_upload_solutions() %}
{% set can_view_statement = rights.can_view_statement() %}
{% set can_view_contestants = rights.have_right(Right.view_contestants) %}
{% set can_view_submits = rights.have_right(Right.view_submits) %}
{% block title %}
{{ round.round_code() }}: {% if site %}soutěžní místo {{ site.name }}{% else %}{{ contest.place.name }}{% endif %}
......@@ -48,37 +50,39 @@
{% endif %}
</table>
{% if can_view_contestants or can_upload or can_manage %}{# Ostatní práva implikují některé z těchto #}
<div class="btn-group">
{% if can_view_contestants %}
<a class="btn btn-primary" href='{{ ctx.url_for('org_generic_list') }}'>Seznam účastníků</a>
{% if state != RoundState.preparing %}
{% endif %}
{% if can_view_submits and state != RoundState.preparing %}
<a class="btn btn-primary" href='{{ ctx.url_for('org_contest_solutions') }}'>Odevzdaná řešení</a>
{% endif %}
{% if can_manage and site %}
{% if not site and can_manage %}
<a class="btn btn-default" href="{{ ctx.url_for('org_contest_add_user') }}">Přidat účastníka</a>
{% endif %}
{% if not site and state in [RoundState.grading, RoundState.closed] %}
{% if not site and can_view_contestants and state in [RoundState.grading, RoundState.closed] %}
<a class="btn btn-primary" href='{{ ctx.url_for('org_score') }}'>Výsledky</a>
{% endif %}
{% if can_view_contestants %}
<a class="btn btn-default" href='{{ ctx.url_for('org_contest_protocols') }}'>Protokoly</a>
{% endif %}
{% if can_upload %}
<a class="btn btn-default" href='{{ ctx.url_for('org_contest_scans') }}'>Zpracování skenů</a>
{% endif %}
{% if not site %}
{% if not site and can_manage %}
{% if state != RoundState.closed and round.seq > 1 %}
<a class="btn btn-primary" href='{{ ctx.url_for('org_contest_advance') }}'>Postup z minulého kola</a>
{% endif %}
{% if can_manage %}
<a class="btn btn-default" href='{{ ctx.url_for('org_import_user') }}'>Importovat účastníky</a>
<a class="btn btn-default" href='{{ ctx.url_for('org_import_org') }}'>Importovat organizátory</a>
{% endif %}
{% if can_manage and not site %}
<a class="btn btn-default" href='{{ ctx.url_for('org_contest_edit') }}'>Nastavení</a>
{% endif %}
{% if g.user.is_admin %}
{% if not site and g.user.is_admin %}
<a class="btn btn-default" href="{{ log_url('contest', ctx.ct_id) }}">Historie</a>
{% endif %}
{% endif %}
</div>
{% endif %}
{% if not site %}
<h3>Soutěžní místa</h3>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment