templates/company/blocks/_contacts.html.twig line 1

Open in your IDE?
  1. <section id="v-pills-contact">
  2.     <div class="row">
  3.         <div class="col">
  4.             <h2>Contacts</h2>
  5.         </div>
  6.         {% if company.contacts|length < 5 and company.locked == 0 %}
  7.             <div class="pr-3">
  8.                 <a href="{{ path('contact_new', {'id_company': company.id}) }}" class="btn btn-sm btn-secondary">
  9.                     <i class="fa fa-plus"></i> Ajouter un contact
  10.                 </a>
  11.             </div>
  12.         {% endif %}
  13.     </div>
  14.     {% if company.contacts|length == 0 %}
  15.         <div class="alert alert-secondary" role="alert">
  16.             Vous n'avez pas encore défini de contact
  17.         </div>
  18.     {% endif %}
  19.     <div class="row">
  20.         {% for contact in company.contacts %}
  21.             <div class="col-sm-6">
  22.                 <div class="card h-100 card-address">
  23.                     <div class="card-header">
  24.                         <div class="row">
  25.                             <div class="col">
  26.                                 {{ contact.name }} {{ contact.lastname }}
  27.                             </div>
  28.                             {% if ((not is_granted('ROLE_COMMERCIAL') and not is_granted('ROLE_ACCOUNTANT'))
  29.                                 or is_granted('ROLE_ADMIN') 
  30.                                 or is_granted('ROLE_COMMERCIAL'))
  31.                                 and company.locked == 0
  32.                             %}
  33.                                 <div>
  34.                                     <a 
  35.                                         class="btn btn-sm btn-secondary btn-action"
  36.                                         href="{{ path('contact_edit', {'id': contact.id} ) }}"
  37.                                     >
  38.                                             <i class="fas fa-pencil-alt"></i>
  39.                                             <span class="sr-only">
  40.                                                 Editer
  41.                                             </span>
  42.                                     </a>
  43.                                 </div>
  44.                                 {% if not is_granted('ROLE_ACCOUNTANT') or is_granted('ROLE_ADMIN') %}
  45.                                     {{ include('contact/_delete_form.html.twig') }}
  46.                                 {% endif %}
  47.                             {% endif %}
  48.                         </div>
  49.                     </div>
  50.                     <div class="card-body">
  51.                         <ul>
  52.                             <li>
  53.                                 {{ contact.function }}
  54.                             </li>
  55.                             <li>
  56.                                 <a href="mailto:{{ contact.email }}">
  57.                                     <i class="fa fa-envelope"></i> {{ contact.email }}
  58.                                 </a>
  59.                             </li>
  60.                             <li>
  61.                                 <a href="tel:{{ contact.phone }}">
  62.                                     <i class="fa fa-phone"></i> {{ contact.phone }}
  63.                                 </a>
  64.                             </li>
  65.                         </ul>
  66.                     </div>
  67.                 </div>
  68.             </div>
  69.         {% endfor %}
  70.     </div>
  71. </section>