{% block titlebar %}
    {% block titlebar_button_bar %}
    <div class="button-bar">
        {# BACK #}
        {% block back_button %}
            {% include ['flex-objects/types/' ~ target ~ '/buttons/back.html.twig', 'flex-objects/types/default/buttons/back.html.twig'] %}
        {% endblock back_button %}

        {# PREVIEW #}
        {% if can_preview %}
        {% block preview_button %}
            {% include ['flex-objects/types/' ~ target ~ '/buttons/preview.html.twig', 'flex-objects/types/default/buttons/preview.html.twig'] %}
        {% endblock preview_button %}
        {% endif %}

        {# DELETE #}
        {% if can_delete %}
        {% block delete_button %}
            {% include ['flex-objects/types/' ~ target ~ '/buttons/delete.html.twig', 'flex-objects/types/default/buttons/delete.html.twig'] %}
        {% endblock delete_button %}
        {% endif %}

        {% block extra_buttons %}{% endblock extra_buttons %}

        {# SAVE #}
        {% if allowed and can_save %}
        {% block save_button %}
            {% include ['flex-objects/types/' ~ target ~ '/buttons/save.html.twig', 'flex-objects/types/default/buttons/save.html.twig'] with {task: 'save'} %}
        {% endblock save_button %}
        {% endif %}
    </div>
    {% endblock titlebar_button_bar %}

    {% block titlebar_title %}
    <h1>
        {% if allowed %}
            <i class="fa fa-fw {{ title_icon }}"></i>
            {{ not object.exists ? '[NEW]' }} {{ title }}
        {% else %}
            <i class="fa fa-fw fa-exclamation-triangle"></i>
            {{ 'PLUGIN_ADMIN.ERROR'|tu }}
        {% endif %}
    </h1>
    {% endblock titlebar_title %}

{% endblock %}
