Skip to content
Snippets Groups Projects

Reforma orgovského rozhraní ke kolům a soutěžím

Merged Martin Mareš requested to merge mj/contest-reform into devel
2 files
+ 147
66
Compare changes
  • Side-by-side
  • Inline

Files

+ 56
31
{% extends "base.html" %}
{% extends "base.html" %}
{% import "bootstrap/wtf.html" as wtf %}
{% import "bootstrap/wtf.html" as wtf %}
{% set can_manage_round = rights.have_right(Right.manage_round) %}
{% set in_hier = ctx.hier_id != None %}
 
{% set can_manage_round = rights.have_right(Right.manage_round) and not in_hier %}
{% set can_manage_contest = rights.have_right(Right.manage_contest) %}
{% set can_manage_contest = rights.have_right(Right.manage_contest) %}
{% set can_view_contestants = rights.have_right(Right.view_contestants) %}
{% set can_view_contestants = rights.have_right(Right.view_contestants) %}
{% set can_handle_submits = rights.have_right(Right.view_submits) %}
{% set can_handle_submits = rights.have_right(Right.view_submits) %}
@@ -8,7 +9,13 @@
@@ -8,7 +9,13 @@
{% set can_view_statement = rights.can_view_statement() %}
{% set can_view_statement = rights.can_view_statement() %}
{% set can_add_contest = g.gatekeeper.rights_generic().have_right(Right.add_contest) %}
{% set can_add_contest = g.gatekeeper.rights_generic().have_right(Right.add_contest) %}
{% block title %}{{ round.name }} {{ round.round_code() }}{% endblock %}
{% block title %}
 
{% if in_hier %}
 
{{ round.round_code() }}: {{ ctx.hier_place.name }}
 
{% else %}
 
{{ round.name }} {{ round.round_code() }}
 
{% endif %}
 
{% endblock %}
{% block breadcrumbs %}
{% block breadcrumbs %}
{{ ctx.breadcrumbs() }}
{{ ctx.breadcrumbs() }}
{% endblock %}
{% endblock %}
@@ -81,7 +88,7 @@
@@ -81,7 +88,7 @@
{% if can_view_contestants %}
{% if can_view_contestants %}
<a class="btn btn-primary" href='{{ ctx.url_for('org_generic_list') }}'>Seznam účastníků</a>
<a class="btn btn-primary" href='{{ ctx.url_for('org_generic_list') }}'>Seznam účastníků</a>
{% endif %}
{% endif %}
{% if can_view_contestants and round.state in [RoundState.grading, RoundState.closed, RoundState.delegate] %}
{% if can_view_contestants and round.state in [RoundState.grading, RoundState.closed, RoundState.delegate] and not in_hier %}
<a class="btn btn-primary" href='{{ ctx.url_for('org_score') }}'>Výsledky</a>
<a class="btn btn-primary" href='{{ ctx.url_for('org_score') }}'>Výsledky</a>
{% endif %}
{% endif %}
{% if can_manage_contest %}
{% if can_manage_contest %}
@@ -94,38 +101,56 @@
@@ -94,38 +101,56 @@
{% if round.has_messages %}
{% if round.has_messages %}
<a class="btn btn-default" href='{{ ctx.url_for('org_round_messages') }}'>Zprávičky</a>
<a class="btn btn-default" href='{{ ctx.url_for('org_round_messages') }}'>Zprávičky</a>
{% endif %}
{% endif %}
{% if g.user.is_admin %}
{% if g.user.is_admin and not in_hier %}
<a class="btn btn-default" href='{{ log_url('round', round.round_id) }}'>Historie</a>
<a class="btn btn-default" href='{{ log_url('round', round.round_id) }}'>Historie</a>
{% endif %}
{% endif %}
</div>
</div>
{% endif %}
{% endif %}
<h3>Soutěže</h3>
<h3>Soutěže</h3>
{% if contests_counts %}
{% if reg_total.num_contests %}
<table class=data>
{% set show_contests = reg_stats[0].contest != None %}
<thead>
<table class=data>
<tr>
<thead>
<th>{{ round.get_level().name|capitalize }}
<tr>
<th>Stav
{% if show_contests %}
<th>Počet účastníků
<th>{{ round.get_level().name|capitalize }}
</tr>
<th>Stav
</thead>
{% else %}
{% for (c, count) in contests_counts %}
<th>{{ reg_stats[0].region.type_name()|capitalize }}
<tr>
<th>Počet soutěží
<td><a href='{{ url_for('org_contest', ct_id=c.contest_id) }}'>{{ c.place.name }}</a>
{% endif %}
{% with state=c.state %}
<th>Počet účastníků
<td class='rstate-{{state.name}}'>{{ state.friendly_name() }}
<th>Počet nepotvrzených
{% endwith %}
</tr>
<td>{{ count }}
</thead>
{% endfor %}
{% for rs in reg_stats %}
<tfoot>
<tr>
<tr>
<th>Celkem
{% if show_contests %}
<th>
<td><a href='{{ url_for('org_contest', ct_id=rs.contest.contest_id) }}'>{{ rs.region.name }}</a>
<th>{{ contests_counts|sum(attribute=1) }}
{% with state=rs.contest.state %}
</tr>
<td class='rstate-{{state.name}}'>{{ state.friendly_name() }}
</tfoot>
{% endwith %}
</table>
{% else %}
 
<td><a href='{{ ctx.url_for('org_round', hier_id=rs.region.place_id) }}'>{{ rs.region.name }}</a>
 
<td>{{ rs.num_contests }}
 
{% endif %}
 
<td>{{ rs.num_active_pants }}
 
<td>{{ rs.num_unconfirmed_pants }}
 
{% endfor %}
 
<tfoot>
 
<tr>
 
<th>Celkem
 
{% if show_contests %}
 
<th>
 
{% else %}
 
<th>{{ reg_total.num_contests }}
 
{% endif %}
 
<th>{{ reg_total.num_active_pants }}
 
<th>{{ reg_total.num_unconfirmed_pants }}
 
</tr>
 
</tfoot>
 
</table>
{% else %}
{% else %}
<p>Zatím nebyly založeny žádné soutěže.
<p>Zatím nebyly založeny žádné soutěže.
{% endif %}
{% endif %}
@@ -139,7 +164,7 @@
@@ -139,7 +164,7 @@
{% endif %}
{% endif %}
<h3>Úlohy</h3>
<h3>Úlohy</h3>
{% if tasks %}
{% if task_info %}
<table class=data>
<table class=data>
<thead>
<thead>
<tr>
<tr>
@@ -151,11 +176,11 @@
@@ -151,11 +176,11 @@
{% if can_handle_submits or can_upload %}<th>Dávkové operace{% endif %}
{% if can_handle_submits or can_upload %}<th>Dávkové operace{% endif %}
</tr>
</tr>
</thead>
</thead>
{% for task in tasks %}
{% for task, sol_count in task_info %}
<tr>
<tr>
<td>{{ task.code }}
<td>{{ task.code }}
<td>{{ task.name }}
<td>{{ task.name }}
<td>{{ task.sol_count }}
<td>{{ sol_count }}
<td>{{ task.max_points|decimal|none_value('–') }}
<td>{{ task.max_points|decimal|none_value('–') }}
{% if can_manage_round %}
{% if can_manage_round %}
<td><div class="btn-group">
<td><div class="btn-group">
Loading