diff --git a/mo/web/org_contest.py b/mo/web/org_contest.py index 367ef5368d8f63be704653522eb16d14a8cf7b5b..e3df79d58ef84e21aed5257dd45db113874fd9aa 100644 --- a/mo/web/org_contest.py +++ b/mo/web/org_contest.py @@ -373,6 +373,7 @@ def org_contest(id: int, site_id: Optional[int] = None): can_create_solutions=rr.can_upload_feedback() or rr.can_upload_solutions(), can_view_statement=rr.can_view_statement(), tasks=tasks, places_counts=places_counts, + edit_form=ContestEditForm(obj=contest), ) diff --git a/mo/web/templates/org_contest.html b/mo/web/templates/org_contest.html index 2675f9e02c0179769676ae65f4bc6cf2e204f5ee..af224f5a3802a64234c98d662668c9b3ca536050 100644 --- a/mo/web/templates/org_contest.html +++ b/mo/web/templates/org_contest.html @@ -19,7 +19,22 @@ {% with state=contest.state %} <tr><td>Stav<td><span class='rstate-{{state.name}}'>{{ state.friendly_name() }}</span> {% if round.state != RoundState.delegate %} - (určeno nastavením kola) + (určeno nastavením kola) + {% elif can_manage and not site %} + {% if state == RoundState.running %} + <form method="post" action="{{ url_for('org_contest_edit', id=contest.contest_id) }}" style="display: inline-block"> + {{ edit_form.csrf_token }} + <button type="submit" class="btn btn-sm btn-default">Změnit na: opravuje se</button> + <input type="hidden" name="state" value="{{ RoundState.grading.name }}"> + </form> + {% elif state == RoundState.grading %} + <form method="post" action="{{ url_for('org_contest_edit', id=contest.contest_id) }}" style="display: inline-block"> + {{ edit_form.csrf_token }} + <button type="submit" class="btn btn-sm btn-default">Změnit na: ukončeno</button> + <input type="hidden" name="state" value="{{ RoundState.closed.name }}"> + </form> + {% endif %} + {% else %} {% endif %} {% endwith %} {% with state=contest.ct_state() %}