Skip to content
Snippets Groups Projects
Select Git revision
  • 862acc35df21f28edf4858e2f9db470acececb55
  • master default protected
2 results

Makefile

Blame
  • org_index.html NaN GiB
    {% extends "base.html" %}
    {% import "bootstrap/wtf.html" as wtf %}
    {% block title %}Přístup pro organizátory{% endblock %}
    {% block body %}
    
    {% if overview %}
    
    <h3>Moje soutěže</h3>
    
    <div class="tabbed">
    {% set curr = namespace(place_id=-1) %}
    {% for o in overview %}
    	{% if curr.place_id != o.place.place_id %}
    	<input type="radio" id="tab{{ o.place.place_id }}" name="css-tabs"{% if curr.place_id == -1 %} checked{% endif %}>
    		{% set curr.place_id = o.place.place_id %}
    	{% endif %}
    {% endfor %}
    
    	<ul class="tabs">
    	{% set curr = namespace(place_id=-1) %}
    	{% for o in overview %}
    		{% if curr.place_id != o.place.place_id %}
    		<li class="tab">
    			<label for="tab{{ o.place.place_id }}" style="font-size: 2rem">
    				{% if o.place.level == 2 %}Okres{% endif %}
    				{{ o.place.name }}
    			</label>
    			{% set curr.place_id = o.place.place_id %}
    		{% endif %}
    	{% endfor %}
    	</ul>
    
    {% set curr = namespace(place_id=-1, level=-1) %}
    {% for o in overview %}
    	{% if curr.place_id != o.place.place_id %}
    	{% if curr.place_id != -1 %}
    		</table>
    	</div>
    	{% endif %}
    	<div class="tab-content">
    		<table class="table table-bordered table-hover" style="border-left: none; border-right: none; margin-bottom: 0px">
    	{% endif %}
    
    	{% if curr.level != o.round.level or curr.place_id != o.place.place_id %}
    		<thead>
    		{% if curr.place_id == o.place.place_id %}
    		<tr>
    			<td colspan="6" style="background-color: #fff; border-left-width: 0px; border-right-width: 0px; height: 3rem">
    		{% endif %}
    		<tr>
    			<th colspan="2">{{ o.round.name }}</h4>
    			<th class="hidden-xs">Zadání
    			<th class="hidden-xs">Soutěžící
    			<th class="hidden-xs">Moje role
    			<th>
    		</thead>
    		{% set curr.level = o.round.level %}
    		{% set curr.place_id = o.place.place_id %}
    	{% 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
    		{% if o.contest %}
    		{% if o.contest.state == RoundState.preparing %}
    			class="warning"
    		{% elif o.contest.state == RoundState.running %}
    			class="success"
    		{% elif o.contest.state == RoundState.grading %}
    			class="info"
    		{% endif %}
    		{% else %}
    		{% if o.lowest_state == RoundState.preparing %}
    			class="warning"
    		{% elif o.lowest_state == RoundState.running %}
    			class="success"
    		{% elif o.lowest_state == RoundState.grading %}
    			class="info"
    		{% endif %}
    		{% endif %}>
    			<td class="text-center"><b>{{ o.round.category }}</b>
    			<td>{% for s in o.contest_states %}{% if not loop.first %}<br>{% endif %}<span>{{ s.friendly_name() }}</span>{% endfor %}
    			<td class="hidden-xs">
    				{% set can, reason = o.rights.offer_view_statement() %}
    				{% if can %}
    				<a class="pdf-icon" href='{{ url_for('org_task_statement', round_id=o.round.round_id) }}' title='Stáhnout zadání'>
    					<img class="media-object" src="{{ url_for('static', filename='img/pdficon.svg') }}" alt="PDF" style="width: 16px; display: inline-block; margin: 2px">
    				</a>
    				{% else %}
    					{{ reason }}
    				{% endif %}
    			<td class="hidden-xs"><!--{% if not o.contest %}{{ o.num_contests }}S / {% endif %}-->
    				{{- o.num_active_pants }}
    				{%- if o.num_unconfirmed_pants %}<br><span class="text-danger text-nowrap">+{{ o.num_unconfirmed_pants|inflected('přihlášený', 'přihlášení', 'přihlášených') }}</span>{% endif %}
    			<td>{% for r in o.role_list %}{{ role_type_names[r] }}{% if not loop.last %}<br>{% endif %}{% endfor %}
    			<td class="hidden-xs">{% for r in o.role_list %}{{ role_type_names[r] }}{% if not loop.last %}<br>{% endif %}{% endfor %}
    			<td>
    				{% if o.contest or o.round.level > o.place.level %}
    				<a class="btn btn-xs btn-primary" href='{{ detail_url }}'>Detail</a>
    				{% if o.num_contests > 0 %}
    				<a class="btn btn-xs btn-default" href='{{ o.url_for('org_generic_list') }}'>Účastníci</a>
    				{% endif %}
    				{% else %}
    				<form method="post" action="" style="display: inline-block">
    					{{ form_add_contest.csrf_token() }}
    					{{ wtf.form_field(form_add_contest.create_contest, type="hidden") }}
    					<input type="hidden" name="round" value="{{ o.round.round_id }}">
    					<input type="hidden" name="place" value="{{ o.place.code }}">
    					<button type="submit" class="btn btn-xs btn-default">Založit soutěž</button>
    				</form>
    				{% endif %}
    				{% if o.contest %}
    				{% if (o.contest.state == RoundState.grading and o.rights.have_right(Right.view_contestants)) or o.contest.state == RoundState.closed %}
    				<a class="btn btn-xs btn-warning" href='{{ o.url_for('org_score') }}'>Výsledky</a>
    				{% endif %}
    				{% if o.rights.can_view_submits() and o.contest.state != RoundState.preparing and o.contest.state != RoundState.closed %}
    				<a class="btn btn-xs btn-success" href='{{ url_for('org_contest_solutions', ct_id=o.contest.contest_id) }}'>Tabulka řešení</a>
    				{% endif %}
    				{% if o.rights.have_right(Right.manage_contest) and o.contest.state != RoundState.closed %}
    				<a class="btn btn-xs btn-default" href="{{ url_for('org_contest_add_user', ct_id=o.contest.contest_id) }}">+ Přidat účastníka</a>
    				{% endif %}
    				{% if o.rights.have_right(Right.manage_contest) and o.contest.state == RoundState.preparing %}
    				<a class="btn btn-xs btn-default" href='{{ url_for('org_generic_import', ct_id=o.contest.contest_id) }}'>Import</a>
    				{% endif %}
    				{% else %}
    				{% if (o.lowest_state == RoundState.grading and o.rights.have_right(Right.view_contestants)) or o.lowest_state == RoundState.closed and o.num_contests > 0 %}
    				<a class="btn btn-xs btn-warning" href='{{ o.url_for('org_score') }}'>Výsledky</a>
    				{% endif %}
    				{% endif %}
    			</td>
    		</tr>
    {% endfor %}
    		</table>
    	</div>
    
    {% else %}
    
    <p>Momentálně neorganizujete žádnou soutěž.
    
    {% endif %}
    
    <h3>Rychlé hledání</h3>
    
    <div class="row">
    	<div class="col-md-6">
    		<form style="margin-bottom: 22px" method=GET action="" class='form-inline' role=form>
    			<div class="form-group">
    				<input class='form-control' name=place placeholder='Kód místa'></input>
    			</div>
    			<button class='btn btn-primary' type="submit">Vyhledat místo</button>
    		</form>
    	</div>
    {% if g.user.is_admin %}
    	<div class="col-md-6">
    		<form style="margin-bottom: 22px" method=GET action="" class='form-inline' role=form>
    			<div class="form-group">
    				<input class='form-control' name=uid placeholder='ID uživatele'></input>
    			</div>
    			<button class='btn btn-primary' type="submit">Vyhledat uživatele</button>
    		</form>
    	</div>
    {% endif %}
    </div>
    
    <h3>Osmo hřiště</h3>
    <p>Na <a href="https://hriste.osmo.fyzikalniolympiada.cz/">Osmo hřišti</a> si
    můžete dopředu vyzkoušet odevzdávání či opravování úloh.</p>
    
    <p>Jako soutěžící Student Pilný se přihlásíte s údaji:</p>
    <pre>
    student.pilny@fyzikalniolympiada.cz
    radium88</pre>
    <p>Student Pilný soutěžil v okresním kole kategorie F v okrese Beroun – to
    již skončilo. Nyní soutěží ve stejném okrese v kategorii E. Zde může ještě
    odevzdávat úlohy.</p>
    
    <p>Přihlásit se tam můžete rovnež jako Opravovatel Pilný, který má přidělenou
    roli opravovatele pro okresní kolo v Berouně. Jeho přihlašovací údaje jsou:
    </p>
    <pre>
    opravovatel.pilny@fyzikalniolympiada.cz
    sklodowska</pre>
    <p>Opravovatel Pilný se může pustit do oprav úloh Studenta Pilného v
    kategorii F v okrese Beroun. V témže okrese si může také prohlížet
    odevzdaná řešení Studenta Pilného v kategorii E, ale toto kolo ještě
    neskončilo, a proto nemůže jeho úlohy opravovat.</p>
    
    {% endblock %}