{% 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 extra_scripts %}{{ block.super }}{% for inline in inlines %}{{ inline.filterset.form.media.js }}{% for action in inline.actions %}{{ action.get_form.media.js }}{% endfor %}{% endfor %}{% endblock %}
{% block extra_styles %}{{ block.super }}{% for inline in inlines %}{{ inline.filterset.form.media.css }}{% for action in inline.actions %}{{ action.get_form.media.css }}{% endfor %}{% endfor %}{% endblock %}


{% block title %}
    {% if heading %}
        {{ heading }}
    {% else %}
        {% get_options component.model as options %}
        {{ object }}
        | {{ options.verbose_name|capfirst }}
    {% endif %}
    | {{ block.super }}
{% endblock %}


{% block content %}
    {% block main_container %}
    <main class="beam-main">
        {% block main %}

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

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

            {% block details_container %}
                <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>
            {% endblock %}

        {% endblock %}
    </main>
    {% endblock %}

    {% block above_inlines %}{% endblock %}

    {% block inlines %}
        {% for inline in inlines %}
            {% block inline %}
                {% include inline.detail_template_name|default:"beam/partials/detail_inline.html" %}
            {% endblock %}
        {% endfor %}
    {% endblock %}

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