Skip to content
Snippets Groups Projects
Commit e24aa9f0 authored by Jan Prachař's avatar Jan Prachař
Browse files

org_rounds: Předělán vzhled z tabulky na panely

parent 5916799b
No related branches found
No related tags found
No related merge requests found
......@@ -53,7 +53,7 @@ def org_rounds():
return render_template(
'org_rounds.html',
rounds=rounds, participants_count=participants_count, public=public
gk=g.gatekeeper, rounds=rounds, participants_count=participants_count, public=public
)
......@@ -81,7 +81,7 @@ def org_rounds_history():
)
return render_template('org_rounds.html',
rounds=rounds, participants_count=participants_count, history=True,
gk=g.gatekeeper, rounds=rounds, participants_count=participants_count, history=True,
)
......
......@@ -2,48 +2,80 @@
{% block title %}Soutěžní kola{% endblock %}
{% set ns = namespace(year = 0) %}
{% set ns = namespace(year = 0, category = '') %}
{% block body %}
{% for r in rounds %}
{% if ns.year != r.year %}
{% if ns.year != 0 %}
</table>
</div>
{% endif %}
{% set ns.year = r.year %}
<h3>{{ r.year }}. ročník</h3>
<table class="table table-bordered">
<thead><tr>
<th>Kategorie
<th>Název
<th>Stav
<th>Počet účastníků
<th>Akce
</thead>
{% set ns.category = '' %}
<h3>{{ r.year }}. ročník</h3><hr>
{% endif %}
{% if ns.category != r.category %}
{% if ns.category != '' %}
</div>
{% endif %}
{% set ns.category = r.category %}
<div class="row">
<div class="col-sm-12">
<h4>Kategorie <b>{{ r.category }}</b></h4>
</div>
{% endif %}
<div class="col-sm-4">
<div
{% if r.state == RoundState.preparing %}
<tr class="warning">
class="panel panel-warning"
{% elif r.state == RoundState.running %}
<tr class="success">
class="panel panel-success"
{% elif r.state == RoundState.grading %}
<tr class="info">
class="panel panel-info"
{% elif r.state == RoundState.delegate %}
<tr class="active">
class="panel panel-info"
{% else %}
<tr>
{% endif %}
<td class="text-center" style="font-size: 1.2em"><b>{{ r.category }}</b>
<td>{{ r.name }}
<td>{{ r.state.friendly_name() }}
<td>{{ participants_count[r.round_id] if participants_count[r.round_id] else '–' }}
<td>
<a class="btn btn-xs btn-primary" href='{{ url_for('org_round', round_id=r.round_id) }}'>Detail</a>
<a class="btn btn-xs btn-default" href='{{ url_for('org_generic_list', round_id=r.round_id) }}'>Účastníci</a>
class="panel panel-default"
{% endif %}>
<div class="panel-heading">
<small class="pull-right">{{ r.state.friendly_name() }}</small>
<h5 class="panel-title">{{ r.name }} <b>{{ r.category }}</b></h5>
</div>
<div class="panel-body">
<a class="btn btn-sm btn-primary" href='{{ url_for('org_round', round_id=r.round_id) }}'>
<span class="glyphicon glyphicon-search"></span>
Detail
</a>
<a class="btn btn-sm btn-default" href='{{ url_for('org_generic_list', round_id=r.round_id) }}'>
<span class="glyphicon glyphicon-user"></span>
Účastníci
{%if participants_count[r.round_id] %}
<span class="badge">{{ participants_count[r.round_id] }}</span>
{% endif %}
</a>
{% if r.state == RoundState.closed %}
<a class="btn btn-xs btn-default" href='{{ url_for('org_score', round_id=r.round_id) }}'>Výsledky</a>
<a class="btn btn-sm btn-warning" href='{{ url_for('org_score', round_id=r.round_id) }}'>
<span class="glyphicon glyphicon-bullhorn"></span>
Výsledky
</a>
{% endif %}
</div>
<div class="panel-footer">
{% if gk.rights_for_round(r).have_right(Right.manage_round) %}
<a class="btn btn-xs btn-default pull-right" href='{{ url_for('org_round_edit', round_id=r.round_id) }}'>
<span class="glyphicon glyphicon-cog"></span>
Nastavení
</a>
{% endif %}
</td>
<span class="glyphicon glyphicon-time"></span>
{{ r.ct_submit_end|timeformat_date|none_value('Termín nezadán') }}
</div>
</div>
</div>
{% endfor %}
</table>
</div>
{% if history %}
<p><a class='btn btn-default' href='{{ url_for('org_rounds') }}'>Aktuální ročník</a>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment