src/UI/WebBundle/Resources/views/Zones/public_town_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.zones.town.show.title'|trans }} - {{ town.name | title }} | {{ parent() }}{% endblock %}
  4. {% block classBody %}town {{ parent() }}{% endblock %}
  5. {% block ogTitle %}{{ 'admin.zones.town.show.title'|trans }} - {{ town.name | title }} | {{ parent() }}{% endblock ogTitle %}
  6. {% block stylesheets %}
  7. {{ parent() }}
  8. {{ encore_entry_link_tags('leaflet_styles') }}
  9. <link rel="stylesheet" href="{{ asset('assets/lib/slick-carousel/slick/slick.css') }}" type="text/css" media="all" />
  10. <link rel="stylesheet" href="{{ asset('assets/lib/slick-carousel/slick/slick-theme.css') }}" type="text/css" media="all" />
  11. {% endblock stylesheets %}
  12. {% block javascripts %}
  13. {{ parent() }}
  14. {{ encore_entry_script_tags('leaflet_js') }}
  15. {{ encore_entry_script_tags('wt_town_show') }}
  16. {% endblock javascripts %}
  17. {% block contents %}
  18. <div class="container-small" ng-controller="showTownCtrl">
  19. <nav class="mb-2" aria-label="breadcrumb">
  20. <ol class="breadcrumb mb-0">
  21. <li class="breadcrumb-item"><a href="{{path('web_init')}}">Inicio</a></li>
  22. <li class="breadcrumb-item">{{ town.country.name | title }}</li>
  23. {% if town.countryArea %}
  24. <li class="breadcrumb-item"><a href="{{ path('web_public_country_area_show_by_slug', { 'countryAreaSlug': town.countryArea.slug})}}">{{ town.countryArea.name | title }}</a></li>
  25. {% endif %}
  26. <li class="breadcrumb-item active" aria-current="page">
  27. {{ town.name | title }}
  28. {% if is_granted('IS_AUTHENTICATED_REMEMBERED') and app.user.user.hasRole('ROLE_ADMIN') %}
  29. (<a href="{{path('web_admin_town_edit', {'townId': town.id})}}">Editar</a>)
  30. {% endif %}
  31. </li>
  32. </ol>
  33. </nav>
  34. <div class="pb-9">
  35. <h2 class="mb-4">
  36. {{ town.name | title }}
  37. {% if town.whaterOrganization is none %}
  38. <span class="fas fa-star-half-alt text-warning fs-1" title="Sin reclamar"></span>
  39. <span class="fas fa-star-half-alt text-warning fs-1" title="Sin verificar"></span>
  40. {% elseif town.whaterOrganization.checkPermission('PERMISSION_EDIT_TOWN', town) %}
  41. <span class="fas fa-star text-success fs-1" title="Registrado"></span>
  42. <span class="fas fa-star text-success fs-1" title="Verificado"></span>
  43. {% else %}
  44. <span class="fas fa-star text-success fs-1" title="Registrado"></span>
  45. <span class="fas fa-star-half-alt text-warning fs-1" title="Sin verificar"></span>
  46. {% endif %}
  47. </h2>
  48. <div class="row g-5 mb-5">
  49. <div class="col-12 col-lg-8" ng-init="initTownMap('{{town.id}}',{{town.latitude}},{{town.longitude}},'{{geometryPolygonArray}}')">
  50. <div id="town_map" style="height:400px;width:100%"></div>
  51. </div>
  52. <div class="col-12 col-lg-4">
  53. <h3 class="mb-3" >Municipio</h3>
  54. <div class="mb-2">
  55. <h6 class="mb-0">Municipio</h6>
  56. <div class="">{{ town.name | title }}</div>
  57. </div>
  58. {% if town.countryArea %}
  59. <div class="mb-2">
  60. <h6 class="mb-0">Región / Provincia</h6>
  61. <a class="" href="{{ path('web_public_country_area_show_by_slug', { 'countryAreaSlug': town.countryArea.slug})}}">{{ town.countryArea.name | title }}</a>
  62. </div>
  63. {% endif %}
  64. <div class="mb-2">
  65. <h6 class="mb-0">País</h6>
  66. <div class="">{{ town.country.name | title }}</div>
  67. </div>
  68. <div class="mb-2">
  69. <h6 class="mb-0">Localizaciones</h6>
  70. <div class="">
  71. {{ town.townLocations | length}}
  72. {#
  73. {% if (town.townLocations | length)> 0 %}
  74. <a href="#" class="fs--1" ng-click="showTownLocationsInMap()">(Ver en el mapa)</a>
  75. <div class="alert alert-soft-success px-1 py-1 ng-hide" ng-show="showTownLocations" >Estas viendo las localizaciones de la ciudad/municipio</div>
  76. {% endif %}
  77. #}
  78. </div>
  79. </div>
  80. <div class="mb-2">
  81. <h6 class="mb-0">Ubicaciones</h6>
  82. <div class="">
  83. {{ town.ubications | length}}
  84. {#
  85. {% if (town.ubications | length)> 0 %}
  86. <a href="#" class="fs--1" ng-click="showLocationsInMap()">(Ver en el mapa)</a>
  87. <div class="alert alert-soft-success px-1 py-1 ng-hide" ng-show="showLocations" >Estas viendo las ubicaciones de la ciudad/municipio</div>
  88. {% endif %}
  89. #}
  90. </div>
  91. </div>
  92. <div class="mb-2">
  93. <h6 class="mb-0">Establecimientos</h6>
  94. <div class="">
  95. {{ town.establishments | length}}
  96. {#
  97. {% if (town.establishments | length)> 0 %}
  98. <a href="#" class="fs--1" ng-click="showEstablishmentsInMap()">(Ver en el mapa)</a>
  99. <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>
  100. {% endif %}
  101. #}
  102. </div>
  103. </div>
  104. <div class="mb-2">
  105. <h6 class="mb-0">Whaterpoints</h6>
  106. <div class="">
  107. {{ town.whaterPoints | length}}
  108. {#
  109. {% if (town.whaterPoints | length)> 0 %}
  110. <a href="#" class="fs--1" ng-click="showWhaterPointsInMap()">(Ver en el mapa)</a>
  111. <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>
  112. {% endif %}
  113. #}
  114. </div>
  115. </div>
  116. {% if town.whaterOrganization is not none %}
  117. <div class="mb-2">
  118. <h6 class="mb-0">Organización</h6>
  119. <div class="">
  120. {{ town.whaterOrganization.name | title }}
  121. </div>
  122. </div>
  123. {% endif %}
  124. </div>
  125. </div>
  126. <div class="row g-5 mb-5">
  127. <div class="col-12 col-md-6" >
  128. <h3 class="mb-3" >Redes de distribución ({{ distributionNetworks| length }})</h3>
  129. <ul class="list-group">
  130. {% for distributionNetwork in distributionNetworks %}
  131. {% if distributionNetwork.type == 'DN_TYPE_EXTERNAL' %}
  132. <li class="list-group-item">
  133. <a href="{{ path('web_public_distribution_network_show_by_id',{'distributionNetworkId':distributionNetwork.id})}}"
  134. class="fs-0 fw-bold">{{ distributionNetwork.name | title }}</a>
  135. <div class="ms-2 me-auto">
  136. Tipo:
  137. <span class="fw-bold">{{ ('distributionNetwork.type.' ~ distributionNetwork.type) | trans }}</span>
  138. </div>
  139. <div class="ms-2 me-auto">
  140. Estado:
  141. {% if distributionNetwork.whaterStatus == 'DN_STATUS_SUITABLE' %}
  142. <span class="fw-bold text-success ">Apta</span>
  143. {% elseif distributionNetwork.whaterStatus == 'DN_STATUS_NOT_SUITABLE' %}
  144. <span class="fw-bold text-danger ">No apta</span>
  145. {% else %}
  146. <span class="fw-bold">Sin Información</span>
  147. {% endif %}
  148. </div>
  149. <div class="ms-2 me-auto">
  150. Fecha última actualización:
  151. <span class="fw-bold">{{distributionNetwork.lastAnalitycsUpdateAt | date('d-m-Y') }}</span>
  152. </div>
  153. {% if distributionNetwork.sinacId is not none and town.externalIds is not none and town.externalIds.sinac is defined %}
  154. <div class="ms-2 me-auto">
  155. Enlace web SINAC:
  156. <a href="{{ sinac_domain }}/CiudadanoWeb/ciudadano/informacionAbastecimientoActionDetalleRed.do?idRed={{ distributionNetwork.sinacId }}&codMunicipio={{ town.externalIds.sinac}}"
  157. target="_black"
  158. >{{sinac_domain}}</a>
  159. </div>
  160. {% endif %}
  161. </li>
  162. {% endif %}
  163. {% endfor %}
  164. </ul>
  165. </div>
  166. <div class="col-12 col-md-6">
  167. {% if is_granted('IS_AUTHENTICATED_FULLY') and town.whaterOrganization is none %}
  168. <div class="card">
  169. <div class="card">
  170. <div class="card-body">
  171. {{ function.showFlashes() }}
  172. {% form_theme form 'Form/bootstrap_5_layout.html.twig' %}
  173. {{ form_start(form , {'action': path('web_public_town_show_by_slug', { 'townSlug': town.slug }),
  174. 'method': 'POST',
  175. 'attr': { 'id': form.vars.name }}) }}
  176. <div class="col-auto mb-1">
  177. {{ form_label(form.message) }}
  178. {{ form_widget(form.message, {'attr': {'placeholder': ('admin.ownership_request.form.fields.text_placeholder_town'|trans({'%town_name%':town.name })) }}) }}
  179. {{ form_errors(form.message) }}
  180. </div>
  181. <div class="col-auto mb-1">
  182. {{ form_widget(form.check, {'attr': {'class': 'form-check-input' }}) }}
  183. <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>
  184. </div>
  185. <button class="btn btn-phoenix-secondary me-2 mb-2 mb-sm-0 mt-2"
  186. id='register_ownership_request'
  187. ng-init="registerOwnershipRequest()"
  188. data-user-id="{{app.user.user.id}}"
  189. data-town-id="{{town.id}}"
  190. {% if not enableRequestOwnership %} disabled="disabled" {% endif %}
  191. type="submit">Solicitar
  192. </button>
  193. {{ form_errors(form) }}
  194. {{ form_rest(form) }}
  195. {{ form_end(form) }}
  196. </div>
  197. </div>
  198. {% elseif town.whaterOrganization is none %}
  199. <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>
  200. {% endif %}
  201. </div>
  202. </div>
  203. </div>
  204. </div>
  205. </div>
  206. {% endblock contents %}