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

{% block body_classes %}{{ block.super }} beam-detail{% if component.model %}{% get_options component.model as options %} beam-detail-{{ options.app_label }}-{{ options.model_name }}{% endif %}{% endblock %}

{% block content %}
    <section class="beam-main">
        <div class="container">
            {% block links %}
                <div class="float-right beam-links">
                    {% include "beam/partials/links.html" with links=viewset.links link_layout=component.link_layout %}
                </div>
            {% endblock %}

            {% block heading %}
                <h1>
                    {% if heading %}{{ heading }}{% else %}
                    {% get_options component.model as options %}
                    {{ object }}
                    <small class="text-muted">{{ options.verbose_name|capfirst }}</small>
                    {% endif %}
                </h1>
            {% endblock %}

            <div class="card bg-light mb-4 beam-model-fields">
                <div class="card-body">
                <div class="card-text">
                    {% block details %}
                        {% include "beam/partials/layout.html" with object=object layout=component.layout fields=component.fields %}
                    {% endblock %}
                </div>
                </div>
            </div>
        </div>
    </section>

    {% block above_inlines %}{% endblock %}

    {% block inlines %}
        {% for inline in inlines %}
            <section id="{%  if inline.prefix %}{{ inline.prefix }}-related-inline{% endif %}" class="related-inline">
                <div class="container">
                    <h2>{{ inline.get_title|capfirst }}</h2>
                <div class="card mb-4">
                    <ul class="list-group list-group-flush mb-0">
                        {% for instance in inline.instances %}
                            <li class="list-group-item bg-light">
                                {% include "beam/partials/layout.html" with object=instance layout=inline.layout fields=inline.fields %}
                            </li>
                        {% empty %}
                            <li class="list-group-item bg-light">{% blocktrans with title=inline.get_title %}There aren't any.{% endblocktrans %}</li>
                        {% endfor %}
                    </ul>
                </div>
                </div>
            </section>
        {% endfor %}
    {% endblock %}

    {% block below_inlines %}{% endblock %}
{% endblock %}
