{% load bootstrap3 %}
{% load i18n %}

{% include 'editor/fragment_levels.html' %}

<h3>
    {{ model_title_plural }}
    {% if space %}
        {% with space.title as space_title %}
            <small>{% blocktrans %}in space {{ space_title }}{% endblocktrans %}</small>
        {% endwith %}
    {% elif level %}
        {% with level.title as level_title %}
            <small>{% blocktrans %}on level {{ level_title }}{% endblocktrans %}</small>
        {% endwith %}
    {% endif %}
</h3>
{% bootstrap_messages %}
{% if can_create %}
    <a class="btn btn-default btn-xs" accesskey="n" href="{{ create_url }}">
        <i class="glyphicon glyphicon-plus"></i> {% blocktrans %}New {{ model_title }}{% endblocktrans %}
    </a>
{% endif %}

{% if explicit_edit %}
    {% trans 'Details' as edit_caption %}
{% else %}
    {% trans 'Edit' as edit_caption %}
{% endif %}

<table class="table table-condensed itemtable" data-nozoom data-list="{{ model_name }}">
    <tbody>
        {% for item in objects %}
            {% if forloop.counter0|divisibleby:10 %}
                <tr>
                    <td><a href="{{ back_url }}" data-no-next-zoom>&laquo; {{ back_title }}</a></td>
                    <td></td>
                </tr>
            {% endif %}
            <tr data-pk="{{ item.pk }}">
                <td>{{ item.title }}</td>
                <td><a href="{{ item.edit_url }}">{{ edit_caption }}</a></td>
            </tr>
        {% endfor %}
        <tr>
            <td><a href="{{ back_url }}" data-no-next-zoom>&laquo; {{ back_title }}</a></td>
            <td></td>
        </tr>
    </tbody>
</table>
