src/UI/WebBundle/Resources/views/Whater/public_whater_point_show.html.twig line 1

Open in your IDE?
  1. {% extends 'Common/base.html.twig' %}
  2. {% import 'Common/parts/functions.html.twig' as function %}
  3. {% block title %}{{ 'admin.whater_point.show.title'|trans }} - {{ whaterPoint.name | title }} | {{ parent() }}{% endblock %}
  4. {% block classBody %}whaterpoint {{ parent() }}{% endblock %}
  5. {% block ogTitle %}{{ 'admin.whater_point.show.title'|trans }} - {{ whaterPoint.name | title }} | {{ parent() }}{% endblock ogTitle %}
  6. {% block javascripts %}
  7. {{ parent() }}
  8. <script type="text/javascript" src="/build/theme/phoenix/assets/vendors/swiper/swiper-bundle.min.js"></script>
  9. {{ encore_entry_script_tags('rater_js') }}
  10. {{ encore_entry_script_tags('leaflet_js') }}
  11. {{ encore_entry_script_tags('select2_js') }}
  12. {{ encore_entry_script_tags('wt_whater_point_show') }}
  13. {% endblock javascripts %}
  14. {% block stylesheets %}
  15. {{ parent() }}
  16. {{ encore_entry_link_tags('select2_styles') }}
  17. {{ encore_entry_link_tags('leaflet_styles') }}
  18. {% endblock stylesheets %}
  19. {% block contents %}
  20. <div class="container-small" ng-controller="showPointCtrl">
  21. <nav class="mb-2" aria-label="breadcrumb">
  22. <ol class="breadcrumb mb-0">
  23. <li class="breadcrumb-item"><a href="{{path('web_init')}}">Inicio</a></li>
  24. <li class="breadcrumb-item">{{ whaterPoint.town.country.name | title }}</li>
  25. {% if whaterPoint.town.countryArea %}
  26. <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>
  27. {% endif %}
  28. <li class="breadcrumb-item"><a href="{{path('web_public_town_show_by_slug',{'townSlug':whaterPoint.town.slug })}}">{{ whaterPoint.town.name | title }}</a></li>
  29. <li class="breadcrumb-item active" aria-current="page">
  30. {{ whaterPoint.name }}
  31. {% if is_granted('IS_AUTHENTICATED_REMEMBERED') and app.user.user.hasRole('ROLE_ADMIN') %}
  32. (<a href="{{path('web_admin_whater_point_edit', {'whaterPointId': whaterPoint.id})}}">Editar</a>)
  33. {% endif %}
  34. </li>
  35. </ol>
  36. </nav>
  37. <div class="pb-9">
  38. <h2 class="mb-4">{{ whaterPoint.name | title }}</h2>
  39. <div class="row g-5 mb-5" ng-init="initWhaterPointMap({{whaterPoint.latitude}},{{whaterPoint.longitude}},'{{whaterPoint.whaterStatus}}','{{whaterPoint.name | url_encode }}')">
  40. {% if whaterPoint.images|length == 0 %}
  41. <div class="col-12 col-lg-12" >
  42. <div id="whater_point_map" style="height:400px;width:100%"></div>
  43. </div>
  44. {% else %}
  45. <div class="col-12 col-lg-8">
  46. <div id="whater_point_map" style="height:400px;width:100%"></div>
  47. </div>
  48. <div class="col-12 col-lg-4 d-flex align-self-center">
  49. <div class="carousel slide theme-slider text-center carousel-fade " id="carouselControls" data-bs-ride="carousel">
  50. <div class="carousel-indicators">
  51. {% for image in whaterPoint.images %}
  52. {% if loop.first %}
  53. <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>
  54. {% else %}
  55. <button type="button" data-bs-target="#carouselControls" data-bs-slide-to="{{loop.index0}}" aria-label="{{ whaterPoint.name }} - {{loop.index}}"></button>
  56. {% endif %}
  57. {% endfor %}
  58. </div>
  59. <div class="carousel-inner rounded">
  60. {% for image in whaterPoint.images %}
  61. {% if loop.first %}
  62. <div class="carousel-item active">
  63. <img class="d-block w-100" src="{{ vich_uploader_asset(image, 'fileWhaterPointImage') | imagine_filter('whaterpoint_gallery')}}" alt="{{ whaterPoint.name }} - {{loop.index}}" />
  64. <div class="carousel-caption d-none d-md-block">
  65. <a href="{{ vich_uploader_asset(image, 'fileWhaterPointImage') }}" target="_blank" class="text-white" >{{ whaterPoint.name }} - {{loop.index}}</a>
  66. </div>
  67. </div>
  68. {% else %}
  69. <div class="carousel-item">
  70. <img class="d-block w-100" src="{{ vich_uploader_asset(image, 'fileWhaterPointImage')| imagine_filter('whaterpoint_gallery') }}" alt="{{ whaterPoint.name }} - {{loop.index}}" />
  71. <div class="carousel-caption d-none d-md-block">
  72. <a href="{{ vich_uploader_asset(image, 'fileWhaterPointImage') }}" target="_blank" class="text-white">{{ whaterPoint.name }} - {{loop.index}}</a>
  73. </div>
  74. </div>
  75. {% endif %}
  76. {% endfor %}
  77. </div>
  78. <button class="carousel-control-prev" type="button" data-bs-target="#carouselControls" data-bs-slide="prev">
  79. <span class="fas fa-angle-left"></span>
  80. <span class="sr-only">Anterior</span>
  81. </button>
  82. <button class="carousel-control-next" type="button" data-bs-target="#carouselControls" data-bs-slide="next">
  83. <span class="fas fa-angle-right"></span>
  84. <span class="sr-only">Siguiente</span>
  85. </button>
  86. </div>
  87. </div>
  88. {% endif %}
  89. </div>
  90. <div class="row g-5 mb-5">
  91. <div class="col-xl-6">
  92. <h3 class="mb-3" >Información</h3>
  93. <div class="mb-2">
  94. <h6 class="mb-0">Tipo de punto de agua</h6>
  95. <div class="my-2 ms-2">
  96. {% if whaterPoint.type == 'WP_TYPE_FOUNTAIN' %}
  97. <i class="fa-solid fa-faucet fs-2"></i>
  98. {% elseif whaterPoint.type == 'WP_TYPE_TAP'%}
  99. <i class="bi bi-building fs-2"></i>
  100. {% elseif whaterPoint.type == 'WP_TYPE_DEPOSIT'%}
  101. <i class="fa-solid fa-glass-water-droplet fs-2"></i>
  102. {% elseif whaterPoint.type == 'WP_TYPE_BOTTLED'%}
  103. <i class="fa-solid fa-bottle-water fs-2"></i>
  104. {% elseif whaterPoint.type == 'WP_TYPE_TREATED'%}
  105. <i class="fa-solid fa-flask fs-2"></i>
  106. {% elseif whaterPoint.type == 'WP_TYPE_SPRING'%}
  107. <i class="fa-solid fa-mountain-sun fs-2"></i>
  108. {% endif %}
  109. {{ ('whaterpoint.type.' ~ whaterPoint.type) | trans }}
  110. </div>
  111. </div>
  112. {% set establishment = whaterPoint.establishment %}
  113. {% if whaterPoint.whaterDevice %}
  114. {% set establishment = whaterPoint.whaterDevice.establishment %}
  115. <div class="mb-2">
  116. <h6 class="mb-0">Dispositivo</h6>
  117. <div class="my-2 ms-2">
  118. <i class="fas fa-faucet fs-2"></i>
  119. <a class="ms-2" href="{{ path('web_public_whater_device_show', {'whaterDeviceId': whaterPoint.whaterDevice.id} ) }}">{{ whaterPoint.whaterDevice.name | title }}</a>
  120. </div>
  121. </div>
  122. {% endif %}
  123. {% if establishment is not none %}
  124. <div class="mb-2">
  125. <h6 class="mb-0">Establecimiento</h6>
  126. <div class="my-2 ms-2">
  127. <i class="bi bi-shop-window fs-2"></i>
  128. <a href="{{ path('web_public_establishment_show', {'establishmentId': establishment.id } ) }}">{{ establishment.name | title }}</a>
  129. </div>
  130. </div>
  131. {% endif %}
  132. {% if establishment is not none and establishment.ubication is not none %}
  133. <div class="mb-2">
  134. <h6 class="mb-0">Ubicación</h6>
  135. <div class="my-2 ms-2">
  136. <i class="bi bi-geo-alt fs-2"></i>
  137. <a class="ms-2" href="{{ path('web_public_ubication_show', {'ubicationId': establishment.ubication.id } ) }}">{{ establishment.ubication.name | title }}</a>
  138. </div>
  139. </div>
  140. {% endif %}
  141. <div class="mb-2">
  142. <h6 class="mb-0">Ciudad/Municipio</h6>
  143. <div class="my-2 ms-2">
  144. <i class="bi bi-signpost-2 fs-2"></i>
  145. <a class="ms-2" href="{{ path('web_public_town_show', {'townId': whaterPoint.town.id } ) }}">{{ whaterPoint.town.name | title }}</a>
  146. </div>
  147. </div>
  148. <div class="mb-2">
  149. <h6 class="mb-0">Dirección</h6>
  150. <div class="my-2 ms-2">
  151. <i class="fas fa-directions fs-2"></i>
  152. {% if whaterPoint.town.countryArea %}
  153. {{ whaterPoint.town.name | title }}, {{ whaterPoint.town.countryArea.name | title }}, {{ whaterPoint.town.countryArea.country.name | title }}
  154. {% else %}
  155. {{ whaterPoint.town.name | title }}, {{ whaterPoint.town.country.name | title }}
  156. {% endif %}
  157. </div>
  158. </div>
  159. {% if whaterPoint.distributionNetwork %}
  160. <div class="mb-2 mt-4">
  161. <h3 class="my-3" >Red de distribución</h3>
  162. <div class="">
  163. <i class="fa-solid fa-circle-nodes fs-2"></i>
  164. <a href="{{ path('web_public_distribution_network_show_by_id',{'distributionNetworkId':whaterPoint.distributionNetwork.id})}}"
  165. class="ms-2 fs-0 fw-bold">{{ whaterPoint.distributionNetwork.name | title }}</a>
  166. </div>
  167. <div class="ms-4 me-auto">
  168. Tipo:
  169. <span class="fw-bold">{{ ('distributionNetwork.type.' ~ whaterPoint.distributionNetwork.type) | trans }}</span>
  170. </div>
  171. <div class="ms-4 me-auto">
  172. Estado:
  173. {% if whaterPoint.distributionNetwork.whaterStatus == 'DN_STATUS_SUITABLE' %}
  174. <span class="fw-bold text-success ">Apta</span>
  175. {% elseif whaterPoint.distributionNetwork.whaterStatus == 'DN_STATUS_NOT_SUITABLE' %}
  176. <span class="fw-bold text-danger ">No apta</span>
  177. {% else %}
  178. <span class="fw-bold">Sin Información</span>
  179. {% endif %}
  180. </div>
  181. <div class="ms-4 me-auto">
  182. Fecha última actualización:
  183. <span class="fw-bold">{{whaterPoint.distributionNetwork.lastAnalitycsUpdateAt | date('d-m-Y') }}</span>
  184. </div>
  185. {% if whaterPoint.distributionNetwork.sinacId is not none and whaterPoint.town.externalIds is not none and whaterPoint.town.externalIds.sinac is defined %}
  186. <div class="ms-4 me-auto">
  187. Enlace web SINAC:
  188. <a href="{{ sinac_domain }}/CiudadanoWeb/ciudadano/informacionAbastecimientoActionDetalleRed.do?idRed={{ whaterPoint.distributionNetwork.sinacId }}&codMunicipio={{ whaterPoint.town.externalIds.sinac}}"
  189. target="_black"
  190. >{{sinac_domain}}</a>
  191. </div>
  192. {% endif %}
  193. </div>
  194. <div class="row g-5 mb-2 mt-4">
  195. <div class="col-12 text-center text-md-start" >
  196. <h3 class="mb-3" >Calidad del agua</h3>
  197. <ul class="list-group">
  198. {% if whaterPoint.responsableOrganizationUbication is not none %}
  199. <li class="list-group-item">
  200. <h5 class="ms-2 mb-3">Responsable de ubicación</h5>
  201. <div class="row ms-2">
  202. <div class="col-12 col-lg-5 mb-2">
  203. <h6 class="mb-0">Nombre</h6>
  204. <div class="mt-2">{{ whaterPoint.responsableOrganizationUbication.name | title }}</div>
  205. </div>
  206. <div class="col-12 col-lg-4 mb-2">
  207. <h6 class="mb-0">Ultima información</h6>
  208. <div class="mt-2">
  209. {% if whaterPoint.whaterStatusAt is not none %}
  210. {{ whaterPoint.whaterStatusAt | date('d-m-Y') }}
  211. {% else %}
  212. -
  213. {% endif %}
  214. </div>
  215. </div>
  216. <div class="col-12 col-lg-3 mb-2">
  217. <h6 class="mb-0">Estado</h6>
  218. <div class="mt-1">
  219. {% if whaterPoint.whaterStatus is not none %}
  220. {% if whaterPoint.whaterStatus == 'WP_STATUS_SUITABLE' %}
  221. <img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-circle-green.svg')) }}" />
  222. {% elseif whaterPoint.whaterStatus == 'WP_STATUS_NOT_SUITABLE' %}
  223. <img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-circle-red.svg')) }}" />
  224. {% else %}
  225. <img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-circle-yellow.svg')) }}" />
  226. {% endif %}
  227. {% else %}
  228. <img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-circle-yellow.svg')) }}" />
  229. {% endif %}
  230. </div>
  231. </div>
  232. </div>
  233. </li>
  234. {% endif %}
  235. {% if whaterPoint.distributionNetwork.responsableOrganizationGovernment is not none %}
  236. <li class="list-group-item">
  237. <h5 class="ms-2 mb-3">Responsable de la Red</h5>
  238. <div class="row ms-2">
  239. <div class="col-12 col-lg-5 mb-2">
  240. <h6 class="mb-0">Nombre</h6>
  241. <div class="mt-2">{{ whaterPoint.distributionNetwork.responsableOrganizationGovernment.name | title }}</div>
  242. </div>
  243. <div class="col-12 col-lg-4 mb-2">
  244. <h6 class="mb-0">Ultima información</h6>
  245. <div class="mt-2">
  246. {% if whaterPoint.distributionNetwork.whaterStatusByGovernmentUpdatedAt is not none %}
  247. {{ whaterPoint.distributionNetwork.whaterStatusByGovernmentUpdatedAt | date('d-m-Y') }}
  248. {% else %}
  249. -
  250. {% endif %}
  251. </div>
  252. </div>
  253. <div class="col-12 col-lg-3 mb-2">
  254. <h6 class="mb-0">Estado</h6>
  255. <div class="mt-1">
  256. {% if whaterPoint.distributionNetwork.whaterStatusByGovernment is not none %}
  257. {% if whaterPoint.distributionNetwork.whaterStatusByGovernment == 'DN_STATUS_SUITABLE' %}
  258. <img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-circle-green.svg')) }}" />
  259. {% elseif whaterPoint.distributionNetwork.whaterStatusByGovernment == 'DN_STATUS_NOT_SUITABLE' %}
  260. <img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-circle-red.svg')) }}" />
  261. {% else %}
  262. <img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-circle-yellow.svg')) }}" />
  263. {% endif %}
  264. {% else %}
  265. <img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-circle-yellow.svg')) }}" />
  266. {% endif %}
  267. </div>
  268. </div>
  269. </div>
  270. </li>
  271. {% endif %}
  272. {% if whaterPoint.distributionNetwork.responsableOrganizationOperator is not none %}
  273. <li class="list-group-item">
  274. <h5 class="ms-2 mb-3">Operador responsable de la Red</h5>
  275. <div class="row ms-2">
  276. <div class="col-12 col-lg-5 mb-2">
  277. <h6 class="mb-0">Nombre</h6>
  278. <div class="mt-2">{{ whaterPoint.distributionNetwork.responsableOrganizationOperator.name | title }}</div>
  279. </div>
  280. <div class="col-12 col-lg-4 mb-2">
  281. <h6 class="mb-0">Ultima información</h6>
  282. <div class="mt-2">
  283. {% if whaterPoint.distributionNetwork.whaterStatusByOperatorUpdatedAt is not none %}
  284. {{ whaterPoint.distributionNetwork.whaterStatusByOperatorUpdatedAt | date('d-m-Y') }}
  285. {% else %}
  286. -
  287. {% endif %}
  288. </div>
  289. </div>
  290. <div class="col-12 col-lg-3 mb-2">
  291. <h6 class="mb-0">Estado</h6>
  292. <div class="">
  293. {% if whaterPoint.distributionNetwork.whaterStatusByOperator is not none %}
  294. {% if whaterPoint.distributionNetwork.whaterStatusByOperator == 'DN_STATUS_SUITABLE' %}
  295. <img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-circle-green.svg')) }}" />
  296. {% elseif whaterPoint.distributionNetwork.whaterStatusByOperator == 'DN_STATUS_NOT_SUITABLE' %}
  297. <img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-circle-red.svg')) }}" />
  298. {% else %}
  299. <img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-circle-yellow.svg')) }}" />
  300. {% endif %}
  301. {% else %}
  302. <img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-circle-yellow.svg')) }}" />
  303. {% endif %}
  304. </div>
  305. </div>
  306. </div>
  307. </li>
  308. {% endif %}
  309. {% if whaterPoint.distributionNetwork.responsableOrganizationUbication is not none %}
  310. <li class="list-group-item">
  311. <h5 class="ms-2 mb-3">Responsable de ubicación de la Red</h5>
  312. <div class="row ms-2">
  313. <div class="col-12 col-lg-5 mb-2">
  314. <h6 class="mb-0">Nombre</h6>
  315. <div class="mt-2">{{ whaterPoint.distributionNetwork.responsableOrganizationUbication.name | title }}</div>
  316. </div>
  317. <div class="col-12 col-lg-4 mb-2">
  318. <h6 class="mb-0">Ultima información</h6>
  319. <div class="mt-2">
  320. {% if whaterPoint.distributionNetwork.whaterStatusByUbicationUpdatedAt is not none %}
  321. {{ whaterPoint.distributionNetwork.whaterStatusByUbicationUpdatedAt | date('d-m-Y') }}
  322. {% else %}
  323. -
  324. {% endif %}
  325. </div>
  326. </div>
  327. <div class="col-12 col-lg-3 mb-2">
  328. <h6 class="mb-0">Estado</h6>
  329. <div class="mt-1">
  330. {% if whaterPoint.distributionNetwork.whaterStatusByUbication is not none %}
  331. {% if whaterPoint.distributionNetwork.whaterStatusByUbication == 'DN_STATUS_SUITABLE' %}
  332. <img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-circle-green.svg')) }}" />
  333. {% elseif whaterPoint.distributionNetwork.whaterStatusByUbication == 'DN_STATUS_NOT_SUITABLE' %}
  334. <img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-circle-red.svg')) }}" />
  335. {% else %}
  336. <img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-circle-yellow.svg')) }}" />
  337. {% endif %}
  338. {% else %}
  339. <img style="height:40px;" src="{{ absolute_url(asset('/assets/images/widget_icons/whater-widget-circle-yellow.svg')) }}" />
  340. {% endif %}
  341. </div>
  342. </div>
  343. </div>
  344. </li>
  345. {% endif %}
  346. </ul>
  347. </div>
  348. </div>
  349. {% endif %}
  350. </div>
  351. <div class="col-xl-6">
  352. <h3 class="mb-2" >Código QR del WhaterPoint</h3>
  353. <div class="mb-3">
  354. <img src="{{ qr_code_data_uri(url('web_public_whater_point_show_by_slug', {'whaterPointSlug': whaterPoint.slug }), 'qr_ticket') }}"/>
  355. </div>
  356. {% if is_ecommerce_active %}
  357. {% if whaterPoint.product is not none and whaterPoint.product.isEnable %}
  358. <p class="text-muted">
  359. ¿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!
  360. <a href="#" class="fs--1">(más informacion)</a>
  361. </p>
  362. <div class="text-center">
  363. <p class="text-primary fw-bold">Recarga tu botella de agua en este whaterpoint por: </p>
  364. <div class="d-flex">
  365. <button type="button" ng-click="buyProduct('{{ whaterPoint.product.id }}', 'whatercoins')"
  366. class="btn btn-lg btn-primary w-100 mb-4 mx-2">
  367. {{ whaterPoint.product.productPrice | number_format(2, ',', '.') }} whatercoins!
  368. </button>
  369. </div>
  370. </div>
  371. {% endif %}
  372. {% endif %}
  373. {% if is_granted('IS_AUTHENTICATED_FULLY') and app.user %}
  374. <h3 class="mb-2">¡Danos tu opinión!</h3>
  375. {% set myvaloration = app.user.user.valorationForWhaterpoint(whaterPoint.id) %}
  376. <div class="row align-items-center pb-3" ng-init="initValorations('{{whaterPoint.id}}')" >
  377. <div class="col-2">General:</div>
  378. <div class="col-10">
  379. <div class="radio-container d-flex" id="select-general-quality" {% if myvaloration is not none %}data-valoration="{{myvaloration.generalValoration}}"{% endif %}>
  380. <div class="mx-3">
  381. <input type="radio" id="radio-val1" name="general" value="WP_QUALITY_ACCEPTABLE_VALORATION">
  382. <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>
  383. </div>
  384. <div class="mx-3">
  385. <input type="radio" id="radio-val2" name="general" value="WP_QUALITY_NEEDS_IMPROVEMENT_VALORATION">
  386. <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>
  387. </div>
  388. <div class="mx-3">
  389. <input type="radio" id="radio-val3" name="general" value="WP_QUALITY_NOT_ACCEPTABLE_VALORATION">
  390. <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>
  391. </div>
  392. </div>
  393. </div>
  394. </div>
  395. <h6 class="mt-2 mb-2">Danos una valoración más específica evaluando los siguientes parámetros </h6>
  396. <div class="row pb-3">
  397. <div class="row align-items-center" >
  398. <div class="col-2 text-end">Sabor:</div>
  399. <div class="col-10">
  400. <div class="radio-container d-flex" id="select-taste-quality" {% if myvaloration is not none %}data-valoration="{{myvaloration.tasteValoration}}"{% endif %}>
  401. <label class="me-3"><input type="radio" name="taste" value="WP_QUALITY_ACCEPTABLE_VALORATION"> {{ ('whater_valoration.quality.WP_QUALITY_ACCEPTABLE_VALORATION') | trans}}</label>
  402. <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>
  403. <label><input type="radio" name="taste" value="WP_QUALITY_NOT_ACCEPTABLE_VALORATION"> {{ ('whater_valoration.quality.WP_QUALITY_NOT_ACCEPTABLE_VALORATION') | trans}}</label>
  404. </div>
  405. </div>
  406. </div>
  407. <div class="row align-items-center">
  408. <div class="col-2 text-end">Olor:</div>
  409. <div class="col-10">
  410. <div class="radio-container d-flex" id="select-smell-quality" {% if myvaloration is not none %}data-valoration="{{myvaloration.smellValoration}}"{% endif %}>
  411. <label class="me-3"><input type="radio" name="smell" value="WP_QUALITY_ACCEPTABLE_VALORATION"> {{ ('whater_valoration.quality.WP_QUALITY_ACCEPTABLE_VALORATION') | trans}}</label>
  412. <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>
  413. <label><input type="radio" name="smell" value="WP_QUALITY_NOT_ACCEPTABLE_VALORATION"> {{ ('whater_valoration.quality.WP_QUALITY_NOT_ACCEPTABLE_VALORATION') | trans}}</label>
  414. </div>
  415. </div>
  416. </div>
  417. <div class="row align-items-center">
  418. <div class="col-2 text-end">Color:</div>
  419. <div class="col-10">
  420. <div class="radio-container d-flex" id="select-color-quality" {% if myvaloration is not none %}data-valoration="{{myvaloration.colorValoration}}"{% endif %}>
  421. <label class="me-3"><input type="radio" name="color" value="WP_QUALITY_ACCEPTABLE_VALORATION"> {{ ('whater_valoration.quality.WP_QUALITY_ACCEPTABLE_VALORATION') | trans}}</label>
  422. <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>
  423. <label><input type="radio" name="color" value="WP_QUALITY_NOT_ACCEPTABLE_VALORATION"> {{ ('whater_valoration.quality.WP_QUALITY_NOT_ACCEPTABLE_VALORATION') | trans}}</label>
  424. </div>
  425. </div>
  426. </div>
  427. <div class="row align-items-center">
  428. <div class="col-2 text-end">Turbidez:</div>
  429. <div class="col">
  430. <div class="radio-container d-flex" id="select-turbidity-quality" {% if myvaloration is not none %}data-valoration="{{myvaloration.turbidityValoration}}"{% endif %}>
  431. <label class="me-3"><input type="radio" name="turbidity" value="WP_QUALITY_ACCEPTABLE_VALORATION"> {{ ('whater_valoration.quality.WP_QUALITY_ACCEPTABLE_VALORATION') | trans}}</label>
  432. <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>
  433. <label><input type="radio" name="turbidity" value="WP_QUALITY_NOT_ACCEPTABLE_VALORATION"> {{ ('whater_valoration.quality.WP_QUALITY_NOT_ACCEPTABLE_VALORATION') | trans}}</label>
  434. </div>
  435. </div>
  436. </div>
  437. </div>
  438. {% endif %}
  439. {% if is_granted('IS_AUTHENTICATED_FULLY') and app.user and app.user.user.whaterOrganization and whaterPoint.responsableOrganizationUbication and app.user.user.whaterOrganization == whaterPoint.responsableOrganizationUbication %}
  440. <h5 class="mt-3 mb-2"
  441. 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}}')">
  442. Resultado de valoraciones de usuarios
  443. </h5>
  444. <div class="row">
  445. <div class="col-md-2 text-center mb-2" >
  446. <div class="fs-0"></div>
  447. </div>
  448. <div class="col-md-3 text-center mb-2" >
  449. <div>Aceptable: </div>
  450. </div>
  451. <div class="col-md-4 text-center mb-2" >
  452. <div>Mejorable: </div>
  453. </div>
  454. <div class="col-md-3 text-center mb-2" >
  455. <div>No aceptable: </div>
  456. </div>
  457. </div>
  458. <div class="row">
  459. <div class="col-md-2 text-end mb-2" >
  460. <div class="fs-0">General:</div>
  461. </div>
  462. <div class="col-md-3 text-center mb-2" >
  463. <div id="totalAcceptableGeneral" ></div>
  464. </div>
  465. <div class="col-md-4 text-center mb-2" >
  466. <div id="totalNeedsImprovementGeneral" ></div>
  467. </div>
  468. <div class="col-md-3 text-center mb-2" >
  469. <div id="totalNotAcceptableGeneral" ></div>
  470. </div>
  471. </div>
  472. <div class="row">
  473. <div class="col-md-2 text-end mb-2" >
  474. <div class="fs-0">Sabor:</div>
  475. </div>
  476. <div class="col-md-3 text-center mb-2" >
  477. <div id="totalAcceptableTaste" ></div>
  478. </div>
  479. <div class="col-md-4 text-center mb-2" >
  480. <div id="totalNeedsImprovementTaste" ></div>
  481. </div>
  482. <div class="col-md-3 text-center mb-2" >
  483. <div id="totalNotAcceptableTaste" ></div>
  484. </div>
  485. </div>
  486. <div class="row">
  487. <div class="col-md-2 text-end mb-2" >
  488. <div class="fs-0">Olor:</div>
  489. </div>
  490. <div class="col-md-3 text-center mb-2" >
  491. <div id="totalAcceptableSmell" ></div>
  492. </div>
  493. <div class="col-md-4 text-center mb-2" >
  494. <div id="totalNeedsImprovementSmell" ></div>
  495. </div>
  496. <div class="col-md-3 text-center mb-2" >
  497. <div id="totalNotAcceptableSmell" ></div>
  498. </div>
  499. </div>
  500. <div class="row">
  501. <div class="col-md-2 text-end mb-2" >
  502. <div class="fs-0">Color:</div>
  503. </div>
  504. <div class="col-md-3 text-center mb-2" >
  505. <div id="totalAcceptableColor" ></div>
  506. </div>
  507. <div class="col-md-4 text-center mb-2" >
  508. <div id="totalNeedsImprovementColor" ></div>
  509. </div>
  510. <div class="col-md-3 text-center mb-2" >
  511. <div id="totalNotAcceptableColor" ></div>
  512. </div>
  513. </div>
  514. <div class="row">
  515. <div class="col-md-2 text-end mb-2" >
  516. <div class="fs-0">Turbidez: </div>
  517. </div>
  518. <div class="col-md-3 text-center mb-2" >
  519. <div id="totalAcceptableTurbidity" ></div>
  520. </div>
  521. <div class="col-md-4 text-center mb-2" >
  522. <div id="totalNeedsImprovementTurbidity" ></div>
  523. </div>
  524. <div class="col-md-3 text-center mb-2" >
  525. <div id="totalNotAcceptableTurbidity" ></div>
  526. </div>
  527. </div>
  528. {% endif %}
  529. <div class="d-flex align-items-center">
  530. <div class="">
  531. {% if whaterPoint.averageUserGeneral is not none %}
  532. {% if whaterPoint.averageUserGeneral <= 3 %}
  533. <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"/>
  534. {% elseif whaterPoint.averageUserGeneral > 3 and whaterPoint.averageUserGeneral < 8 %}
  535. <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"/>
  536. {% elseif whaterPoint.averageUserGeneral >= 8 %}
  537. <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"/>
  538. {% endif %}
  539. {% elseif whaterPoint.averageProfessionalGeneral is not none %}
  540. {% if whaterPoint.averageProfessionalGeneral <= 3 %}
  541. <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"/>
  542. {% elseif whaterPoint.averageUserGeneral > 3 and whaterPoint.averageProfessionalGeneral < 8 %}
  543. <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"/>
  544. {% elseif whaterPoint.averageProfessionalGeneral >= 8 %}
  545. <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"/>
  546. {% endif %}
  547. {% endif %}
  548. </div>
  549. <div class="d-flex align-items-center">
  550. {% if whaterPoint.averageUserGeneral is none and whaterPoint.averageProfessionalGeneral is none %}
  551. <div class="ms-3 text-1000">
  552. <div class="text-muted">Este whaterpoint aún no ha recibido valoraciones.</div>
  553. </div>
  554. {% else %}
  555. <div class="ms-3 text-1000">
  556. {% if whaterPoint.averageUserGeneral is not none %}
  557. <div>La valoracion media de usuarios es de <span class="fw-bold">{{whaterPoint.averageUserGeneral | number_format(2, ',', '.') }}</span> sobre 10</div>
  558. {% endif %}
  559. {% if whaterPoint.averageProfessionalGeneral is not none %}
  560. <div>La valoracion media de profesionales es de <span class="fw-bold">{{whaterPoint.averageProfessionalGeneral | number_format(2, ',', '.')}}</span> sobre 10</div>
  561. {% endif %}
  562. </div>
  563. {% endif %}
  564. </div>
  565. </div>
  566. <h3 class="mt-5 mb-2" >
  567. Comentarios de los usuarios
  568. </h3>
  569. {% set allow_comment_button = true %}
  570. {% if is_granted('IS_AUTHENTICATED_FULLY') %}
  571. {% for valoration in whaterPoint.valorations %}
  572. {% if valoration.createdBy.equals(app.user.user) and valoration.userCommentText is not none %}
  573. {% set allow_comment_button = false %}
  574. {% endif %}
  575. {% endfor %}
  576. <div class="d-flex flex-row-reverse mb-2">
  577. <button class="btn btn-secondary btn-sm" type="button"
  578. {% if allow_comment_button %}
  579. ng-click="createCommentModal()"
  580. {% else %}
  581. disabled="disabled"
  582. {% endif %}
  583. >Añadir comentario</button>
  584. </div>
  585. {% endif %}
  586. <div class="row pb-3">
  587. <div class="col-12 col-xl-auto flex-1">
  588. {% set num_comments = 0 %}
  589. {% for valoration in whaterPoint.valorations %}
  590. {% if valoration.hideUserComment == false and valoration.userCommentText is not none %}
  591. {% set num_comments = num_comments + 1 %}
  592. <div class="border-2 border-dashed mb-3 pt-2 border-top">
  593. <div class="d-flex">
  594. <div class="fs--1 text-600">
  595. <span class="fa-solid fa-clock me-2"></span>
  596. <span class="fw-semi-bold me-1">{{ valoration.createdAt | date('d-m-Y H:i') }}</span>
  597. </div>
  598. <p class="fs--1 mb-0 text-600">
  599. por
  600. <span class=" fw-semi-bold">{{ valoration.createdBy.fullName }}</span>
  601. </p>
  602. </div>
  603. <p class="mt-2 ms-3 text-1000">{{valoration.userCommentText | nl2br }}</p>
  604. {% if valoration.commentImage is not none %}
  605. <div class="w-100 w-md-50 ms-md-3">
  606. <a href="{{ vich_uploader_asset(valoration.commentImage, 'fileWhaterValorationImage') }}" data-gallery="gallery-posts-0">
  607. <img class="rounded h-100 w-100" src="{{ vich_uploader_asset(valoration.commentImage, 'fileWhaterValorationImage') | imagine_filter('whater_valoration_image_thumb_300_200') }}" alt="..." />
  608. </a>
  609. </div>
  610. {% endif %}
  611. {% set allow_delete = false %}
  612. {% set allow_reply = false %}
  613. {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  614. {% if app.user.user.checkPermission('PERMISSION_EDIT_WHATER_POINT',whaterPoint) %}
  615. {% set allow_delete = true %}
  616. {% set allow_reply = true %}
  617. {% endif %}
  618. {% if app.user.user.hasRole('ROLE_ADMIN') %}
  619. {% set allow_delete = true %}
  620. {% endif %}
  621. {% endif %}
  622. <div class="mt-2 ms-md-3">
  623. {% if allow_delete %}
  624. <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}}">
  625. <span class="fa-solid fa-trash-alt fs--2 me-1 text-danger"></span>
  626. <span class="fw-bold fs--2 text-danger">Eliminar mensaje</span>
  627. </button>
  628. {% endif %}
  629. {% if allow_reply %}
  630. <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}}">
  631. <span class="fa-solid fa-reply fs--2 me-1">
  632. </span>
  633. <span class="fw-bold fs--2">
  634. {% if valoration.responseCommentText is none%}
  635. Responder mensaje
  636. {% else %}
  637. Editar respuesta
  638. {% endif %}
  639. </span>
  640. </button>
  641. {% endif %}
  642. </div>
  643. {% if valoration.responseCommentText %}
  644. <div class="d-flex ms-md-3">
  645. <div class="fs--1 text-600">
  646. <span class="fa-solid fa-clock me-2"></span>
  647. <span class="fw-semi-bold me-1">{{ valoration.responseCommentAt | date('d-m-Y H:i') }}</span>
  648. </div>
  649. <p class="fs--1 mb-0 text-600">
  650. por
  651. {% if whaterPoint.responsableOrganizationUbication is not none %}
  652. <span class=" fw-semi-bold">{{whaterPoint.responsableOrganizationUbication.name}}</span>
  653. {% else %}
  654. <span class=" fw-semi-bold">whater.app</span>
  655. {% endif %}
  656. </p>
  657. </div>
  658. <p class="mt-2 ms-3 text-1000">{{valoration.responseCommentText | nl2br }}</p>
  659. {% endif %}
  660. </div>
  661. {% endif %}
  662. {% endfor %}
  663. {% if num_comments == 0 %}
  664. <p class="mt-2 ms-3 text-1000">
  665. <span class="text-muted">Este whaterpoint aún no ha recibido comentarios.</span>
  666. </p>
  667. {% endif %}
  668. {% if not is_granted('IS_AUTHENTICATED_FULLY') %}
  669. <a href="{{path('web_login', {'_target_path': path('web_public_whater_point_show',{'whaterPointId': whaterPoint.id})})}}">Entra y comenta!</a>
  670. {%endif %}
  671. </div>
  672. </div>
  673. </div>
  674. </div>
  675. {% if (recommendedProducts | length ) > 0 %}
  676. <div class="row g-5 mb-5">
  677. <div class="col-12">
  678. <h3 class="mb-3">Productos recomendados</h3>
  679. <div class="row">
  680. {% for product in recommendedProducts %}
  681. <div class="col-6 col-lg-2 col-md-3">
  682. <div class="product-card h-100">
  683. <div class="d-flex flex-column justify-content-between h-100">
  684. <div class="">
  685. <a class="border border-1 rounded-3 position-relative mb-2"
  686. {% if single_page is defined and single_page == true %}
  687. target="_blank"
  688. {% endif %}
  689. href="{{ path('web_public_show_product', {'productSlug':product.productSlug})}}" >
  690. <img class="img-fluid product-image"
  691. {% if (product.images| length) > 0 %}
  692. src="{{ vich_uploader_asset( product.images.0, 'fileProductImage') | imagine_filter('product_list_image') }}"
  693. {% else %}
  694. src="{{asset('/assets/images/gota-foto-3@2x.png')}}"
  695. {% endif %}
  696. />
  697. </a>
  698. <a class="text-decoration-none"
  699. {% if single_page is defined and single_page == true %}
  700. target="_blank"
  701. {% endif %}
  702. href="{{ path('web_public_show_product', {'productSlug':product.productSlug})}}" >
  703. <span class="product-name fw-bold text-dark">{{product.productLabel}}</span>
  704. </a>
  705. </div>
  706. <div class="d-flex align-items-center justify-content-end mb-1">
  707. <p class="mb-0 text-700 product-price-label">Desde {{product.productPrice}}€</p>
  708. </div>
  709. </div>
  710. </div>
  711. </div>
  712. {% endfor %}
  713. </div>
  714. </div>
  715. </div>
  716. {% endif %}
  717. {% if (whaterArticles | length ) > 0 %}
  718. <div class="row g-5 mb-5">
  719. <div class="col-12">
  720. <div class="row g-0 py-3 align-items-end justify-content-between">
  721. <h3 class="flex-1 mb-0 text-nowrap me-3">Artículos recomendados</h3>
  722. </div>
  723. </div>
  724. {% for article in whaterArticles %}
  725. <div class="col-6 col-md-4 my-2 py-1">
  726. <div class="card" >
  727. {% if article.headerImageUrl %}
  728. <a href="{{ url('web_blog_show_article', { 'articleSlug' : article.slug('es'), '_locale': 'es' })}}">
  729. <img class="card-img-top" src="{{ article.headerImageUrl | imagine_filter('whater_blog_header_list_image_1200_200') }}" title="{{ article.title('es') }}">
  730. </a>
  731. {% endif %}
  732. <div class="card-body">
  733. <a class="text-dark" href="{{ url('web_blog_show_article', { 'articleSlug' : article.slug('es'), '_locale': 'es' })}}">
  734. <h3 class="card-title">{{ article.title('es') }}</h3>
  735. </a>
  736. <p class="card-text">{{ article.content('es') | striptags | u.truncate(350) |raw }}...</p>
  737. <div class="fs--1 text-muted">{{ article.publishAt | date('d-m-Y') }} - {{ article.publishAt | ago }}</div>
  738. <div class="my-1">
  739. {% for metaKeyword in article.metaKeywords('es') %}
  740. <a class="text-muted fs--1">#{{ metaKeyword | replace({' ': '-'})}}</a>
  741. {% endfor %}
  742. </div>
  743. </div>
  744. </div>
  745. </div>
  746. {% endfor %}
  747. </div>
  748. {% endif %}
  749. </div>
  750. <div class="modal fade" id="createCommentModal" tabindex="-1" aria-hidden="true">
  751. <div class="modal-dialog">
  752. <div class="modal-content">
  753. <div class="modal-header">
  754. <h5 class="modal-title" id="createCommentModalLabel">Añadir comentario</h5>
  755. <button class="btn p-1" type="button" data-bs-dismiss="modal" aria-label="Close">
  756. <span class="fas fa-times fs--1"></span>
  757. </button>
  758. </div>
  759. <div class="modal-body">
  760. <textarea class="form-control mb-3" ng-model="valorationCommentText" rows="4"></textarea>
  761. <div class="mt-2">¿Quieres subir una foto? (min 300x300)</div>
  762. <input id="fileImageInput" type="file" ng-model="valorationCommentImage" accept="image/*" class="form-control">
  763. </div>
  764. <div class="modal-footer">
  765. <button class="btn btn-primary" type="button" ng-click="acceptCommentModalButton()">Aceptar</button>
  766. <button class="btn btn-outline-primary" type="button" data-bs-dismiss="modal">Cancelar</button>
  767. </div>
  768. </div>
  769. </div>
  770. </div>
  771. <div class="modal fade" id="deleteCommentModal" tabindex="-1" aria-hidden="true">
  772. <div class="modal-dialog">
  773. <div class="modal-content">
  774. <div class="modal-header">
  775. <h5 class="modal-title" id="deleteCommentModalLabel">Eliminar comentario</h5>
  776. <button class="btn p-1" type="button" data-bs-dismiss="modal" aria-label="Close">
  777. <span class="fas fa-times fs--1"></span>
  778. </button>
  779. </div>
  780. <div class="modal-body">
  781. <p>Estás a punto de eliminar este comentario. ¿Deseas continuar?</p>
  782. <p>El usuario no podrá volver a realizar un comentario sobre este whaterpoint.</p>
  783. </div>
  784. <div class="modal-footer">
  785. <button class="btn btn-danger" type="button" ng-click="acceptDeleteCommentModalButton()">Aceptar</button>
  786. <button class="btn btn-secondary" type="button" data-bs-dismiss="modal">Cancelar</button>
  787. </div>
  788. </div>
  789. </div>
  790. </div>
  791. <div class="modal fade" id="replyCommentModal" tabindex="-1" aria-hidden="true">
  792. <div class="modal-dialog">
  793. <div class="modal-content">
  794. <div class="modal-header">
  795. <h5 class="modal-title" id="replyCommentModalLabel">Añadir comentario</h5>
  796. <button class="btn p-1" type="button" data-bs-dismiss="modal" aria-label="Close">
  797. <span class="fas fa-times fs--1"></span>
  798. </button>
  799. </div>
  800. <div class="modal-body">
  801. <textarea class="form-control mb-3" ng-model="valorationReplyCommentText" rows="4"></textarea>
  802. </div>
  803. <div class="modal-footer">
  804. <button class="btn btn-primary" type="button" ng-click="acceptReplyCommentModalButton()">Aceptar</button>
  805. <button class="btn btn-outline-primary" type="button" data-bs-dismiss="modal">Cancelar</button>
  806. </div>
  807. </div>
  808. </div>
  809. </div>
  810. </div>
  811. {% endblock contents %}