{% extends 'Common/base.html.twig' %}
{% import 'Common/parts/functions.html.twig' as function %}
{% block title %}{{ 'admin.zones.establishment.show.title'|trans }} - {{ establishment.name | title }} | {{ parent() }}{% endblock %}
{% block classBody %}whaterpoint {{ parent() }}{% endblock %}
{% block javascripts %}
{{ parent() }}
{{ encore_entry_script_tags('leaflet_js') }}
{{ encore_entry_script_tags('wt_establishment_show') }}
{% endblock javascripts %}
{% block stylesheets %}
{{ parent() }}
{{ encore_entry_link_tags('leaflet_styles') }}
<link rel="stylesheet" href="{{ asset('assets/lib/slick-carousel/slick/slick.css') }}" type="text/css" media="all" />
<link rel="stylesheet" href="{{ asset('assets/lib/slick-carousel/slick/slick-theme.css') }}" type="text/css" media="all" />
{% endblock stylesheets %}
{% block contents %}
<div class="container-small" ng-controller="showEstablishmentCtrl">
<nav class="mb-2" aria-label="breadcrumb">
<ol class="breadcrumb mb-0">
<li class="breadcrumb-item"><a href="{{path('web_init')}}">Inicio</a></li>
<li class="breadcrumb-item">{{ establishment.town.country.name | title }}</li>
<li class="breadcrumb-item"><a href="{{path('web_public_town_show_by_slug',{'townSlug':establishment.town.slug})}}">{{ establishment.town.name | title }}</a></li>
<li class="breadcrumb-item active" aria-current="page">
{{ establishment.name | title }}
{% if is_granted('IS_AUTHENTICATED_REMEMBERED') and app.user.user.hasRole('ROLE_ADMIN') %}
(<a href="{{path('web_admin_establishment_edit', {'establishmentId': establishment.id})}}">Editar</a>)
{% endif %}
</li>
</ol>
</nav>
<div class="pb-9">
<h2 class="mb-4">{{ establishment.name | title }}</h2>
<div class="row g-5 mb-5">
<div class="col-12 col-lg-8" ng-init="initEstablishmentMap({{establishment.latitude}},{{establishment.longitude}},'{{establishment.town.name | url_encode }}')">
<div id="establishment_map" style="height:400px;width:100%"></div>
</div>
<div class="col-12 col-lg-4">
<h3 class="mb-3" >Establecimiento</h3>
<div class="mb-2">
<h6 class="mb-0">Establecimiento</h6>
<div class="">{{ establishment.name | title }}</div>
</div>
{% if establishment.tipology is not none and establishment.tipology != 'ET_OTHERS' %}
<div class="mb-2">
<h6 class="mb-0">Tipología</h6>
<div class="">{{ ('admin.establishment.tipology.' ~ establishment.tipology) | trans }}</div>
</div>
{% endif %}
<div class="mb-2">
<h6 class="mb-0">Municipio</h6>
<div class="">{{ establishment.town.name | title }}</div>
</div>
{% if establishment.town.countryArea %}
<div class="mb-2">
<h6 class="mb-0">Región / Provincia</h6>
<div class="">{{ establishment.town.countryArea.name | title }}</div>
</div>
{% endif %}
<div class="mb-2">
<h6 class="mb-0">País</h6>
<div class="">{{ establishment.town.country.name | title }}</div>
</div>
<div class="mb-2">
<h6 class="mb-0">Whaterpoints</h6>
<div class="">
{{ establishment.whaterPoints | length}}
{% if (establishment.whaterPoints | length)> 0 %}
<a href="#" class="fs--1" ng-click="showWhaterPointsInMap()">(Ver en el mapa)</a>
<div class="alert alert-soft-success px-1 py-1 ng-hide" role="alert" ng-show="showWhaterPoints" >Estas viendo los Whaterpoints del establecimiento</div>
{% endif %}
</div>
</div>
</div>
</div>
<div class="row g-5 mb-5">
<div class="col-12" >
<h3 class="mb-3" >Red de distribución</h3>
<ul class="list-group">
{% if distributionNetwork %}
<li class="list-group-item">
<a href="{{ path('web_public_distribution_network_show_by_id',{'distributionNetworkId':distributionNetwork.id})}}"
class="fs-0 fw-bold">{{ distributionNetwork.name | title }}</a>
<div class="ms-2 me-auto">
Tipo:
<span class="fw-bold">{{ ('distributionNetwork.type.' ~ distributionNetwork.type) | trans }}</span>
</div>
<div class="ms-2 me-auto">
Estado:
{% if distributionNetwork.whaterStatus == 'DN_STATUS_SUITABLE' %}
<span class="fw-bold text-success ">Apta</span>
{% elseif distributionNetwork.whaterStatus == 'DN_STATUS_NOT_SUITABLE' %}
<span class="fw-bold text-danger ">No apta</span>
{% else %}
<span class="fw-bold">Sin Información</span>
{% endif %}
</div>
<div class="ms-2 me-auto">
Fecha última actualización:
<span class="fw-bold">{{distributionNetwork.lastAnalitycsUpdateAt | date('d-m-Y') }}</span>
</div>
{% if distributionNetwork.sinacId is not none and town.externalIds is not none and town.externalIds.sinac is defined %}
<div class="ms-2 me-auto">
Enlace web SINAC:
<a href="{{ sinac_domain }}/CiudadanoWeb/ciudadano/informacionAbastecimientoActionDetalleRed.do?idRed={{ distributionNetwork.sinacId }}&codMunicipio={{ town.externalIds.sinac}}"
target="_black"
>http://ssinacv2.sanidad.gob.es/</a>
</div>
{% endif %}
</li>
{% endif %}
</ul>
</div>
</div>
</div>
</div>
{% endblock contents %}