src/UI/WebBundle/Resources/views/Whater/whater_analytical_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.analytical.show.title'|trans }} | {{ parent() }}{% endblock %}
  4. {% block classBody %}whater-analytical {{ parent() }}{% endblock %}
  5. {% block javascripts %}
  6. {{ parent() }}
  7. {{ encore_entry_script_tags('wt_analytical_show') }}
  8. {% endblock javascripts %}
  9. {% set isWhaterPoint = false %}
  10. {% set isDistributionNetwork = false %}
  11. {% if analytical.whaterPoint is not none %}
  12. {% set isWhaterPoint = true %}
  13. {% else %}
  14. {% set isDistributionNetwork = true %}
  15. {% endif %}
  16. {% block contents %}
  17. <div class="container-small" ng-controller="showAnalyticalCtrl">
  18. <nav class="mb-2" aria-label="breadcrumb">
  19. <ol class="breadcrumb mb-0">
  20. <li class="breadcrumb-item"><a href="{{path('web_init')}}">Inicio</a></li>
  21. {% if isWhaterPoint %}
  22. <li class="breadcrumb-item">{{ analytical.whaterPoint.town.country.name | title }}</li>
  23. <li class="breadcrumb-item"><a href="{{path('web_public_whater_point_show', {'whaterPointId': analytical.whaterPoint.id })}}">{{ analytical.whaterPoint.name | title }}</a></li>
  24. {% else %}
  25. <li class="breadcrumb-item">{{ analytical.distributionNetwork.country.name | title }}</li>
  26. <li class="breadcrumb-item"><a href="{{path('web_public_distribution_network_show_by_id',{'distributionNetworkId': analytical.distributionNetwork.id})}}">{{ analytical.distributionNetwork.name | title }}</a></li>
  27. {% endif %}
  28. <li class="breadcrumb-item active" aria-current="page">Analítica de agua</li>
  29. </ol>
  30. </nav>
  31. {{ function.showFlashes() }}
  32. <div class="pb-9">
  33. <h2 class="mb-4">Analítica de agua</h2>
  34. <div class="row g-5 mb-5">
  35. <div class="col-12 col-lg-4">
  36. <h3 class="mb-3" >Datos</h3>
  37. {% if isWhaterPoint %}
  38. <div class="mb-2">
  39. <h6 class="mb-0">Whaterpoint</h6>
  40. <div class="">{{ analytical.whaterPoint.name | title }}</div>
  41. </div>
  42. <div class="mb-2">
  43. <h6 class="mb-0">Ciudad/Municipio</h6>
  44. <div class="">{{ analytical.whaterPoint.town.name | title }}</div>
  45. </div>
  46. <div class="mb-2">
  47. <h6 class="mb-0">Pais</h6>
  48. <div class="">{{ analytical.whaterPoint.town.country.name | title }}</div>
  49. </div>
  50. {% else %}
  51. <div class="mb-2">
  52. <h6 class="mb-0">Pais</h6>
  53. <div class="">{{ analytical.distributionNetwork.country.name | title }}</div>
  54. </div>
  55. <div class="mb-2">
  56. <h6 class="mb-0">Red de Distribución</h6>
  57. <div class="">{{ analytical.distributionNetwork.name | title }}</div>
  58. </div>
  59. {% endif %}
  60. <div class="mb-2">
  61. <h6 class="mb-0">Fecha</h6>
  62. <div class="">{{analytical.analyzedAt | date('d-m-Y') }}</div>
  63. </div>
  64. <div class="mb-2">
  65. <h6 class="mb-0">Resultado</h6>
  66. <div class="">{{ ('analytical.result.' ~ analytical.result)| trans }}</div>
  67. </div>
  68. <div class="mb-2">
  69. <h6 class="mb-0">Origen</h6>
  70. <div class="">
  71. {% if analytical.createdFrom == 'sinac' and analytical.distributionNetwork and analytical.distributionNetwork.sinacId %}
  72. {% if analytical.whaterPoint is not none %}
  73. {% set codMunicipio = analytical.whaterPoint.town.externalIds.sinac %}
  74. {% else %}
  75. {% set codMunicipio = analytical.distributionNetwork.towns[0].externalIds.sinac %}
  76. {% endif %}
  77. <a href="{{sinac_domain}}/CiudadanoWeb/ciudadano/informacionAbastecimientoActionDetalleRed.do?idRed={{ analytical.distributionNetwork.sinacId }}&codMunicipio={{codMunicipio}}" target="_blank">{{sinac_domain}}</a>
  78. {% else %}
  79. <div class="">whater.app</div>
  80. {% endif %}
  81. </div>
  82. </div>
  83. <div class="mb-2">
  84. <h6 class="mb-0">Comentarios</h6>
  85. <div class="">{{ analytical.comments | raw}}</div>
  86. </div>
  87. </div>
  88. <div class="col-12 col-lg-4">
  89. <h3 class="mb-3" >Resultados</h3>
  90. {% for sample in analytical.samples %}
  91. <div class="mb-2">
  92. <h6 class="mb-0">{{ sample.analyticalParameter.parameterName }}</h6>
  93. {% set color = "" %}
  94. {% if sample.parameterValue < sample.analyticalParameter.referenceMinValue or sample.parameterValue > sample.analyticalParameter.referenceMaxValue %}
  95. {% set color = "text-danger" %}
  96. {% endif %}
  97. <div >
  98. <span class="{{color}}">{{ sample.parameterValue }} {{ sample.analyticalParameter.parameterMetric }}</span>
  99. <span class="small">(Min: {{ sample.analyticalParameter.referenceMinValue }}, Max: {{ sample.analyticalParameter.referenceMaxValue }})</span>
  100. </div>
  101. </div>
  102. {% else %}
  103. <div class="">No se han encontrado resultados</div>
  104. {% endfor %}
  105. </div>
  106. <div class="col-12 col-lg-4">
  107. <h3 class="mb-3" >Documentos</h3>
  108. <ul>
  109. {% for analyticalMedia in analytical.analyticalMedias %}
  110. <li>
  111. <a href="{{ vich_uploader_asset(analyticalMedia)}}" target="_blank" class="item">{{ analyticalMedia.fileOriginalname }}</a>
  112. </li>
  113. {% else %}
  114. <li>
  115. No se han enlazado documentos
  116. </li>
  117. {% endfor %}
  118. </ul>
  119. </div>
  120. </div>
  121. <div class="row g-5 mb-5">
  122. <div class="col-12">
  123. <h3 class="mb-3" >Histórico de resultados</h3>
  124. <table class="table table-sm">
  125. <thead>
  126. <tr>
  127. <th scope="col">Fecha</th>
  128. <th scope="col">Resultado</th>
  129. <th scope="col">Origen</th>
  130. <th scope="col">Responsables</th>
  131. <th scope="col">Comentarios</th>
  132. </tr>
  133. </thead>
  134. <tbody>
  135. {% set otherAnalyticals = [] %}
  136. {% if isWhaterPoint %}
  137. {% set otherAnalyticals = analytical.whaterPoint.analyticals %}
  138. {% else %}
  139. {% set otherAnalyticals = analytical.distributionNetwork.analyticals %}
  140. {% endif %}
  141. {% for otherAnalytical in otherAnalyticals %}
  142. <tr>
  143. <td ><a href="{{ path('web_public_analytical_show', {'analyticalId': otherAnalytical.id }) }}">{{otherAnalytical.analyzedAt | date('d-m-Y') }}</a></td>
  144. <td >
  145. {% set analytical_color = '' %}
  146. {% if otherAnalytical.result == 'SUITABLE' %}
  147. {% set analytical_color = 'badge bg-success' %}
  148. {% elseif otherAnalytical.result == 'NOT_SUITABLE' %}
  149. {% set analytical_color = 'badge bg-danger' %}
  150. {% else %}
  151. {% set analytical_color = 'badge' %}
  152. {% endif %}
  153. <span class="ui {{ analytical_color }} horizontal mini">{{ ('analytical.result.' ~ otherAnalytical.result)| trans }}</span>
  154. </td>
  155. <td >
  156. {% if otherAnalytical.createdFrom == 'sinac' and otherAnalytical.distributionNetwork and otherAnalytical.distributionNetwork.sinacId %}
  157. {% if otherAnalytical.whaterPoint is not none %}
  158. {% set codMunicipio = otherAnalytical.whaterPoint.town.externalIds.sinac %}
  159. {% else %}
  160. {% set codMunicipio = otherAnalytical.distributionNetwork.towns[0].externalIds.sinac %}
  161. {% endif %}
  162. <a href="{{sinac_domain}}/CiudadanoWeb/ciudadano/informacionAbastecimientoActionDetalleRed.do?idRed={{ otherAnalytical.distributionNetwork.sinacId }}&codMunicipio={{ codMunicipio }}" target="_blank">{{ analytical.source }}</a>
  163. {% else %}
  164. {{ otherAnalytical.source }}
  165. {% endif %}
  166. </td>
  167. <td>
  168. {% if otherAnalytical.responsable is not none %}
  169. {{ otherAnalytical.responsable.name }}<br/>
  170. {% endif %}
  171. </td>
  172. <td>
  173. {{ otherAnalytical.comments | raw}}
  174. </td>
  175. </tr>
  176. {% endfor %}
  177. </tbody>
  178. </table>
  179. </div>
  180. </div>
  181. </div>
  182. </div>
  183. {% endblock contents %}