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(): ...@@ -53,7 +53,7 @@ def org_rounds():
return render_template( return render_template(
'org_rounds.html', '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(): ...@@ -81,7 +81,7 @@ def org_rounds_history():
) )
return render_template('org_rounds.html', 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 @@ ...@@ -2,48 +2,80 @@
{% block title %}Soutěžní kola{% endblock %} {% block title %}Soutěžní kola{% endblock %}
{% set ns = namespace(year = 0) %} {% set ns = namespace(year = 0, category = '') %}
{% block body %} {% block body %}
{% for r in rounds %} {% for r in rounds %}
{% if ns.year != r.year %} {% if ns.year != r.year %}
{% if ns.year != 0 %} {% if ns.year != 0 %}
</table> </div>
{% endif %} {% endif %}
{% set ns.year = r.year %} {% set ns.year = r.year %}
<h3>{{ r.year }}. ročník</h3> {% set ns.category = '' %}
<table class="table table-bordered"> <h3>{{ r.year }}. ročník</h3><hr>
<thead><tr>
<th>Kategorie
<th>Název
<th>Stav
<th>Počet účastníků
<th>Akce
</thead>
{% endif %} {% 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 %} {% if r.state == RoundState.preparing %}
<tr class="warning"> class="panel panel-warning"
{% elif r.state == RoundState.running %} {% elif r.state == RoundState.running %}
<tr class="success"> class="panel panel-success"
{% elif r.state == RoundState.grading %} {% elif r.state == RoundState.grading %}
<tr class="info"> class="panel panel-info"
{% elif r.state == RoundState.delegate %} {% elif r.state == RoundState.delegate %}
<tr class="active"> class="panel panel-info"
{% else %} {% else %}
<tr> class="panel panel-default"
{% endif %} {% endif %}>
<td class="text-center" style="font-size: 1.2em"><b>{{ r.category }}</b> <div class="panel-heading">
<td>{{ r.name }} <small class="pull-right">{{ r.state.friendly_name() }}</small>
<td>{{ r.state.friendly_name() }} <h5 class="panel-title">{{ r.name }} <b>{{ r.category }}</b></h5>
<td>{{ participants_count[r.round_id] if participants_count[r.round_id] else '–' }} </div>
<td> <div class="panel-body">
<a class="btn btn-xs btn-primary" href='{{ url_for('org_round', round_id=r.round_id) }}'>Detail</a> <a class="btn btn-sm btn-primary" href='{{ url_for('org_round', round_id=r.round_id) }}'>
<a class="btn btn-xs btn-default" href='{{ url_for('org_generic_list', round_id=r.round_id) }}'>Účastníci</a> <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 %} {% 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 %} {% endif %}
</td> <span class="glyphicon glyphicon-time"></span>
{{ r.ct_submit_end|timeformat_date|none_value('Termín nezadán') }}
</div>
</div>
</div>
{% endfor %} {% endfor %}
</table> </div>
{% if history %} {% if history %}
<p><a class='btn btn-default' href='{{ url_for('org_rounds') }}'>Aktuální ročník</a> <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