<section id="network " class="p-4 my-8 bg-white shadow-xl sm:p-8 xl:p-16 max-w-8xl">
{% if app.user and profile.network %}
{% do section_navigation_add({ name: 'network', anchor: 'network' }) %}
<div class="mx-auto ">
<div class="container">
<h2 class="text-lg font-medium uppercase md:text-xl font-headline mb-7">
{{ 'network'|trans }}
{% if user.id is defined and profile.id == user.id %}
<small class="underline lowercase"><a data-turbo="false" href="{{ path('profile_admin_network_index') }}">({{ 'edit'|trans }})</a></small>
{% endif %}
</h2>
<div class="grid xl:grid-cols-1 gap-7 md:gap-14">
<ul class="grid xl:grid-cols-2 gap-7 md:gap-10">
{% for profile in profile.network|sort((a, b) => a.name <=> b.name) %}
<li class="bg-neutral-50">
{% include "network/profile/components/profile_card_network.html.twig" with { profile: profile} %}
</li>
{% endfor %}
</ul>
<div>
{% set marker = [] %}
{% for profile in profile.network|filter(profile => profile.geolocation) %}
{% set marker = [{
geolocation: [profile.geolocation.latitude, profile.geolocation.longitude],
color: profile.color.hex,
title: profile.name,
href: pimcore_url({object: profile}),
text: profile.street ~ profile.housenumber ~ '<br>' ~ profile.postalCode ~ ' ' ~ profile.city ~ '<br>' ~ profile.country|country_name
}]|merge(marker) %}
{% endfor %}
<div class="hidden aspect-w-16 aspect-h-9 xl:aspect-w-1 xl:aspect-h-1"
data-controller="leaflet"
data-leaflet-options-value="{{ {
fitBoundsToMarker: true,
}|json_encode }}"
data-leaflet-marker-value="{{ marker|json_encode }}">
<template data-leaflet-target="markerTemplate">
<b>%title%</b><br />
<span>%text%</span><br />
<a href="%href%">{{ 'details'|trans }}</a><br />
</template>
<div class="w-full h-full map" data-leaflet-target="map"></div>
</div>
</div>
</div>
</div>
</div>
{% elseif not app.user %}
<div class="container">
<h2 class="text-lg font-medium uppercase md:text-xl font-headline mb-7">
{{ 'network'|trans }}
</h2>
{% include 'network/profile/components/login_required_hint.html.twig' %}
</div>
{% else %}
<h2 class="text-xl font-medium text-black uppercase mb-7 md:text-xl font-headline">
{{ 'network'|trans }}
{% if user.id is defined and profile.id == user.id %}
<small class="underline lowercase"><a data-turbo="false" href="{{ path('profile_admin_network_index') }}">({{ 'edit'|trans }})</a></small>
{% endif %}
</h2>
{{'no.profile.network.available'|trans}}
{% endif %}
</section>