{% extends "layout.html" %}
{% set active_id = "places" %}
{% from "_macros.html" import render_pagination, render_field_with_errors, render_event_organizer %}
{%- block title -%}
{{ _('Places') }}
{%- endblock -%}
{% block content %}

<h1>{{ _('Places') }}</h1>

<div class="my-4">
    <form action="" class="form-inline" method="GET">
        {{ form.hidden_tag() }}
    </form>
</div>

<div class="my-4">
    <a class="btn btn-outline-secondary my-1" href="{{ url_for('manage_admin_unit_places_create', id=admin_unit.id) }}" role="button"><i class="fa fa-plus"></i> {{ _('Create place') }}</a>
</div>

<ul class="list-group">
{% for place in places %}
    <li class="list-group-item">
        <div class="dropdown d-inline-block">
            <button class="btn btn-link dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{ place.name }}</button>
            <div class="dropdown-menu">
                <a class="dropdown-item" href="{{ url_for('event_place_update', id=place.id) }}">{{ _('Edit') }}</a>
                <a class="dropdown-item" href="{{ url_for('event_place_delete', id=place.id) }}">{{ _('Delete') }}&hellip;</a>
            </div>
        </div>
    </li>
{% endfor %}
</ul>

<div class="my-4">{{ render_pagination(pagination) }}</div>

{% endblock %}