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

Merge branch 'master' into devel

parents d05333bd 572e5355
No related branches found
No related tags found
No related merge requests found
......@@ -48,7 +48,10 @@ else:
assert regions, "Neexistují žádná místa dané úrovně"
for r in regions:
print(f"Zakládám {round.round_code()} pro místo {r.name}")
if sess.query(db.Contest).filter_by(round=round, place=r).first():
print(f"{round.round_code()} pro místo {r.name}: již existuje")
else:
print(f"{round.round_code()} pro místo {r.name}: zakládám")
if not args.dry_run:
c = db.Contest(round=round, place=r, state=state)
......
......@@ -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 %}
......@@ -53,37 +55,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 %}
{% if 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 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>
......@@ -116,11 +120,12 @@
<p><i>Žádní účastníci a žádná soutěžní místa.</i></p>
{% endif %}
{% endif %}
<div class="btn-group">
{% if can_manage and not site %}
<div class="btn-group">
<a class="btn btn-default" href='{{ ctx.url_for('org_contest_add_user') }}'>Přidat účastníka</a>
{% endif %}
</div>
{% endif %}
<h3>Úlohy</h3>
{% if tasks %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment