templates/areas/contact-people-brick/view.html.twig line 1

Open in your IDE?
  1. {% set contacts = pimcore_relations('contacts', {
  2.     classes: ['ContactPerson'],
  3.     title: 'Contactpersonen'
  4. }) %}
  5. {% embed 'app/area-brick-layout.html.twig' %}
  6.     {% block content %}
  7.         <!-- Contact Colleagues -->
  8.         <section class="container py-10">
  9.             {% if editmode or not pimcore_input('contact-people-title').isEmpty() %}
  10.                 <h2 class="my-10 text-4xl">{{ pimcore_input('contact-people-title', { placeholder: 'Titel' }) }}</h2>
  11.             {% endif %}
  12.             <div class="relative z-20 block p-10 text-white bg-blue-300 rounded-md">
  13.                 {% if editmode or not pimcore_input('title').isEmpty() %}
  14.                     <h3 class="text-2xl leading-7">{{ pimcore_input('title', { placeholder: 'Titel' }) }}</h3>
  15.                 {% endif %}
  16.                 {% if editmode %}
  17.                     {{ contacts|raw }}
  18.                 {% else %}
  19.                     {# Don't do `contacts|length` within the loop, that resets the pointer. #}
  20.                     {% set length = contacts|length %}
  21.                     {% for i, contact in contacts %}
  22.                         <div class="
  23.                             flex
  24.                             items-center
  25.                             justify-between
  26.                             {% if not pimcore_input('title').isEmpty() || length > 1 %}
  27.                                 {{ loop.index == length ? 'pt-6' : 'py-6 border-b border-white border-opacity-20' }}
  28.                             {% endif %}
  29.                         ">
  30.                             {% if contact.image %}
  31.                                 <div class="block mr-4">
  32.                                     {{ contact.image.getThumbnail('contact-people-image').html({
  33.                                         imgAttributes: {class: 'rounded-full'}
  34.                                     })|raw }}
  35.                                 </div>
  36.                             {% endif %}
  37.                             <div class="flex flex-col flex-grow">
  38.                                 <span class="text-xl font-bold">{{ contact.name }}</span>
  39.                                 <span>{{ contact.function }}</span>
  40.                             </div>
  41.                             <div class="flex">
  42.                                 {% if contact.phone %}
  43.                                     <a href="tel:{{ contact.phone | phone }}" class="flex items-center justify-center w-10 h-10 mr-6 bg-white rounded-full">
  44.                                         <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path fill="#0072BB" fill-rule="evenodd" d="m19.243 13.03-4-1a1.004 1.004 0 0 0-1.075.416l-2.56 3.84a17.084 17.084 0 0 1-7.894-7.894l3.84-2.56a1 1 0 0 0 .416-1.074l-1-4A1 1 0 0 0 6 0H1a1 1 0 0 0-1 1c.012 10.489 8.511 18.988 19 19a1 1 0 0 0 1-1v-5a1 1 0 0 0-.757-.97Z"/></svg>
  45.                                     </a>
  46.                                 {% endif %}
  47.                                 {% if document.hasProperty('contactPage') and data.request.url != document.getProperty('contactPage').getUrl() %}
  48.                                     <a href="{{ document.getProperty('contactPage').getUrl() | trimUrl }}" target="_blank" class="flex items-center justify-center w-10 h-10 bg-white rounded-full">
  49.                                         <svg xmlns="http://www.w3.org/2000/svg" width="20" height="17"><path fill="#0072BB" fill-rule="evenodd" d="M2 14.5V6.04l7.594 3.375a.999.999 0 0 0 .812 0L18 6.039V14.5H2Zm16-12v1.35l-8 3.555-8-3.554V2.5h16Zm2 1.98V1.5a1 1 0 0 0-1-1H1a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V4.48Z"/></svg>
  50.                                     </a>
  51.                                 {% endif %}
  52.                                 {# Temporarily disabled in favor of ↑ (COOL-186) #}
  53.                                 {#<a href="mailto:{{ contact.email }}" target="_blank" class="flex items-center justify-center w-10 h-10 bg-white rounded-full">
  54.                                     <svg xmlns="http://www.w3.org/2000/svg" width="20" height="17"><path fill="#0072BB" fill-rule="evenodd" d="M2 14.5V6.04l7.594 3.375a.999.999 0 0 0 .812 0L18 6.039V14.5H2Zm16-12v1.35l-8 3.555-8-3.554V2.5h16Zm2 1.98V1.5a1 1 0 0 0-1-1H1a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V4.48Z"/></svg>
  55.                                 </a>#}
  56.                             </div>
  57.                         </div>
  58.                     {% endfor %}
  59.                 {% endif %}
  60.             </div>
  61.         </section>
  62.     {% endblock %}
  63. {% endembed %}