<section id="v-pills-contact">
<div class="row">
<div class="col">
<h2>Contacts</h2>
</div>
{% if company.contacts|length < 5 and company.locked == 0 %}
<div class="pr-3">
<a href="{{ path('contact_new', {'id_company': company.id}) }}" class="btn btn-sm btn-secondary">
<i class="fa fa-plus"></i> Ajouter un contact
</a>
</div>
{% endif %}
</div>
{% if company.contacts|length == 0 %}
<div class="alert alert-secondary" role="alert">
Vous n'avez pas encore défini de contact
</div>
{% endif %}
<div class="row">
{% for contact in company.contacts %}
<div class="col-sm-6">
<div class="card h-100 card-address">
<div class="card-header">
<div class="row">
<div class="col">
{{ contact.name }} {{ contact.lastname }}
</div>
{% if ((not is_granted('ROLE_COMMERCIAL') and not is_granted('ROLE_ACCOUNTANT'))
or is_granted('ROLE_ADMIN')
or is_granted('ROLE_COMMERCIAL'))
and company.locked == 0
%}
<div>
<a
class="btn btn-sm btn-secondary btn-action"
href="{{ path('contact_edit', {'id': contact.id} ) }}"
>
<i class="fas fa-pencil-alt"></i>
<span class="sr-only">
Editer
</span>
</a>
</div>
{% if not is_granted('ROLE_ACCOUNTANT') or is_granted('ROLE_ADMIN') %}
{{ include('contact/_delete_form.html.twig') }}
{% endif %}
{% endif %}
</div>
</div>
<div class="card-body">
<ul>
<li>
{{ contact.function }}
</li>
<li>
<a href="mailto:{{ contact.email }}">
<i class="fa fa-envelope"></i> {{ contact.email }}
</a>
</li>
<li>
<a href="tel:{{ contact.phone }}">
<i class="fa fa-phone"></i> {{ contact.phone }}
</a>
</li>
</ul>
</div>
</div>
</div>
{% endfor %}
</div>
</section>