{# Leave this template at bootstrap 4 for now, as it otherwise destroys our layout #}
{% form_theme form.orderdetails with ['Parts/edit/edit_form_styles.html.twig', "bootstrap_4_layout.html.twig"] %}
{% import 'components/collection_type.macro.html.twig' as collection %}

<div {{ collection.controller(form.orderdetails, 'orderdetails.edit.delete.confirm') }}>
    <table class="table table-striped table-sm table-responsive-md" id="orderdetails_table" {{ collection.target() }}>
        <tbody>
        {% for detail in form.orderdetails %}
            {{ form_widget(detail, {'disable_delete' : not is_granted('orderdetails.delete', part)}) }}
        {% endfor %}
        </tbody>
    </table>

    <button type="button" class="btn btn-success" {{ collection.create_btn() }} {% if not is_granted('orderdetails.create', part) %}disabled{% endif %}>
        <i class="fas fa-plus-square fa-fw"></i>
        {% trans %}orderdetail.create{% endtrans %}
    </button>
</div>
