templates/network/profile/sections/network/profile_section_network_network.html.twig line 1

Open in your IDE?
  1. <section id="network " class="p-4 my-8 bg-white shadow-xl sm:p-8 xl:p-16 max-w-8xl">
  2. {% if app.user and profile.network %}
  3.   {% do section_navigation_add({ name: 'network', anchor: 'network' }) %}
  4.   <div class="mx-auto ">
  5.     <div class="container">
  6.       <h2 class="text-lg font-medium uppercase md:text-xl font-headline mb-7">
  7.         {{ 'network'|trans }}
  8.         {% if user.id is defined and profile.id == user.id %}
  9.           <small class="underline lowercase"><a data-turbo="false" href="{{ path('profile_admin_network_index') }}">({{ 'edit'|trans }})</a></small>
  10.         {% endif %}
  11.       </h2>
  12.       <div class="grid xl:grid-cols-1 gap-7 md:gap-14">
  13.         <ul class="grid xl:grid-cols-2 gap-7 md:gap-10">
  14.           {% for profile in profile.network|sort((a, b) => a.name <=> b.name) %}
  15.             <li class="bg-neutral-50">
  16.               {% include "network/profile/components/profile_card_network.html.twig" with { profile: profile} %}
  17.             </li>
  18.           {% endfor %}
  19.         </ul>
  20.         <div>
  21.           {% set marker = [] %}
  22.           {% for profile in profile.network|filter(profile => profile.geolocation) %}
  23.             {% set marker = [{
  24.               geolocation: [profile.geolocation.latitude, profile.geolocation.longitude],
  25.               color: profile.color.hex,
  26.               title: profile.name,
  27.               href: pimcore_url({object: profile}),
  28.               text: profile.street ~ profile.housenumber ~ '<br>' ~ profile.postalCode ~ ' ' ~ profile.city ~ '<br>' ~ profile.country|country_name
  29.             }]|merge(marker) %}
  30.           {% endfor %}
  31.           <div class="hidden aspect-w-16 aspect-h-9 xl:aspect-w-1 xl:aspect-h-1"
  32.             data-controller="leaflet"
  33.             data-leaflet-options-value="{{ {
  34.               fitBoundsToMarker: true,
  35.             }|json_encode }}"
  36.             data-leaflet-marker-value="{{ marker|json_encode }}">
  37.             <template data-leaflet-target="markerTemplate">
  38.               <b>%title%</b><br />
  39.               <span>%text%</span><br />
  40.               <a href="%href%">{{ 'details'|trans }}</a><br />
  41.             </template>
  42.             <div class="w-full h-full map" data-leaflet-target="map"></div>
  43.           </div>
  44.         </div>
  45.       </div>
  46.     </div>
  47.   </div>
  48.   {% elseif not app.user %}
  49.       <div class="container">
  50.         <h2 class="text-lg font-medium uppercase md:text-xl font-headline mb-7">
  51.           {{ 'network'|trans }}
  52.         </h2>
  53.         {% include 'network/profile/components/login_required_hint.html.twig' %}
  54.       </div>
  55. {% else %}
  56. <h2 class="text-xl font-medium text-black uppercase mb-7 md:text-xl font-headline">
  57.         {{ 'network'|trans }}
  58.         {% if user.id is defined and profile.id == user.id %}
  59.           <small class="underline lowercase"><a data-turbo="false" href="{{ path('profile_admin_network_index') }}">({{ 'edit'|trans }})</a></small>
  60.         {% endif %}
  61.       </h2>
  62.       
  63.       {{'no.profile.network.available'|trans}}
  64. {% endif %}
  65. </section>