Skip to content
Snippets Groups Projects
Select Git revision
  • 779b0518141a804d1defb53f65bc41439df1da88
  • master default protected
2 results

Makefile

Blame
  • org_contest.html 6.22 KiB
    {% extends "base.html" %}
    {% set round = contest.round %}
    {% set state = contest.state %}
    {% set ct_state = contest.ct_state() %}
    {% set site_id = site.place_id if site else None %}
    
    {% block title %}
    {{ round.round_code() }}: {% if site %}soutěžní místo {{ site.name }}{% else %}{{ contest.place.name }}{% endif %}
    {% endblock %}
    {% block breadcrumbs %}
    {{ contest_breadcrumbs(round=round, contest=contest, site=site) }}
    {% endblock %}
    
    {% block body %}
    <table class=data>
    	<tr><td>Název<td>{{ round.name }}
    	<tr><td>Oblast<td><a href='{{ url_for('org_place', id=contest.place.place_id) }}'>{{ contest.place.name }}</a>
    	{% if site %}
    	<tr><td>Soutěžní místo<td><a href='{{ url_for('org_place', id=site.place_id) }}'>{{ site.name }}</a>
    	{% endif %}
    	<tr><td>Stav<td><span class='rstate-{{state.name}}'>{{ state.friendly_name() }}</span>
    		{% if round.state != RoundState.delegate %}
    		(určeno nastavením kola)
    		{% endif %}
    	<tr><td>Stav pro účastníky<td><span class='rstate-{{ct_state.name}}'>{{ ct_state.friendly_name() }}</span>
    	<tr><td>Vaše role<td>{% if g.user.is_admin %}správce{% elif roles %}{{ roles|join(", ") }}{% else %}–{% endif %}
    	{% if group_contests|length > 1 %}
    	<tr><td>Soutěže ve skupině kol:<td>
    		{% for c in group_contests %}
    			{% if c == contest %}<i>{% else %}<a href="{{ url_for('org_contest', id=c.contest_id) }}">{% endif %}
    				{{ c.round.round_code() }}: {% if site %}soutěžní místo {{ site.name }}{% else %}{{ contest.place.name }}{% endif %}
    			{% if c == contest %} (tato soutěž)</i>{% else %}</a>{% endif %}<br>
    		{% endfor %}
    	{% endif %}
    	<tr><td>Zadání<td>
    {% if round.tasks_file %}
    	{% if can_view_statement %}
    		<a href='{{ url_for('org_task_statement', id=round.round_id) }}'>stáhnout</a>
    	{% else %}
    		není dostupné
    	{% endif %}
    {% else %}
    	–
    {% endif %}
    </table>
    
    <div class="btn-group">
    	<a class="btn btn-primary" href='{{ url_for('org_contest_list', id=contest.contest_id, site_id=site_id) }}'>Seznam účastníků</a>
    	{% if state != RoundState.preparing %}
    	<a class="btn btn-primary" href='{{ url_for('org_contest_solutions', id=contest.contest_id, site_id=site_id) }}'>Odevzdaná řešení</a>
    	{% endif %}
    	{% if can_manage and site %}
    	<a class="btn btn-default" href="{{ url_for('org_contest_add_user', id=contest.contest_id, site_id=site_id) }}">Přidat účastníka</a>
    	{% endif %}
    	{% if not site %}
    	{% if state in [RoundState.grading, RoundState.closed] %}
    	<a class="btn btn-primary" href='{{ url_for('org_score', contest_id=contest.contest_id) }}'>Výsledky</a>
    	{% endif %}
    	{% if state == RoundState.preparing and round.seq > 1 %}
    	<a class="btn btn-primary" href='{{ url_for('org_contest_advance', contest_id=contest.contest_id) }}'>Postup z minulého kola</a>
    	{% endif %}
    	{% if can_manage %}
    	<a class="btn btn-default" href='{{ url_for('org_contest_import', id=contest.contest_id) }}'>Importovat data</a>
    	{% endif %}
    	{% if can_manage and not site %}
    	<a class="btn btn-default" href='{{ url_for('org_contest_edit', id=contest.contest_id) }}'>Nastavení</a>
    	{% endif %}
    	{% if g.user.is_admin %}
    	<a class="btn btn-default" href="{{ log_url('contest', contest.contest_id) }}">Historie</a>
    	{% endif %}
    	{% endif %}
    </div>
    
    {% if not site %}
    <h3>Soutěžní místa</h3>
    {% if places_counts %}
    <table class=data>
    	<thead>
    		<tr><th>Místo<th>Počet účastníků<th>Akce
    	</thead>
    	{% for (place, count) in places_counts %}
    		<tr>
    			<td><a href="{{ url_for('org_contest', id=contest.contest_id, site_id=place.place_id) }}">{{ place.name }}</a>
    			<td>{{ count }}
    			<td><div class="btn-group">
    				<a class="btn btn-xs btn-primary" href="{{ url_for('org_contest', id=contest.contest_id, site_id=place.place_id) }}">Detail</a>
    				{% if can_manage %}
    				<a class="btn btn-xs btn-default" href="{{ url_for('org_contest_add_user', id=contest.contest_id, site_id=place.place_id) }}">Přidat účastníka</a>
    			</div>
    				{% endif %}
    		</tr>
    	{% endfor %}
    	<tfoot>
    		<tr>
    			<th>Celkem
    			<th>{{ places_counts|sum(attribute=1) }}
    			<th>
    		</tr>
    	</tfoot>
    </table>
    {% else %}
    <p><i>Žádní účastníci a žádná soutěžní místa.</i></p>
    {% endif %}
    {% endif %}
    <div class="btn-group">
    	{% if can_manage and not site %}
    	<a class="btn btn-default" href='{{ url_for('org_contest_add_user', id=contest.contest_id) }}'>Přidat účastníka</a>
    	{% endif %}
    </div>
    
    <h3>Úlohy</h3>
    {% if tasks %}
    <table class=data>
    	<thead>
    		<tr>
    			<th>Kód
    			<th>Název
    			<th>Odevzdaná řešení
    			<th>Maximum bodů
    			<th>Jednotlivé akce
    			<th>Dávkové operace
    		</tr>
    	</thead>
    	{% for task in tasks %}
    	<tr>
    		<td>{{ task.code }}
    		<td>{{ task.name }}
    		<td>{{ task.sol_count }}
    		<td>{{ task.max_points|decimal|none_value('–') }}
    		<td><div class="btn-group">
    			<a class="btn btn-xs btn-primary" href="{{ url_for('org_contest_task', contest_id=contest.contest_id, task_id=task.task_id, site_id=site_id) }}">Odevzdaná řešení</a>
    			{% if not site and can_edit_points %}
    				<a class="btn btn-xs btn-default" href="{{ url_for('org_contest_task_points', contest_id=contest.contest_id, task_id=task.task_id) }}">Zadat body</a>
    			{% endif %}
    			{% if can_create_solutions %}
    				<a class="btn btn-xs btn-default" href="{{ url_for('org_contest_task_create', contest_id=contest.contest_id, task_id=task.task_id, site_id=site_id) }}">Založit řešení</a>
    			{% endif %}
    		</div>
    		<td><div class="btn-group">
    			<a class="btn btn-xs btn-primary" href="{{ url_for('org_contest_task_download', contest_id=contest.contest_id, task_id=task.task_id, site_id=site_id) }}">Stáhnout ZIP</a>
    			{% if can_upload %}
    				<a class='btn btn-xs btn-default' href="{{ url_for('org_contest_task_upload', contest_id=contest.contest_id, task_id=task.task_id, site_id=site_id) }}">Nahrát ZIP</a>
    			{% endif %}
    			{% if not site and can_edit_points %}
    				<a class="btn btn-xs btn-default" href="{{ url_for('org_contest_task_batch_points', contest_id=contest.contest_id, task_id=task.task_id) }}">Nahrát body</a>
    			{% endif %}
    		</div>
    	</tr>
    	{% endfor %}
    </table>
    {% else %}
    <p><i>Zatím nebyly přidány žádné úlohy.</i></p>
    {% endif %}
    
    <!--
    Práva k {% if site %}soutěžními místu{% else %}soutěži{% endif %}:
    {% if g.user.is_admin %}
    	admin
    {% elif rights %}
    	{% for r in rights %}
    	{{ r.name }}
    	{% endfor %}
    {% else %}
    	žádná
    {% endif %}
    -->
    
    {% endblock %}