{% extends '@SyliusShop/layout.html.twig' %}

{% form_theme form '@SyliusShop/Form/theme.html.twig' %}

{% set product = product_review.reviewSubject %}

{% block content %}
    <div class="ui hidden divider"></div>
    <div class="ui stackable grid" id="reviews">
        <div class="four wide column">
            {{ sylius_template_event('sylius.shop.product_review.create.product_box', _context) }}
        </div>
        <div class="twelve wide column">
            <div class="ui segment">
                <div class="ui dividing header">
                    {{ 'sylius.ui.write_your_own_review'|trans }}
                    <div class="sub header">
                        {{ 'sylius.ui.you_are_reviewing'|trans }} <strong>{{ product.name }}</strong>.
                    </div>
                </div>

                {{ sylius_template_event('sylius.shop.product_review.create.before_form', {'product_review': product_review}) }}

                {{ form_start(form, {'action': path('sylius_shop_product_review_create', {'slug': product.slug, '_locale': product.translation.locale}), 'attr': {'class': 'ui loadable reply form', 'novalidate': 'novalidate'}}) }}
                    {% include '@SyliusShop/ProductReview/_form.html.twig' %}

                    {{ sylius_template_event('sylius.shop.product_review.create.form', {'product_review': product_review, 'form': form}) }}

                    {{ form_row(form._token) }}
                    <button type="submit" class="ui blue labeled large icon submit button" {{ sylius_test_html_attribute('add') }}>
                        <i class="icon check"></i> {{ 'sylius.ui.add'|trans }}
                    </button>
                {{ form_end(form, {'render_rest': false}) }}
            </div>
        </div>
    </div>
{% endblock %}
