{% extends "beam/base.html" %}
{% load i18n %}
{% load beam_tags %}


{% block heading %}
    <h1>{% trans "Objects" %}</h1>
{% endblock %}

{% block content %}
    {% if object_list %}
        <table class="table">
            <thead class="thead-light">
            <tr>
                {% for field in viewset_context.fields %}
                    <th scope="col">{{ field }}</th>
                {% endfor %}
                <th>{% trans "Actions" %}</th>
            </tr>
            </thead>
            <tbody>
            {% for object in object_list %}
                <tr>
                    {% for field in viewset_context.fields %}
                        <td>{% get_attribute object field %}</td>
                    {% endfor %}
                    <td>
                        {% get_link_url links.detail object as detail_url %}
                        <a href="{{ detail_url }}" class="btn btn-secondary">{{ links.detail.verbose_name }}</a>
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    {% endif %}
{% endblock %}
