{% extends 'Common/base.html.twig' %}
{% import 'Common/parts/functions.html.twig' as function %}
{% block title %}{{ 'admin.whater_point.show.title'|trans }} - {{ whaterPoint.name | title }} | {{ parent() }}{% endblock %}
{% block classBody %}whaterpoint {{ parent() }}{% endblock %}
{% block ogTitle %}{{ 'admin.whater_point.show.title'|trans }} - {{ whaterPoint.name | title }} | {{ parent() }}{% endblock ogTitle %}
{% block javascripts %}
{{ parent() }}
<script type="text/javascript" src="/build/theme/phoenix/assets/vendors/swiper/swiper-bundle.min.js"></script>
{{ encore_entry_script_tags('rater_js') }}
{{ encore_entry_script_tags('leaflet_js') }}
{{ encore_entry_script_tags('select2_js') }}
{{ encore_entry_script_tags('wt_whater_point_show') }}
{% endblock javascripts %}
{% block stylesheets %}
{{ parent() }}
{{ encore_entry_link_tags('select2_styles') }}
{{ encore_entry_link_tags('leaflet_styles') }}
{% endblock stylesheets %}
{% block contents %}
<div class="container-small" ng-controller="showPointCtrl">
<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">{{ whaterPoint.town.country.name | title }}</li>
{% if whaterPoint.town.countryArea %}
<li class="breadcrumb-item"><a href="{{ path('web_public_country_area_show_by_slug', { 'countryAreaSlug': whaterPoint.town.countryArea.slug})}}">{{ whaterPoint.town.countryArea.name | title }}</a></li>
{% endif %}
<li class="breadcrumb-item"><a href="{{path('web_public_town_show_by_slug',{'townSlug':whaterPoint.town.slug })}}">{{ whaterPoint.town.name | title }}</a></li>
<li class="breadcrumb-item active" aria-current="page">
{{ whaterPoint.name }}
{% if is_granted('IS_AUTHENTICATED_REMEMBERED') and app.user.user.hasRole('ROLE_ADMIN') %}
(<a href="{{path('web_admin_whater_point_edit', {'whaterPointId': whaterPoint.id})}}">Editar</a>)
{% endif %}
</li>
</ol>
</nav>
<div class="pb-9">
<h2 class="mb-4">{{ whaterPoint.name | title }}</h2>
<div class="row g-5 mb-5" ng-init="initWhaterPointMap({{whaterPoint.latitude}},{{whaterPoint.longitude}},'{{whaterPoint.whaterStatus}}','{{whaterPoint.name | url_encode }}')">
{% if whaterPoint.images|length == 0 %}
<div class="col-12 col-lg-12" >
<div id="whater_point_map" style="height:400px;width:100%"></div>
</div>
{% else %}
<div class="col-12 col-lg-8">
<div id="whater_point_map" style="height:400px;width:100%"></div>
</div>
<div class="col-12 col-lg-4 d-flex align-self-center">
<div class="carousel slide theme-slider text-center carousel-fade " id="carouselControls" data-bs-ride="carousel">
<div class="carousel-indicators">
{% for image in whaterPoint.images %}
{% if loop.first %}
<button class="active" type="button" data-bs-target="#carouselControls" data-bs-slide-to="{{loop.index0}}" aria-current="true" aria-label="{{ whaterPoint.name }} - {{loop.index}}"></button>
{% else %}
<button type="button" data-bs-target="#carouselControls" data-bs-slide-to="{{loop.index0}}" aria-label="{{ whaterPoint.name }} - {{loop.index}}"></button>
{% endif %}
{% endfor %}
</div>
<div class="carousel-inner rounded">
{% for image in whaterPoint.images %}
{% if loop.first %}
<div class="carousel-item active">
<img class="d-block w-100" src="{{ vich_uploader_asset(image, 'fileWhaterPointImage') | imagine_filter('whaterpoint_gallery')}}" alt="{{ whaterPoint.name }} - {{loop.index}}" />
<div class="carousel-caption d-none d-md-block">
<a href="{{ vich_uploader_asset(image, 'fileWhaterPointImage') }}" target="_blank" class="text-white" >{{ whaterPoint.name }} - {{loop.index}}</a>
</div>
</div>
{% else %}
<div class="carousel-item">
<img class="d-block w-100" src="{{ vich_uploader_asset(image, 'fileWhaterPointImage')| imagine_filter('whaterpoint_gallery') }}" alt="{{ whaterPoint.name }} - {{loop.index}}" />
<div class="carousel-caption d-none d-md-block">
<a href="{{ vich_uploader_asset(image, 'fileWhaterPointImage') }}" target="_blank" class="text-white">{{ whaterPoint.name }} - {{loop.index}}</a>
</div>
</div>
{% endif %}
{% endfor %}
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#carouselControls" data-bs-slide="prev">
<span class="fas fa-angle-left"></span>
<span class="sr-only">Anterior</span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#carouselControls" data-bs-slide="next">
<span class="fas fa-angle-right"></span>
<span class="sr-only">Siguiente</span>
</button>
</div>
</div>
{% endif %}
</div>
<div class="row g-5 mb-5">
<div class="col-xl-6">
<h3 class="mb-3" >Información</h3>
<div class="mb-2">
<h6 class="mb-0">Tipo de punto de agua</h6>
<div class="my-2 ms-2">
{% if whaterPoint.type == 'WP_TYPE_FOUNTAIN' %}
<i class="fa-solid fa-faucet fs-2"></i>
{% elseif whaterPoint.type == 'WP_TYPE_TAP'%}
<i class="bi bi-building fs-2"></i>
{% elseif whaterPoint.type == 'WP_TYPE_DEPOSIT'%}
<i class="fa-solid fa-glass-water-droplet fs-2"></i>
{% elseif whaterPoint.type == 'WP_TYPE_BOTTLED'%}
<i class="fa-solid fa-bottle-water fs-2"></i>
{% elseif whaterPoint.type == 'WP_TYPE_TREATED'%}
<i class="fa-solid fa-flask fs-2"></i>
{% elseif whaterPoint.type == 'WP_TYPE_SPRING'%}
<i class="fa-solid fa-mountain-sun fs-2"></i>
{% endif %}
{{ ('whaterpoint.type.' ~ whaterPoint.type) | trans }}
</div>
</div>
{% set establishment = whaterPoint.establishment %}
{% if whaterPoint.whaterDevice %}
{% set establishment = whaterPoint.whaterDevice.establishment %}
<div class="mb-2">
<h6 class="mb-0">Dispositivo</h6>
<div class="my-2 ms-2">
<i class="fas fa-faucet fs-2"></i>
<a class="ms-2" href="{{ path('web_public_whater_device_show', {'whaterDeviceId': whaterPoint.whaterDevice.id} ) }}">{{ whaterPoint.whaterDevice.name | title }}</a>
</div>
</div>
{% endif %}
{% if establishment is not none %}
<div class="mb-2">
<h6 class="mb-0">Establecimiento</h6>
<div class="my-2 ms-2">
<i class="bi bi-shop-window fs-2"></i>
<a href="{{ path('web_public_establishment_show', {'establishmentId': establishment.id } ) }}">{{ establishment.name | title }}</a>
</div>
</div>
{% endif %}
{% if establishment is not none and establishment.ubication is not none %}
<div class="mb-2">
<h6 class="mb-0">Ubicación</h6>
<div class="my-2 ms-2">
<i class="bi bi-geo-alt fs-2"></i>
<a class="ms-2" href="{{ path('web_public_ubication_show', {'ubicationId': establishment.ubication.id } ) }}">{{ establishment.ubication.name | title }}</a>
</div>
</div>
{% endif %}
<div class="mb-2">
<h6 class="mb-0">Ciudad/Municipio</h6>
<div class="my-2 ms-2">
<i class="bi bi-signpost-2 fs-2"></i>
<a class="ms-2" href="{{ path('web_public_town_show', {'townId': whaterPoint.town.id } ) }}">{{ whaterPoint.town.name | title }}</a>
</div>
</div>
<div class="mb-2">
<h6 class="mb-0">Dirección</h6>
<div class="my-2 ms-2">
<i class="fas fa-directions fs-2"></i>
{% if whaterPoint.town.countryArea %}
{{ whaterPoint.town.name | title }}, {{ whaterPoint.town.countryArea.name | title }}, {{ whaterPoint.town.countryArea.country.name | title }}
{% else %}
{{ whaterPoint.town.name | title }}, {{ whaterPoint.town.country.name | title }}
{% endif %}
</div>
</div>
{% if whaterPoint.distributionNetwork %}
<div class="mb-2 mt-4">
<h3 class="my-3" >Red de distribución</h3>
<div class="">
<i class="fa-solid fa-circle-nodes fs-2"></i>
<a href="{{ path('web_public_distribution_network_show_by_id',{'distributionNetworkId':whaterPoint.distributionNetwork.id})}}"
class="ms-2 fs-0 fw-bold">{{ whaterPoint.distributionNetwork.name | title }}</a>
</div>
<div class="ms-4 me-auto">
Tipo:
<span class="fw-bold">{{ ('distributionNetwork.type.' ~ whaterPoint.distributionNetwork.type) | trans }}</span>
</div>
<div class="ms-4 me-auto">
Estado:
{% if whaterPoint.distributionNetwork.whaterStatus == 'DN_STATUS_SUITABLE' %}
<span class="fw-bold text-success ">Apta</span>
{% elseif whaterPoint.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-4 me-auto">
Fecha última actualización:
<span class="fw-bold">{{whaterPoint.distributionNetwork.lastAnalitycsUpdateAt | date('d-m-Y') }}</span>
</div>
{% if whaterPoint.distributionNetwork.sinacId is not none and whaterPoint.town.externalIds is not none and whaterPoint.town.externalIds.sinac is defined %}
<div class="ms-4 me-auto">
Enlace web SINAC:
<a href="{{ sinac_domain }}/CiudadanoWeb/ciudadano/informacionAbastecimientoActionDetalleRed.do?idRed={{ whaterPoint.distributionNetwork.sinacId }}&codMunicipio={{ whaterPoint.town.externalIds.sinac}}"
target="_black"
>{{sinac_domain}}</a>
</div>
{% endif %}
</div>
<div class="row g-5 mb-2 mt-4">
<div class="col-12 text-center text-md-start" >
<h3 class="mb-3" >Calidad del agua</h3>
<ul class="list-group">
{% if whaterPoint.responsableOrganizationUbication is not none %}
<li class="list-group-item">
<h5 class="ms-2 mb-3">Responsable de ubicación</h5>
<div class="row ms-2">
<div class="col-12 col-lg-5 mb-2">
<h6 class="mb-0">Nombre</h6>
<div class="mt-2">{{ whaterPoint.responsableOrganizationUbication.name | title }}</div>
</div>
<div class="col-12 col-lg-4 mb-2">
<h6 class="mb-0">Ultima información</h6>
<div class="mt-2">
{% if whaterPoint.whaterStatusAt is not none %}
{{ whaterPoint.whaterStatusAt | date('d-m-Y') }}
{% else %}
-
{% endif %}
</div>
</div>
<div class="col-12 col-lg-3 mb-2">
<h6 class="mb-0">Estado</h6>
<div class="mt-1">
{% if whaterPoint.whaterStatus is not none %}
{% if whaterPoint.whaterStatus == 'WP_STATUS_SUITABLE' %}
<img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-circle-green.svg')) }}" />
{% elseif whaterPoint.whaterStatus == 'WP_STATUS_NOT_SUITABLE' %}
<img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-circle-red.svg')) }}" />
{% else %}
<img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-circle-yellow.svg')) }}" />
{% endif %}
{% else %}
<img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-circle-yellow.svg')) }}" />
{% endif %}
</div>
</div>
</div>
</li>
{% endif %}
{% if whaterPoint.distributionNetwork.responsableOrganizationGovernment is not none %}
<li class="list-group-item">
<h5 class="ms-2 mb-3">Responsable de la Red</h5>
<div class="row ms-2">
<div class="col-12 col-lg-5 mb-2">
<h6 class="mb-0">Nombre</h6>
<div class="mt-2">{{ whaterPoint.distributionNetwork.responsableOrganizationGovernment.name | title }}</div>
</div>
<div class="col-12 col-lg-4 mb-2">
<h6 class="mb-0">Ultima información</h6>
<div class="mt-2">
{% if whaterPoint.distributionNetwork.whaterStatusByGovernmentUpdatedAt is not none %}
{{ whaterPoint.distributionNetwork.whaterStatusByGovernmentUpdatedAt | date('d-m-Y') }}
{% else %}
-
{% endif %}
</div>
</div>
<div class="col-12 col-lg-3 mb-2">
<h6 class="mb-0">Estado</h6>
<div class="mt-1">
{% if whaterPoint.distributionNetwork.whaterStatusByGovernment is not none %}
{% if whaterPoint.distributionNetwork.whaterStatusByGovernment == 'DN_STATUS_SUITABLE' %}
<img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-circle-green.svg')) }}" />
{% elseif whaterPoint.distributionNetwork.whaterStatusByGovernment == 'DN_STATUS_NOT_SUITABLE' %}
<img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-circle-red.svg')) }}" />
{% else %}
<img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-circle-yellow.svg')) }}" />
{% endif %}
{% else %}
<img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-circle-yellow.svg')) }}" />
{% endif %}
</div>
</div>
</div>
</li>
{% endif %}
{% if whaterPoint.distributionNetwork.responsableOrganizationOperator is not none %}
<li class="list-group-item">
<h5 class="ms-2 mb-3">Operador responsable de la Red</h5>
<div class="row ms-2">
<div class="col-12 col-lg-5 mb-2">
<h6 class="mb-0">Nombre</h6>
<div class="mt-2">{{ whaterPoint.distributionNetwork.responsableOrganizationOperator.name | title }}</div>
</div>
<div class="col-12 col-lg-4 mb-2">
<h6 class="mb-0">Ultima información</h6>
<div class="mt-2">
{% if whaterPoint.distributionNetwork.whaterStatusByOperatorUpdatedAt is not none %}
{{ whaterPoint.distributionNetwork.whaterStatusByOperatorUpdatedAt | date('d-m-Y') }}
{% else %}
-
{% endif %}
</div>
</div>
<div class="col-12 col-lg-3 mb-2">
<h6 class="mb-0">Estado</h6>
<div class="">
{% if whaterPoint.distributionNetwork.whaterStatusByOperator is not none %}
{% if whaterPoint.distributionNetwork.whaterStatusByOperator == 'DN_STATUS_SUITABLE' %}
<img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-circle-green.svg')) }}" />
{% elseif whaterPoint.distributionNetwork.whaterStatusByOperator == 'DN_STATUS_NOT_SUITABLE' %}
<img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-circle-red.svg')) }}" />
{% else %}
<img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-circle-yellow.svg')) }}" />
{% endif %}
{% else %}
<img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-circle-yellow.svg')) }}" />
{% endif %}
</div>
</div>
</div>
</li>
{% endif %}
{% if whaterPoint.distributionNetwork.responsableOrganizationUbication is not none %}
<li class="list-group-item">
<h5 class="ms-2 mb-3">Responsable de ubicación de la Red</h5>
<div class="row ms-2">
<div class="col-12 col-lg-5 mb-2">
<h6 class="mb-0">Nombre</h6>
<div class="mt-2">{{ whaterPoint.distributionNetwork.responsableOrganizationUbication.name | title }}</div>
</div>
<div class="col-12 col-lg-4 mb-2">
<h6 class="mb-0">Ultima información</h6>
<div class="mt-2">
{% if whaterPoint.distributionNetwork.whaterStatusByUbicationUpdatedAt is not none %}
{{ whaterPoint.distributionNetwork.whaterStatusByUbicationUpdatedAt | date('d-m-Y') }}
{% else %}
-
{% endif %}
</div>
</div>
<div class="col-12 col-lg-3 mb-2">
<h6 class="mb-0">Estado</h6>
<div class="mt-1">
{% if whaterPoint.distributionNetwork.whaterStatusByUbication is not none %}
{% if whaterPoint.distributionNetwork.whaterStatusByUbication == 'DN_STATUS_SUITABLE' %}
<img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-circle-green.svg')) }}" />
{% elseif whaterPoint.distributionNetwork.whaterStatusByUbication == 'DN_STATUS_NOT_SUITABLE' %}
<img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-circle-red.svg')) }}" />
{% else %}
<img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-circle-yellow.svg')) }}" />
{% endif %}
{% else %}
<img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-circle-yellow.svg')) }}" />
{% endif %}
</div>
</div>
</div>
</li>
{% endif %}
</ul>
</div>
</div>
{% endif %}
</div>
<div class="col-xl-6">
<h3 class="mb-2" >Código QR del WhaterPoint</h3>
<div class="mb-3">
<img src="{{ qr_code_data_uri(url('web_public_whater_point_show_by_slug', {'whaterPointSlug': whaterPoint.slug }), 'qr_ticket') }}"/>
</div>
{% if is_ecommerce_active %}
{% if whaterPoint.product is not none and whaterPoint.product.isEnable %}
<p class="text-muted">
¿Estás en este punto de hidratación? Satisfaz tu sed con solo un clic. ¡Recarga tu botella de agua y revive la experiencia de hidratación en este waterpoint!
<a href="#" class="fs--1">(más informacion)</a>
</p>
<div class="text-center">
<p class="text-primary fw-bold">Recarga tu botella de agua en este whaterpoint por: </p>
<div class="d-flex">
<button type="button" ng-click="buyProduct('{{ whaterPoint.product.id }}', 'whatercoins')"
class="btn btn-lg btn-primary w-100 mb-4 mx-2">
{{ whaterPoint.product.productPrice | number_format(2, ',', '.') }} whatercoins!
</button>
</div>
</div>
{% endif %}
{% endif %}
{% if is_granted('IS_AUTHENTICATED_FULLY') and app.user %}
<h3 class="mb-2">¡Danos tu opinión!</h3>
{% set myvaloration = app.user.user.valorationForWhaterpoint(whaterPoint.id) %}
<div class="row align-items-center pb-3" ng-init="initValorations('{{whaterPoint.id}}')" >
<div class="col-2">General:</div>
<div class="col-10">
<div class="radio-container d-flex" id="select-general-quality" {% if myvaloration is not none %}data-valoration="{{myvaloration.generalValoration}}"{% endif %}>
<div class="mx-3">
<input type="radio" id="radio-val1" name="general" value="WP_QUALITY_ACCEPTABLE_VALORATION">
<label for="radio-val1"><img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-face-smile.svg')) }}" data-bs-toggle="tooltip" data-bs-placement="top" title="Aceptable" /></label>
</div>
<div class="mx-3">
<input type="radio" id="radio-val2" name="general" value="WP_QUALITY_NEEDS_IMPROVEMENT_VALORATION">
<label for="radio-val2"><img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-face-normal.svg')) }}" data-bs-toggle="tooltip" data-bs-placement="top" title="Mejorable"/></label>
</div>
<div class="mx-3">
<input type="radio" id="radio-val3" name="general" value="WP_QUALITY_NOT_ACCEPTABLE_VALORATION">
<label for="radio-val3"><img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-face-sad.svg')) }}" data-bs-toggle="tooltip" data-bs-placement="top" title="No aceptable"/></label>
</div>
</div>
</div>
</div>
<h6 class="mt-2 mb-2">Danos una valoración más específica evaluando los siguientes parámetros </h6>
<div class="row pb-3">
<div class="row align-items-center" >
<div class="col-2 text-end">Sabor:</div>
<div class="col-10">
<div class="radio-container d-flex" id="select-taste-quality" {% if myvaloration is not none %}data-valoration="{{myvaloration.tasteValoration}}"{% endif %}>
<label class="me-3"><input type="radio" name="taste" value="WP_QUALITY_ACCEPTABLE_VALORATION"> {{ ('whater_valoration.quality.WP_QUALITY_ACCEPTABLE_VALORATION') | trans}}</label>
<label class="me-3"><input type="radio" name="taste" value="WP_QUALITY_NEEDS_IMPROVEMENT_VALORATION"> {{ ('whater_valoration.quality.WP_QUALITY_NEEDS_IMPROVEMENT_VALORATION') | trans}}</label>
<label><input type="radio" name="taste" value="WP_QUALITY_NOT_ACCEPTABLE_VALORATION"> {{ ('whater_valoration.quality.WP_QUALITY_NOT_ACCEPTABLE_VALORATION') | trans}}</label>
</div>
</div>
</div>
<div class="row align-items-center">
<div class="col-2 text-end">Olor:</div>
<div class="col-10">
<div class="radio-container d-flex" id="select-smell-quality" {% if myvaloration is not none %}data-valoration="{{myvaloration.smellValoration}}"{% endif %}>
<label class="me-3"><input type="radio" name="smell" value="WP_QUALITY_ACCEPTABLE_VALORATION"> {{ ('whater_valoration.quality.WP_QUALITY_ACCEPTABLE_VALORATION') | trans}}</label>
<label class="me-3"><input type="radio" name="smell" value="WP_QUALITY_NEEDS_IMPROVEMENT_VALORATION"> {{ ('whater_valoration.quality.WP_QUALITY_NEEDS_IMPROVEMENT_VALORATION') | trans}}</label>
<label><input type="radio" name="smell" value="WP_QUALITY_NOT_ACCEPTABLE_VALORATION"> {{ ('whater_valoration.quality.WP_QUALITY_NOT_ACCEPTABLE_VALORATION') | trans}}</label>
</div>
</div>
</div>
<div class="row align-items-center">
<div class="col-2 text-end">Color:</div>
<div class="col-10">
<div class="radio-container d-flex" id="select-color-quality" {% if myvaloration is not none %}data-valoration="{{myvaloration.colorValoration}}"{% endif %}>
<label class="me-3"><input type="radio" name="color" value="WP_QUALITY_ACCEPTABLE_VALORATION"> {{ ('whater_valoration.quality.WP_QUALITY_ACCEPTABLE_VALORATION') | trans}}</label>
<label class="me-3"><input type="radio" name="color" value="WP_QUALITY_NEEDS_IMPROVEMENT_VALORATION"> {{ ('whater_valoration.quality.WP_QUALITY_NEEDS_IMPROVEMENT_VALORATION') | trans}}</label>
<label><input type="radio" name="color" value="WP_QUALITY_NOT_ACCEPTABLE_VALORATION"> {{ ('whater_valoration.quality.WP_QUALITY_NOT_ACCEPTABLE_VALORATION') | trans}}</label>
</div>
</div>
</div>
<div class="row align-items-center">
<div class="col-2 text-end">Turbidez:</div>
<div class="col">
<div class="radio-container d-flex" id="select-turbidity-quality" {% if myvaloration is not none %}data-valoration="{{myvaloration.turbidityValoration}}"{% endif %}>
<label class="me-3"><input type="radio" name="turbidity" value="WP_QUALITY_ACCEPTABLE_VALORATION"> {{ ('whater_valoration.quality.WP_QUALITY_ACCEPTABLE_VALORATION') | trans}}</label>
<label class="me-3"><input type="radio" name="turbidity" value="WP_QUALITY_NEEDS_IMPROVEMENT_VALORATION"> {{ ('whater_valoration.quality.WP_QUALITY_NEEDS_IMPROVEMENT_VALORATION') | trans}}</label>
<label><input type="radio" name="turbidity" value="WP_QUALITY_NOT_ACCEPTABLE_VALORATION"> {{ ('whater_valoration.quality.WP_QUALITY_NOT_ACCEPTABLE_VALORATION') | trans}}</label>
</div>
</div>
</div>
</div>
{% endif %}
{% if is_granted('IS_AUTHENTICATED_FULLY') and app.user and app.user.user.whaterOrganization and whaterPoint.responsableOrganizationUbication and app.user.user.whaterOrganization == whaterPoint.responsableOrganizationUbication %}
<h5 class="mt-3 mb-2"
ng-init="initRating('{{whaterPoint.id}}','{{whaterPoint.totalColor | json_encode }}','{{whaterPoint.totalSmell | json_encode}}','{{whaterPoint.totalTaste | json_encode}}','{{whaterPoint.totalTurbidity | json_encode}}','{{whaterPoint.totalGeneral | json_encode}}')">
Resultado de valoraciones de usuarios
</h5>
<div class="row">
<div class="col-md-2 text-center mb-2" >
<div class="fs-0"></div>
</div>
<div class="col-md-3 text-center mb-2" >
<div>Aceptable: </div>
</div>
<div class="col-md-4 text-center mb-2" >
<div>Mejorable: </div>
</div>
<div class="col-md-3 text-center mb-2" >
<div>No aceptable: </div>
</div>
</div>
<div class="row">
<div class="col-md-2 text-end mb-2" >
<div class="fs-0">General:</div>
</div>
<div class="col-md-3 text-center mb-2" >
<div id="totalAcceptableGeneral" ></div>
</div>
<div class="col-md-4 text-center mb-2" >
<div id="totalNeedsImprovementGeneral" ></div>
</div>
<div class="col-md-3 text-center mb-2" >
<div id="totalNotAcceptableGeneral" ></div>
</div>
</div>
<div class="row">
<div class="col-md-2 text-end mb-2" >
<div class="fs-0">Sabor:</div>
</div>
<div class="col-md-3 text-center mb-2" >
<div id="totalAcceptableTaste" ></div>
</div>
<div class="col-md-4 text-center mb-2" >
<div id="totalNeedsImprovementTaste" ></div>
</div>
<div class="col-md-3 text-center mb-2" >
<div id="totalNotAcceptableTaste" ></div>
</div>
</div>
<div class="row">
<div class="col-md-2 text-end mb-2" >
<div class="fs-0">Olor:</div>
</div>
<div class="col-md-3 text-center mb-2" >
<div id="totalAcceptableSmell" ></div>
</div>
<div class="col-md-4 text-center mb-2" >
<div id="totalNeedsImprovementSmell" ></div>
</div>
<div class="col-md-3 text-center mb-2" >
<div id="totalNotAcceptableSmell" ></div>
</div>
</div>
<div class="row">
<div class="col-md-2 text-end mb-2" >
<div class="fs-0">Color:</div>
</div>
<div class="col-md-3 text-center mb-2" >
<div id="totalAcceptableColor" ></div>
</div>
<div class="col-md-4 text-center mb-2" >
<div id="totalNeedsImprovementColor" ></div>
</div>
<div class="col-md-3 text-center mb-2" >
<div id="totalNotAcceptableColor" ></div>
</div>
</div>
<div class="row">
<div class="col-md-2 text-end mb-2" >
<div class="fs-0">Turbidez: </div>
</div>
<div class="col-md-3 text-center mb-2" >
<div id="totalAcceptableTurbidity" ></div>
</div>
<div class="col-md-4 text-center mb-2" >
<div id="totalNeedsImprovementTurbidity" ></div>
</div>
<div class="col-md-3 text-center mb-2" >
<div id="totalNotAcceptableTurbidity" ></div>
</div>
</div>
{% endif %}
<div class="d-flex align-items-center">
<div class="">
{% if whaterPoint.averageUserGeneral is not none %}
{% if whaterPoint.averageUserGeneral <= 3 %}
<img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-face-sad.svg')) }}" data-bs-toggle="tooltip" data-bs-placement="top" title="No aceptable"/>
{% elseif whaterPoint.averageUserGeneral > 3 and whaterPoint.averageUserGeneral < 8 %}
<img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-face-normal.svg')) }}" data-bs-toggle="tooltip" data-bs-placement="top" title="Mejorable"/>
{% elseif whaterPoint.averageUserGeneral >= 8 %}
<img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-face-smile.svg')) }}" data-bs-toggle="tooltip" data-bs-placement="top" title="Aceptable"/>
{% endif %}
{% elseif whaterPoint.averageProfessionalGeneral is not none %}
{% if whaterPoint.averageProfessionalGeneral <= 3 %}
<img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-face-sad.svg')) }}" data-bs-toggle="tooltip" data-bs-placement="top" title="No aceptable"/>
{% elseif whaterPoint.averageUserGeneral > 3 and whaterPoint.averageProfessionalGeneral < 8 %}
<img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-face-normal.svg')) }}" data-bs-toggle="tooltip" data-bs-placement="top" title="Mejorable"/>
{% elseif whaterPoint.averageProfessionalGeneral >= 8 %}
<img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-face-smile.svg')) }}" data-bs-toggle="tooltip" data-bs-placement="top" title="Aceptable"/>
{% endif %}
{% endif %}
</div>
<div class="d-flex align-items-center">
{% if whaterPoint.averageUserGeneral is none and whaterPoint.averageProfessionalGeneral is none %}
<div class="ms-3 text-1000">
<div class="text-muted">Este whaterpoint aún no ha recibido valoraciones.</div>
</div>
{% else %}
<div class="ms-3 text-1000">
{% if whaterPoint.averageUserGeneral is not none %}
<div>La valoracion media de usuarios es de <span class="fw-bold">{{whaterPoint.averageUserGeneral | number_format(2, ',', '.') }}</span> sobre 10</div>
{% endif %}
{% if whaterPoint.averageProfessionalGeneral is not none %}
<div>La valoracion media de profesionales es de <span class="fw-bold">{{whaterPoint.averageProfessionalGeneral | number_format(2, ',', '.')}}</span> sobre 10</div>
{% endif %}
</div>
{% endif %}
</div>
</div>
<h3 class="mt-5 mb-2" >
Comentarios de los usuarios
</h3>
{% set allow_comment_button = true %}
{% if is_granted('IS_AUTHENTICATED_FULLY') %}
{% for valoration in whaterPoint.valorations %}
{% if valoration.createdBy.equals(app.user.user) and valoration.userCommentText is not none %}
{% set allow_comment_button = false %}
{% endif %}
{% endfor %}
<div class="d-flex flex-row-reverse mb-2">
<button class="btn btn-secondary btn-sm" type="button"
{% if allow_comment_button %}
ng-click="createCommentModal()"
{% else %}
disabled="disabled"
{% endif %}
>Añadir comentario</button>
</div>
{% endif %}
<div class="row pb-3">
<div class="col-12 col-xl-auto flex-1">
{% set num_comments = 0 %}
{% for valoration in whaterPoint.valorations %}
{% if valoration.hideUserComment == false and valoration.userCommentText is not none %}
{% set num_comments = num_comments + 1 %}
<div class="border-2 border-dashed mb-3 pt-2 border-top">
<div class="d-flex">
<div class="fs--1 text-600">
<span class="fa-solid fa-clock me-2"></span>
<span class="fw-semi-bold me-1">{{ valoration.createdAt | date('d-m-Y H:i') }}</span>
</div>
<p class="fs--1 mb-0 text-600">
por
<span class=" fw-semi-bold">{{ valoration.createdBy.fullName }}</span>
</p>
</div>
<p class="mt-2 ms-3 text-1000">{{valoration.userCommentText | nl2br }}</p>
{% if valoration.commentImage is not none %}
<div class="w-100 w-md-50 ms-md-3">
<a href="{{ vich_uploader_asset(valoration.commentImage, 'fileWhaterValorationImage') }}" data-gallery="gallery-posts-0">
<img class="rounded h-100 w-100" src="{{ vich_uploader_asset(valoration.commentImage, 'fileWhaterValorationImage') | imagine_filter('whater_valoration_image_thumb_300_200') }}" alt="..." />
</a>
</div>
{% endif %}
{% set allow_delete = false %}
{% set allow_reply = false %}
{% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
{% if app.user.user.checkPermission('PERMISSION_EDIT_WHATER_POINT',whaterPoint) %}
{% set allow_delete = true %}
{% set allow_reply = true %}
{% endif %}
{% if app.user.user.hasRole('ROLE_ADMIN') %}
{% set allow_delete = true %}
{% endif %}
{% endif %}
<div class="mt-2 ms-md-3">
{% if allow_delete %}
<button class="btn btn-link p-0 text-900 fw-bolder mb-2" type="button" ng-click="deleteCommentModal('{{valoration.id}}')" data-valoration-id="{{valoration.id}}">
<span class="fa-solid fa-trash-alt fs--2 me-1 text-danger"></span>
<span class="fw-bold fs--2 text-danger">Eliminar mensaje</span>
</button>
{% endif %}
{% if allow_reply %}
<button class="btn btn-link p-0 text-900 fw-bolder mb-2" type="button" ng-click="replyCommentModal('{{valoration.id}}')" data-valoration-id="{{valoration.id}}">
<span class="fa-solid fa-reply fs--2 me-1">
</span>
<span class="fw-bold fs--2">
{% if valoration.responseCommentText is none%}
Responder mensaje
{% else %}
Editar respuesta
{% endif %}
</span>
</button>
{% endif %}
</div>
{% if valoration.responseCommentText %}
<div class="d-flex ms-md-3">
<div class="fs--1 text-600">
<span class="fa-solid fa-clock me-2"></span>
<span class="fw-semi-bold me-1">{{ valoration.responseCommentAt | date('d-m-Y H:i') }}</span>
</div>
<p class="fs--1 mb-0 text-600">
por
{% if whaterPoint.responsableOrganizationUbication is not none %}
<span class=" fw-semi-bold">{{whaterPoint.responsableOrganizationUbication.name}}</span>
{% else %}
<span class=" fw-semi-bold">whater.app</span>
{% endif %}
</p>
</div>
<p class="mt-2 ms-3 text-1000">{{valoration.responseCommentText | nl2br }}</p>
{% endif %}
</div>
{% endif %}
{% endfor %}
{% if num_comments == 0 %}
<p class="mt-2 ms-3 text-1000">
<span class="text-muted">Este whaterpoint aún no ha recibido comentarios.</span>
</p>
{% endif %}
{% if not is_granted('IS_AUTHENTICATED_FULLY') %}
<a href="{{path('web_login', {'_target_path': path('web_public_whater_point_show',{'whaterPointId': whaterPoint.id})})}}">Entra y comenta!</a>
{%endif %}
</div>
</div>
</div>
</div>
{% if (recommendedProducts | length ) > 0 %}
<div class="row g-5 mb-5">
<div class="col-12">
<h3 class="mb-3">Productos recomendados</h3>
<div class="row">
{% for product in recommendedProducts %}
<div class="col-6 col-lg-2 col-md-3">
<div class="product-card h-100">
<div class="d-flex flex-column justify-content-between h-100">
<div class="">
<a class="border border-1 rounded-3 position-relative mb-2"
{% if single_page is defined and single_page == true %}
target="_blank"
{% endif %}
href="{{ path('web_public_show_product', {'productSlug':product.productSlug})}}" >
<img class="img-fluid product-image"
{% if (product.images| length) > 0 %}
src="{{ vich_uploader_asset( product.images.0, 'fileProductImage') | imagine_filter('product_list_image') }}"
{% else %}
src="{{asset('/assets/images/gota-foto-3@2x.png')}}"
{% endif %}
/>
</a>
<a class="text-decoration-none"
{% if single_page is defined and single_page == true %}
target="_blank"
{% endif %}
href="{{ path('web_public_show_product', {'productSlug':product.productSlug})}}" >
<span class="product-name fw-bold text-dark">{{product.productLabel}}</span>
</a>
</div>
<div class="d-flex align-items-center justify-content-end mb-1">
<p class="mb-0 text-700 product-price-label">Desde {{product.productPrice}}€</p>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
{% endif %}
{% if (whaterArticles | length ) > 0 %}
<div class="row g-5 mb-5">
<div class="col-12">
<div class="row g-0 py-3 align-items-end justify-content-between">
<h3 class="flex-1 mb-0 text-nowrap me-3">Artículos recomendados</h3>
</div>
</div>
{% for article in whaterArticles %}
<div class="col-6 col-md-4 my-2 py-1">
<div class="card" >
{% if article.headerImageUrl %}
<a href="{{ url('web_blog_show_article', { 'articleSlug' : article.slug('es'), '_locale': 'es' })}}">
<img class="card-img-top" src="{{ article.headerImageUrl | imagine_filter('whater_blog_header_list_image_1200_200') }}" title="{{ article.title('es') }}">
</a>
{% endif %}
<div class="card-body">
<a class="text-dark" href="{{ url('web_blog_show_article', { 'articleSlug' : article.slug('es'), '_locale': 'es' })}}">
<h3 class="card-title">{{ article.title('es') }}</h3>
</a>
<p class="card-text">{{ article.content('es') | striptags | u.truncate(350) |raw }}...</p>
<div class="fs--1 text-muted">{{ article.publishAt | date('d-m-Y') }} - {{ article.publishAt | ago }}</div>
<div class="my-1">
{% for metaKeyword in article.metaKeywords('es') %}
<a class="text-muted fs--1">#{{ metaKeyword | replace({' ': '-'})}}</a>
{% endfor %}
</div>
</div>
</div>
</div>
{% endfor %}
</div>
{% endif %}
</div>
<div class="modal fade" id="createCommentModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="createCommentModalLabel">Añadir comentario</h5>
<button class="btn p-1" type="button" data-bs-dismiss="modal" aria-label="Close">
<span class="fas fa-times fs--1"></span>
</button>
</div>
<div class="modal-body">
<textarea class="form-control mb-3" ng-model="valorationCommentText" rows="4"></textarea>
<div class="mt-2">¿Quieres subir una foto? (min 300x300)</div>
<input id="fileImageInput" type="file" ng-model="valorationCommentImage" accept="image/*" class="form-control">
</div>
<div class="modal-footer">
<button class="btn btn-primary" type="button" ng-click="acceptCommentModalButton()">Aceptar</button>
<button class="btn btn-outline-primary" type="button" data-bs-dismiss="modal">Cancelar</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="deleteCommentModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="deleteCommentModalLabel">Eliminar comentario</h5>
<button class="btn p-1" type="button" data-bs-dismiss="modal" aria-label="Close">
<span class="fas fa-times fs--1"></span>
</button>
</div>
<div class="modal-body">
<p>Estás a punto de eliminar este comentario. ¿Deseas continuar?</p>
<p>El usuario no podrá volver a realizar un comentario sobre este whaterpoint.</p>
</div>
<div class="modal-footer">
<button class="btn btn-danger" type="button" ng-click="acceptDeleteCommentModalButton()">Aceptar</button>
<button class="btn btn-secondary" type="button" data-bs-dismiss="modal">Cancelar</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="replyCommentModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="replyCommentModalLabel">Añadir comentario</h5>
<button class="btn p-1" type="button" data-bs-dismiss="modal" aria-label="Close">
<span class="fas fa-times fs--1"></span>
</button>
</div>
<div class="modal-body">
<textarea class="form-control mb-3" ng-model="valorationReplyCommentText" rows="4"></textarea>
</div>
<div class="modal-footer">
<button class="btn btn-primary" type="button" ng-click="acceptReplyCommentModalButton()">Aceptar</button>
<button class="btn btn-outline-primary" type="button" data-bs-dismiss="modal">Cancelar</button>
</div>
</div>
</div>
</div>
</div>
{% endblock contents %}