{% load i18n l10n fontawesome_5 %}
<div class="table-container w-100 scroll-300">
    {% if parcels|length == 0 %}
    <article class="alert alert-info">
        {% fa5_icon 'search-location' %}
        {% trans 'Parcels can not be calculated, since no geometry is given.' %}
    </article>
    {% else %}
    <div>
        <h4 class="">
            <span class="badge rlp-r">{{num_parcels}}</span>
            {% trans 'Parcels found' %}</h4>
    </div>
    <table id="upper-spatial-table" class="table table-hover">
        <thead>
            <tr>
                <th scope="col">{% trans 'Municipal' %}</th>
                <th scope="col">{% trans 'Municipal key' %}</th>
                <th scope="col">{% trans 'District' %}</th>
                <th scope="col">{% trans 'District key' %}</th>
            </tr>
        </thead>
        <tbody>
        {% for municipal in municipals %}
            <tr>
                <td>{{municipal.name}}</td>
                <td>{{municipal.key|unlocalize}}</td>
                <td>{{municipal.district.name}}</td>
                <td>{{municipal.district.key|unlocalize}}</td>
            </tr>
        {% endfor %}

        </tbody>
    </table>
    <table id="lower-spatial-table" class="table table-hover">
        <thead>
            <tr>
                <th scope="col">{% trans 'Parcel group' %}</th>
                <th scope="col">{% trans 'Parcel group key' %}</th>
                <th scope="col">{% trans 'Parcel' %}</th>
                <th scope="col">{% trans 'Parcel counter' %}</th>
                <th scope="col">{% trans 'Parcel number' %}</th>
            </tr>
        </thead>
        <tbody>
        {% include 'konova/includes/parcels/parcel_table_content.html' %}
        </tbody>
    </table>
    {% endif %}
</div>