{% from '@SyliusAdmin/Macro/translationForm.html.twig' import translationFormWithSlug %}

<div class="ui active tab" data-tab="details">
    <h3 class="ui top attached header">{{ 'sylius.ui.details'|trans }}</h3>

    <div class="ui attached segment">
        {{ form_errors(form) }}

        <div class="ui two column stackable grid">
            <div class="column">
                <div class="ui segment">
                    {{ form_row(form.code) }}
                    {{ form_row(form.enabled) }}
                    {% if product.simple %}
                        {{ form_row(form.variant.shippingRequired) }}
                    {% else %}
                        {{ form_row(form.options) }}
                        {{ form_row(form.variantSelectionMethod) }}
                    {% endif %}

                    {# Nothing to see here. #}
                    <div class="ui hidden element">
                        {% if product.simple %}
                            {{ form_row(form.variant.translations) }}
                            {{ form_row(form.variantSelectionMethod) }}
                        {% endif %}
                    </div>
                </div>
            </div>
            <div class="column">
                {{ form_row(form.channels) }}
            </div>
        </div>
        {% if product.simple %}
            <div class="ui one column stackable grid">
                <div class="column">
                    <h4 class="ui dividing header">{{ 'sylius.ui.pricing'|trans }}</h4>
                    {% include "@SyliusAdmin/Product/_channel_pricing.html.twig" with { product: product, variantForm: form.variant } only %}
                </div>
            </div>
        {% endif %}
        <div class="ui hidden divider"></div>
        {{ translationFormWithSlug(form.translations, '@SyliusAdmin/Product/_slugField.html.twig', product) }}
        {% if product.simple %}
        <div class="ui hidden divider"></div>
        <div class="ui two column stackable grid">
            <div class="column">
                <h4 class="ui top attached header">{{ 'sylius.ui.shipping'|trans }}</h4>
                <div class="ui attached segment">
                    {{ form_row(form.variant.shippingCategory) }}
                    {{ form_row(form.variant.width) }}
                    {{ form_row(form.variant.height) }}
                    {{ form_row(form.variant.depth) }}
                    {{ form_row(form.variant.weight) }}
                </div>
            </div>
            <div class="column">
                <h4 class="ui top attached header">{{ 'sylius.ui.taxes'|trans }}</h4>
                <div class="ui attached segment">
                    {{ form_row(form.variant.taxCategory) }}
                </div>
            </div>
        </div>
        {% endif %}

        {{ sylius_template_event(['sylius.admin.product.' ~ action ~ '.tab_details', 'sylius.admin.product.tab_details'], {'form': form}) }}
    </div>
</div>
