{% extends '@CpCreationVitiCore/admin/base.html.twig' %}

{% block content %}
    <div class="panel panel-default">
        <div class="panel-heading">
            Configuration des taxes
           {% if items|length < 1 %}
            <div class="pull-right">
                <div class="btn-group">
                    <a href="{{ path('admin_product_tax_new') }}" type="button" class="btn btn-default btn-xs">
                        Ajouter
                    </a>
                </div>
            </div>
            {% endif %}
        </div>
        <table class="table table-striped">
            <thead>
            <tr>
                <th>#</th>
                <th>Nom</th>
                <th>Value</th>
                <th>Défaut</th>
                <th>inPro</th>
                <th>outPro</th>
                <th>inParticulier</th>
                <th>outParticulier</th>
                <th></th>
            </tr>
            </thead>
            <tbody>
            {% for item in items %}
                <tr>
                    <td>{{ loop.index }}</td>
                    <td>{{ item.name}}</td>
                    <td>{{ item.value * 100 }} %</td>
                    <td>{% if item.byDefault  %} Oui {% else %} Non {% endif %}</td>
                    <td>{% if item.inPro  %} Oui {% else %} Non {% endif %}</td>
                    <td>{% if item.outPro  %} Oui {% else %} Non {% endif %}</td>
                    <td>{% if item.inCustomer  %} Oui {% else %} Non {% endif %}</td>
                    <td>{% if item.outCustomer  %} Oui {% else %} Non {% endif %}</td>
                    <td>
                        <a href="{{ path('admin_product_tax_edit', { id: item.id}) }}" class="btn btn-info btn-xs"
                           data-toggle="tooltip" title="Editer la taxe"><i
                                    class="fas fa-edit fa-2x"></i></a>

                        <a href="{{ path('admin_product_tax_delete', { id: item.id }) }}"
                           class="confirm-deletable btn btn-danger btn-xs"
                           data-toggle="tooltip" title="Supprimer la taxe" data-title="Supprimer la taxe">
                            <i class="fa fa-2x fa-trash"></i></a>
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
{% endblock %}
