Skip to content
Snippets Groups Projects

Místa: hledání a další drobná vylepšení

Merged Martin Mareš requested to merge mj/places into devel
3 files
+ 83
53
Compare changes
  • Side-by-side
  • Inline

Files

+ 40
27
{% extends "base.html" %}
{% import "bootstrap/wtf.html" as wtf %}
{% block title %}{{ place.type_name().title() }}: {{ place.name }}{% endblock %}
{% block breadcrumbs %}
{{ place_breadcrumbs(place) }}
@@ -28,12 +29,48 @@
</form>
<a class="btn btn-default" href="{{ url_for('org_place_move', id=place.place_id) }}">Přesunout</a>
{% endif %}
<a class="btn btn-default" href='{{ url_for('org_place_rights', id=place.place_id) }}'>Přístupová práva</a>
<a class="btn btn-default" href='{{ url_for('org_place_contests', id=place.place_id) }}'>Soutěže</a>
<a class="btn btn-default" href='{{ url_for('org_place_roles', id=place.place_id) }}'>Organizátoři</a>
{% if g.user.is_admin %}
<a class="btn btn-default" href="{{ log_url('place', place.place_id) }}">Historie</a>
{% endif %}
</div>
<h3>Vyhledávání míst{% if place.level > 0 %} v této oblasti{% endif %}</h3>
{% if search_failed %}
<div class='alert alert-danger' role='alert'>
Žádné vyhovující místo nenalezeno.
</div>
{% endif %}
{% if search_limited %}
<div class='alert alert-warning' role='alert'>
Nalezeno příliš mnoho míst, zobrazeno jen prvních {{ found_places|length }}.
</div>
{% endif %}
{{ wtf.quick_form(search_form, method='GET', form_type='inline', button_map={'submit': 'primary'}) }}
{% if found_places %}
<table class=data>
<thead><tr>
<th>Kód
<th>Typ
<th>Název
</thead>
{% for p in found_places %}
<tr>
<td>{{ p.get_code() }}
<td>{{ p.type_name() }}
<td><a href='{{ url_for('org_place', id=p.place_id) }}'>{{ p.name_or_id() }}</a>
{% if p.parent_place.level > 0 %}
({{ p.parent_place.type_name() }} {{ p.parent_place.name_or_id() }})
{% endif %}
{% endfor %}
</table>
{% endif %}
{% if place.can_have_child() %}
<h3>Podřízená místa</h3>
{% if children %}
@@ -41,14 +78,14 @@
<table class=data>
<thead><tr>
<th>Kód
<th>Název
<th>Typ
<th>Název
</thead>
{% for child in children %}
<tr>
<td>{{ child.get_code() }}
<td><a href='{{ url_for('org_place', id=child.place_id) }}'>{{ child.name or "#" + child.place_id|string }}</a>
<td>{{ child.type_name() }}
<td><a href='{{ url_for('org_place', id=child.place_id) }}'>{{ child.name_or_id() }}</a>
{% endfor %}
</table>
{% endif %}
@@ -57,28 +94,4 @@
{% endif %}
{% endif %}
<h3>Soutěže</h3>
{% if not contests %}
<p>K tomuto místu nejsou přidružené žádné soutěže.
{% else %}
<table class=data>
<thead><tr>
<th>ID
<th>Ročník
<th>Kat.
<th>Název
<th>Stav
</thead>
{% for c in contests %}
<tr>
{% set r = c.round %}
<td><a href='{{ url_for('org_contest', ct_id=c.contest_id) }}'>{{ r.round_code() }}</a>
<td>{{ r.year }}
<td>{{ r.category }}
<td>{{ r.name }}
<td class='rstate-{{c.state.name}}'>{{ c.state.friendly_name() }}
{% endfor %}
</table>
{% endif %}
{% endblock %}
Loading