diff --git a/mo/web/org_contest.py b/mo/web/org_contest.py index 9feaa5e4f6002d3c45a21d1382eb683277e32292..9722073accbbb985a4cffd08a890530a8116b6d5 100644 --- a/mo/web/org_contest.py +++ b/mo/web/org_contest.py @@ -1376,10 +1376,12 @@ class BatchPointsForm(ImportForm): @app.route('/org/contest/c/<int:ct_id>/task/<int:task_id>/batch-points', methods=('GET', 'POST')) @app.route('/org/contest/r/<int:round_id>/task/<int:task_id>/batch-points', methods=('GET', 'POST')) @app.route('/org/contest/r/<int:round_id>/h/<int:hier_id>/task/<int:task_id>/batch-points', methods=('GET', 'POST')) -def org_generic_batch_points(task_id: int, round_id: Optional[int] = None, hier_id: Optional[int] = None, ct_id: Optional[int] = None): +@app.route('/org/contest/c/<int:ct_id>/batch-points', methods=('GET', 'POST')) +@app.route('/org/contest/r/<int:round_id>/batch-points', methods=('GET', 'POST')) +@app.route('/org/contest/r/<int:round_id>/h/<int:hier_id>/batch-points', methods=('GET', 'POST')) +def org_generic_batch_points(task_id: Optional[int] = None, round_id: Optional[int] = None, hier_id: Optional[int] = None, ct_id: Optional[int] = None): ctx = get_context(round_id=round_id, hier_id=hier_id, ct_id=ct_id, task_id=task_id) round, hier_place, contest, task = ctx.round, ctx.hier_place, ctx.contest, ctx.task - assert task if not ctx.rights.can_edit_points(): raise werkzeug.exceptions.Forbidden() diff --git a/mo/web/templates/org_contest.html b/mo/web/templates/org_contest.html index 13843d4e0049622fa810721d11035cf78d11b61d..11f0e3a545200e6e9b601294d2d8ada03ce334e5 100644 --- a/mo/web/templates/org_contest.html +++ b/mo/web/templates/org_contest.html @@ -87,6 +87,7 @@ {% endif %} <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> + <a class="btn btn-default" href='{{ ctx.url_for('org_generic_batch_points') }}'>Importovat body</a> <a class="btn btn-default" href='{{ ctx.url_for('org_contest_edit') }}'>Nastavení</a> {% endif %} {% if not site and g.user.is_admin %} diff --git a/mo/web/templates/org_generic_batch_points.html b/mo/web/templates/org_generic_batch_points.html index aaa82898ab73e787598fc4ab529f2faa5a8a0c14..beba15382e1471ebacffc2c3f174711178ab82f3 100644 --- a/mo/web/templates/org_generic_batch_points.html +++ b/mo/web/templates/org_generic_batch_points.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% import "bootstrap/wtf.html" as wtf %} -{% block title %}Dávkové bodování úlohy {{ task.code }} {{ task.name }}{% endblock %} +{% block title %}Dávkové bodování {% if task %}úlohy {{ task.code }} {{ task.name }}{% else %}všech úloh{% endif %}{% endblock %} {% block breadcrumbs %} {{ ctx.breadcrumbs(action="Dávkové bodování") }} {% endblock %}