{% extends 'base.html.twig' %}
{% block title %}
{{'page.product.edit'|trans}}
{% endblock %}
{% block bodyClass %}product
{% endblock %}
{% block body %}
<div class="form">
<div class="form__form">
<nav class="tabSteps form__tabSteps">
<div class="tabStep form__tabStep {% if step is null or step == "product-essential"%}active{% endif %}" data-step="product-essential">
<span>{{"page.product.tabs.Essential"|trans}}</span>
</div>
<div class="tabStep form__tabStep {% if step == "product-image" %}active{% endif %}" data-step="product-image">
<span>{{"page.product.tabs.Images"|trans}}</span>
</div>
<div class="tabStep form__tabStep {% if step == "product-combination" %}active{% endif %}" data-step="product-combination">
<span>{{"page.product.tabs.Combinations"|trans}}</span>
</div>
<div class="tabStep form__tabStep {% if step == "product-feature" %}active{% endif %}" data-step="product-feature">
<span>{{"page.product.tabs.Features"|trans}}</span>
</div>
<div class="tabStep form__tabStep {% if step == "product-files" %}active{% endif %}" data-step="product-files">
<span>{{"page.product.tabs.Files"|trans}}</span>
</div>
{# <div class="tabStep form__tabStep {% if step == "product-erp-commercial" %}active{% endif %}" data-step="product-erp-commercial">
<span>{{"page.product.tabs.ERP Commercial"|trans}}</span>
</div>
<div class="tabStep form__tabStep {% if step == "product-erp-logistic" %}active{% endif %}" data-step="product-erp-logistic">
<span>{{"page.product.tabs.ERP Logistics"|trans}}</span>
</div> #}
</nav>
<div class="form__wrapper">
{{ form_start(formProduct) }}
<div class="tab form__tab {% if step is null or step == " product-essential" %}active{% endif %}" data-step="product-essential">
<h2 class="form__title">{{'page.product.edit'|trans}}</h2>
<div class="form__langs">
<div data-tab-name="essential" class="form__lang lang active" data-lang="0">
<div class="lang__name">
<span>{{'page.product.general'|trans}}</span>
</div>
<div class="lang__ico">
{% include "svg/world.svg" %}</div>
</div>
{% for lang in langs %}
{% for productLang in product.productLangs %}
{% if productLang.lang == lang %}
<div data-tab-name="essential" class="langProgression {% if productLang.progression > 98 %}langProgression--green{% elseif productLang.progression > 74 %}langProgression--yellow{% else %}langProgression--red{% endif %}" data-lang="{{lang.id}}">
<div class="langProgression__identity">
<div class="langProgression__name">
<span>{{lang.icu}}</span>
</div>
<div class="langProgression__ico"><img src="/image/svg/ico_{{lang.icu}}.svg"></div>
</div>
<div class="langProgression__progression">{{productLang.progression}}%</div>
</div>
{% endif %}
{% endfor %}
{% endfor %}
</div>
{% include "product/_form.html.twig" %}
</div>
<div class="tab form__tab {% if step == "product-image" %}active{% endif %}" data-step="product-image">
{% include "product/_image.html.twig" %}
</div>
<div class="tab form__tab {% if step == "product-combination" %}active{% endif %}" data-step="product-combination">
{% include "product/_combination.html.twig" %}
</div>
<div class="tab form__tab {% if step == "product-feature" %}active{% endif %}" data-step="product-feature">
{% include "product/_feature.html.twig" %}
</div>
<div class="tab form__tab {% if step == "product-files" %}active{% endif %}" data-step="product-files">
{% include "product/file/_files.html.twig" %}
</div>
{# <div class="tab form__tab {% if step == "product-erp-commercial" %}active{% endif %}" data-step="product-erp-commercial">
{% include "product/erp/commercial.html.twig" %}
</div>
<div class="tab form__tab {% if step == "product-erp-logistic" %}active{% endif %}" data-step="product-erp-logistic">
{% include "product/erp/logistic.html.twig" %}
</div> #}
<div class="form__actions">
<div class="container form__actionsWrapper">
<button class="btn btn__primary" type="submit" class="btn">{{'entity.product.action.Save'|trans}}</button>
<button class="btn btn__primary" name="stay" value="1" type="submit" class="btn">{{'entity.product.action.Save and stay'|trans}}</button>
<span class="btn btn__primary syncButton" data-product-id="{{product.id}}">
{{'page.product.list.action.Sync'|trans}}
</span>
<a tabindex="0" class="btn btn__primary--line" href="{{url('app_product_index')}}">{{'entity.product.action.Back'|trans}}</a>
</div>
</div>
{{ form_end(formProduct, {'render_rest': false}) }}
</div>
</div>
</div>
<div class="modal">
<form method="POST" action="{{url('app_product_sync')}}" class="modal__wrapper">
<input type="hidden" name="productId" id="inputProductId" value="{{product.id}}">
<h2 class="modal__title">Sync product</h2>
<section class="modal__section">
<h3 class="modal__sectionTitle">Select the web sites where your want sync the product</h3>
<div class="modal__checkbox modal__checkbox--type">
{% for site in sites %}
<div class="input_group input_group--checkbox">
<label for="selectSyncSite{{site.id}}">{{site.name}}</label>
<input type="checkbox" id="selectSyncSite{{site.id}}" name="selectSyncSite[]" value="{{site.id}}">
</div>
{% endfor %}
</div>
</section>
<button type="submit" class="btn btn--sizeM btn__primary--line btnExport">Sync</button>
</form>
</div>
{% endblock %}