{% extends "main_card.html.twig" %}

{% block title %}
    {% trans with {'%name%': part.name} %}part.edit.title{% endtrans %}
{% endblock %}

{% block card_title %}
    <i class="fas fa-edit fa-fw" aria-hidden="true"></i>
    {% trans with {'%name%': part.name} %}part.edit.card_title{% endtrans %}
    <b><a href="{{ part|entityURL('info') }}" class="text-white">{{ part.name }}</a></b>
    <div class="float-right">
        {% trans %}id.label{% endtrans %}: {{ part.id }}
    </div>
{% endblock %}

{% block card_content %}

    <ul class="nav nav-tabs">
        <li class="nav-item">
            <a class="nav-link active" data-toggle="tab" role="tab" href="#common">
                <i class="fas fa-id-card fa-fw"></i>
                {% trans %}part.edit.tab.common{% endtrans %}
            </a>
        </li>
        <li class="nav-item">
            <a class="nav-link" data-toggle="tab" role="tab" href="#manufacturer">
                <i class="fas fa-industry fa-fw"></i>
                {% trans %}part.edit.tab.manufacturer{% endtrans %}
            </a>
        </li>
        <li class="nav-item">
            <a class="nav-link" data-toggle="tab" role="tab" href="#advanced">
                <i class="fas fa-shapes fa-fw"></i>
                {% trans %}part.edit.tab.advanced{% endtrans %}
            </a>
        </li>
        <li class="nav-item">
            <a class="nav-link" data-toggle="tab" role="tab" href="#part_lots">
                <i class="fas fa-boxes fa-fw"></i>
                {% trans %}part.edit.tab.part_lots{% endtrans %}
            </a>
        </li>
        <li class="nav-item">
            <a class="nav-link" data-toggle="tab" role="tab" href="#attachments">
                <i class="fas fa-paperclip fa-fw"></i>
                {% trans %}part.edit.tab.attachments{% endtrans %}
            </a>
        </li>
        <li class="nav-item">
            <a class="nav-link" data-toggle="tab" role="tab" href="#orderdetails">
                <i class="fas fa-shopping-cart fa-fw"></i>
                {% trans %}part.edit.tab.orderdetails{% endtrans %}
            </a>
        </li>
        <li class="nav-item">
            <a class="nav-link" data-toggle="tab" role="tab" href="#comment">
                <i class="fas fa-sticky-note fa-fw"></i>
                {% trans %}part.edit.tab.comment{% endtrans %}
            </a>
        </li>
    </ul>

    {{ form_start(form) }}
    <div class="tab-content">

        <div class="tab-pane fade show active p-2" id="common" role="tabpanel">
            {% include "Parts/edit/_main.html.twig" %}
        </div>
        <div class="tab-pane fade p-2" id="manufacturer" role="tabpanel">
            {% include "Parts/edit/_manufacturer.html.twig" %}
        </div>
        <div class="tab-pane fade p-2" id="advanced" role="tabpanel">
            {% include "Parts/edit/_advanced.html.twig" %}
        </div>
        <div class="tab-pane fade p-2" id="part_lots" role="tabpanel">
            {% include "Parts/edit/_lots.html.twig" %}
        </div>
        <div class="tab-pane fade p-2" id="attachments" role="tabpanel">
            {% include "Parts/edit/_attachments.html.twig" %}
        </div>
        <div class="tab-pane fade p-2" id="orderdetails" role="tabpanel">
            {% include "Parts/edit/_orderdetails.html.twig" %}
        </div>
        <div class="tab-pane fade p-2" id="comment" role="tabpanel">
            {{ form_widget(form.comment)}}
        </div>



    </div>
    {{ form_row(form.save) }}
    {{ form_row(form.reset) }}
    {{ form_errors(form) }}
    {{ form_end(form) }}
{% endblock %}