diff --git a/mo/web/templates/org_contest.html b/mo/web/templates/org_contest.html index fedf7a52296eb4e9f36cfd3115d46de2d15d3def..08f7e3f54be2606af156ffd54e159945a4724cd2 100644 --- a/mo/web/templates/org_contest.html +++ b/mo/web/templates/org_contest.html @@ -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>