[% extends "base.html" %]

[% block title %]
{{ current_model.name }} list
[% endblock %]

[% block content %]

<h1>
    {{ current_model.name }} list
</h1>

<table class="table table-bordered">

    <tr>
        <th>

        </th>

        {% for field in current_model.fields %}
            <th>
                {{ field.name|capitalize }}
            </th>
        {% endfor %}

        <th>
            Actions
        </th>
    </tr>


    [% for object in object_list %]
    <tr>
        <td>
            <a href="[[ object.get_absolute_url ]]">[[ object ]]</a>
        </td>

        {% for field in current_model.fields %}
            <td>
                [[ object.{{ field.name }} ]]
            </td>
        {% endfor %}

        <td>
            <a href="[% url " {{ app_name }}:delete_{{ current_model.name|lower }}" object.pk %]">[% trans "Delete record" %]</a>
            /
            <a href="[[ object.get_update_url ]]">[% trans "Edit record" %]</a>
        </td>
    </tr>
    [% endfor %]
</table>
[% endblock %]
