{% extends 'Common/base.html.twig' %}
{% import 'Common/parts/functions.html.twig' as function %}
{% block title %}{{ 'admin.zones.town.show.title'|trans }} - {{ town.name | title }} | {{ parent() }}{% endblock %}
{% block classBody %}town {{ parent() }}{% endblock %}
{% block ogTitle %}{{ 'admin.zones.town.show.title'|trans }} - {{ town.name | title }} | {{ parent() }}{% endblock ogTitle %}
{% 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 javascripts %}
{{ parent() }}
{{ encore_entry_script_tags('leaflet_js') }}
{{ encore_entry_script_tags('wt_town_show') }}
{% endblock javascripts %}
{% block contents %}
<div class="container-small" ng-controller="showTownCtrl">
<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">{{ town.country.name | title }}</li>
{% if town.countryArea %}
<li class="breadcrumb-item"><a href="{{ path('web_public_country_area_show_by_slug', { 'countryAreaSlug': town.countryArea.slug})}}">{{ town.countryArea.name | title }}</a></li>
{% endif %}
<li class="breadcrumb-item active" aria-current="page">
{{ town.name | title }}
{% if is_granted('IS_AUTHENTICATED_REMEMBERED') and app.user.user.hasRole('ROLE_ADMIN') %}
(<a href="{{path('web_admin_town_edit', {'townId': town.id})}}">Editar</a>)
{% endif %}
</li>
</ol>
</nav>
<div class="pb-9">
<h2 class="mb-4">
{{ town.name | title }}
{% if town.whaterOrganization is none %}
<span class="fas fa-star-half-alt text-warning fs-1" title="Sin reclamar"></span>
<span class="fas fa-star-half-alt text-warning fs-1" title="Sin verificar"></span>
{% elseif town.whaterOrganization.checkPermission('PERMISSION_EDIT_TOWN', town) %}
<span class="fas fa-star text-success fs-1" title="Registrado"></span>
<span class="fas fa-star text-success fs-1" title="Verificado"></span>
{% else %}
<span class="fas fa-star text-success fs-1" title="Registrado"></span>
<span class="fas fa-star-half-alt text-warning fs-1" title="Sin verificar"></span>
{% endif %}
</h2>
<div class="row g-5 mb-5">
<div class="col-12 col-lg-8" ng-init="initTownMap('{{town.id}}',{{town.latitude}},{{town.longitude}},'{{geometryPolygonArray}}')">
<div id="town_map" style="height:400px;width:100%"></div>
</div>
<div class="col-12 col-lg-4">
<h3 class="mb-3" >Municipio</h3>
<div class="mb-2">
<h6 class="mb-0">Municipio</h6>
<div class="">{{ town.name | title }}</div>
</div>
{% if town.countryArea %}
<div class="mb-2">
<h6 class="mb-0">Región / Provincia</h6>
<a class="" href="{{ path('web_public_country_area_show_by_slug', { 'countryAreaSlug': town.countryArea.slug})}}">{{ town.countryArea.name | title }}</a>
</div>
{% endif %}
<div class="mb-2">
<h6 class="mb-0">País</h6>
<div class="">{{ town.country.name | title }}</div>
</div>
<div class="mb-2">
<h6 class="mb-0">Localizaciones</h6>
<div class="">
{{ town.townLocations | length}}
{#
{% if (town.townLocations | length)> 0 %}
<a href="#" class="fs--1" ng-click="showTownLocationsInMap()">(Ver en el mapa)</a>
<div class="alert alert-soft-success px-1 py-1 ng-hide" ng-show="showTownLocations" >Estas viendo las localizaciones de la ciudad/municipio</div>
{% endif %}
#}
</div>
</div>
<div class="mb-2">
<h6 class="mb-0">Ubicaciones</h6>
<div class="">
{{ town.ubications | length}}
{#
{% if (town.ubications | length)> 0 %}
<a href="#" class="fs--1" ng-click="showLocationsInMap()">(Ver en el mapa)</a>
<div class="alert alert-soft-success px-1 py-1 ng-hide" ng-show="showLocations" >Estas viendo las ubicaciones de la ciudad/municipio</div>
{% endif %}
#}
</div>
</div>
<div class="mb-2">
<h6 class="mb-0">Establecimientos</h6>
<div class="">
{{ town.establishments | length}}
{#
{% if (town.establishments | length)> 0 %}
<a href="#" class="fs--1" ng-click="showEstablishmentsInMap()">(Ver en el mapa)</a>
<div class="alert alert-soft-success px-1 py-1 ng-hide" role="alert" ng-show="showEstablishments" >Estas viendo los establecimientos de la ciudad/municipio</div>
{% endif %}
#}
</div>
</div>
<div class="mb-2">
<h6 class="mb-0">Whaterpoints</h6>
<div class="">
{{ town.whaterPoints | length}}
{#
{% if (town.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 de la ciudad/municipio</div>
{% endif %}
#}
</div>
</div>
{% if town.whaterOrganization is not none %}
<div class="mb-2">
<h6 class="mb-0">Organización</h6>
<div class="">
{{ town.whaterOrganization.name | title }}
</div>
</div>
{% endif %}
</div>
</div>
<div class="row g-5 mb-5">
<div class="col-12 col-md-6" >
<h3 class="mb-3" >Redes de distribución ({{ distributionNetworks| length }})</h3>
<ul class="list-group">
{% for distributionNetwork in distributionNetworks %}
{% if distributionNetwork.type == 'DN_TYPE_EXTERNAL' %}
<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"
>{{sinac_domain}}</a>
</div>
{% endif %}
</li>
{% endif %}
{% endfor %}
</ul>
</div>
<div class="col-12 col-md-6">
{% if is_granted('IS_AUTHENTICATED_FULLY') and town.whaterOrganization is none %}
<div class="card">
<div class="card">
<div class="card-body">
{{ function.showFlashes() }}
{% form_theme form 'Form/bootstrap_5_layout.html.twig' %}
{{ form_start(form , {'action': path('web_public_town_show_by_slug', { 'townSlug': town.slug }),
'method': 'POST',
'attr': { 'id': form.vars.name }}) }}
<div class="col-auto mb-1">
{{ form_label(form.message) }}
{{ form_widget(form.message, {'attr': {'placeholder': ('admin.ownership_request.form.fields.text_placeholder_town'|trans({'%town_name%':town.name })) }}) }}
{{ form_errors(form.message) }}
</div>
<div class="col-auto mb-1">
{{ form_widget(form.check, {'attr': {'class': 'form-check-input' }}) }}
<label class="form-label fs--1 text-none" for="app_register_town_ownership_request_check">{{'admin.ownership_request.form.fields.check'|trans({'%town_name%':town.name })}}</label>
</div>
<button class="btn btn-phoenix-secondary me-2 mb-2 mb-sm-0 mt-2"
id='register_ownership_request'
ng-init="registerOwnershipRequest()"
data-user-id="{{app.user.user.id}}"
data-town-id="{{town.id}}"
{% if not enableRequestOwnership %} disabled="disabled" {% endif %}
type="submit">Solicitar
</button>
{{ form_errors(form) }}
{{ form_rest(form) }}
{{ form_end(form) }}
</div>
</div>
{% elseif town.whaterOrganization is none %}
<p class="fs--2">Para solicitar la propiedad de esta ciudad/municipio y manejar su informacion, debes estar registrado en whater.app y pasar por un proceso de validación. Hazlo <a href="{{path('web_signup')}}">aquí</a>.</p>
{% endif %}
</div>
</div>
</div>
</div>
</div>
{% endblock contents %}