{% extends app.request.xmlHttpRequest?"BackendBaseBundle:Layout:bootstrapModalLayout.html.twig":"BackendBaseBundle:Layout:bootstrapFrameLayout.html.twig" %}

{% import "BackendBaseBundle:Backend/Base:_typeRender.html.twig" as renderer %}

{% block content %}
    <div class="ibox">
        <div class="ibox-content">
            <table class="table table-bordered">
                {% for columnName, column in _config.view %}
                <tr>
                    <td>{{ column.label|default|trans({}, 'forms') }}</td>
                    <td>
                        {%- if column.template is defined -%}
                            {% include column.template with {data: fetch_relation(object, columnName|filter_prefix)} %}
                        {%- else -%}
                            {{ renderer.render(fetch_relation(object, columnName|filter_prefix), _config.columnMap[columnName|filter_prefix]|default) }}
                        {%- endif -%}
                    </td>
                </tr>
                {% endfor %}
            </table>
        </div>
    </div>
{% endblock %}
