{% extends "tenant_admin/action_page.html" %}{% load static smart i18n %}
{% block content_title %}<h1>{{ original }}</h1>{% endblock %}
{% block content %}
    {% if not linked and not empty %}
        <div>{% trans "No linked objects found" %}</div>
    {% else %}
        {% for e in linked %}
            <fieldset class="module">
                {% url admin_site.name|add:e.link as changelist_url %}
                <h2 class="">{{ e.related_name }} ({{ e.field_name }}) | {{ e.count }} records
                    {% if changelist_url %}
                        <a href="{{ changelist_url }}?{{ e.filter }}">goto</a>
                    {% endif %}
                </h2>
                <table>
                    {% for row in e.data %}
                        <tr>
                            <td>{% get_admin_href row 'pk' %}</td>
                            <td>{{ row }}</td>
                        </tr>
                    {% endfor %}
                </table>
            </fieldset>
        {% endfor %}
        {% if show_empty %}
            <fieldset class="module">
                <h2 class="">Empty Relationships</h2>
                <ul>
                    {% for e in empty %}
                        <li>{{ e.related_name }}</li>
                    {% endfor %}
                </ul>
            </fieldset>
        {% endif %}
    {% endif %}
{% endblock content %}
{% block footer %}
    <div id="footer"></div>
{% endblock %}
