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
+ 58
39
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -2,34 +2,46 @@
{% block title %}Organizátorské rozhraní{% endblock %}
{% block body %}
{% if contests %}
{% if overview %}
<h3>Moje soutěže</h3>
<table class="table table-bordered table-condensed greyhead">
{% set curr = namespace(level=-1) %}
{% for c in contests %}
{% if curr.level != c.round.level %}
{% for o in overview %}
{% if curr.level != o.round.level %}
<thead><tr>
<th>ID
<th>Kategorie
<th>Kolo
<th>{{ c.round.get_level().name|capitalize }}
<th>{{ o.round.get_level().name|capitalize }}
<th>Stav
<th>Moje role
<th>Odkazy
</thead>
{% set curr.level = c.round.level %}
{% set curr.level = o.round.level %}
{% endif %}
{% if o.contest %}
{% set detail_url = url_for('org_contest', ct_id=o.contest.contest_id) %}
{% elif o.place.level == 0 %}
{% set detail_url = url_for('org_round', round_id=o.round.round_id) %}
{% else %}
{% set detail_url = url_for('org_round', round_id=o.round.round_id, hier_id=o.place.place_id) %}
{% endif %}
<tr>
<td><a href='{{ url_for('org_contest', ct_id=c.contest_id) }}'>{{ c.round.round_code() }}</a>
<td class="text-center"><b>{{ c.round.category }}</b>
<td>{{ c.round.name }}
<td>{{ c.place.name }}
<td class="rstate-{{c.state.name}}">{{ c.state.friendly_name() }}
<td>{% for r in contest_roles[c.contest_id] %}{{ role_type_names[r] }}{% if not loop.last %}<br>{% endif %}{% endfor %}
<td><a href='{{ detail_url }}'>{{ o.round.round_code() }}</a>
<td class="text-center"><b>{{ o.round.category }}</b>
<td>{{ o.round.name }}
{% if o.contest %}
<td>{{ o.place.name }}
<td class="rstate-{{o.contest.state.name}}">{{ o.contest.state.friendly_name() }}
{% else %}
<td><i>{{ o.place.name_locative() }}</i>
<td>
<a class="btn btn-xs btn-primary" href='{{ url_for('org_contest', ct_id=c.contest_id) }}'>Detail</a>
{% endif %}
<td>{% for r in o.role_list %}{{ role_type_names[r] }}{% if not loop.last %}<br>{% endif %}{% endfor %}
<td><a class="btn btn-xs btn-primary" href='{{ detail_url }}'>Detail</a>
{% endfor %}
</table>
Loading