You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
3.0 KiB

  1. {% macro paginated(entities, title, column) %}
  2. {{ knp_pagination_sortable(entities, title, column) }}
  3. {% if entities.isSorted(column) %}
  4. <span class="badge text-bg-secondary">
  5. {% if entities.params.direction == 'asc' %}
  6. <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-sort-alpha-down" viewBox="0 0 16 16">
  7. <path fill-rule="evenodd" d="M10.082 5.629 9.664 7H8.598l1.789-5.332h1.234L13.402 7h-1.12l-.419-1.371zm1.57-.785L11 2.687h-.047l-.652 2.157z"/>
  8. <path d="M12.96 14H9.028v-.691l2.579-3.72v-.054H9.098v-.867h3.785v.691l-2.567 3.72v.054h2.645zM4.5 2.5a.5.5 0 0 0-1 0v9.793l-1.146-1.147a.5.5 0 0 0-.708.708l2 1.999.007.007a.497.497 0 0 0 .7-.006l2-2a.5.5 0 0 0-.707-.708L4.5 12.293z"/>
  9. </svg>
  10. {% endif %}
  11. {% if entities.params.direction == 'desc' %}
  12. <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-sort-alpha-down-alt" viewBox="0 0 16 16">
  13. <path d="M12.96 7H9.028v-.691l2.579-3.72v-.054H9.098v-.867h3.785v.691l-2.567 3.72v.054h2.645z"/>
  14. <path fill-rule="evenodd" d="M10.082 12.629 9.664 14H8.598l1.789-5.332h1.234L13.402 14h-1.12l-.419-1.371zm1.57-.785L11 9.688h-.047l-.652 2.156z"/>
  15. <path d="M4.5 2.5a.5.5 0 0 0-1 0v9.793l-1.146-1.147a.5.5 0 0 0-.708.708l2 1.999.007.007a.497.497 0 0 0 .7-.006l2-2a.5.5 0 0 0-.707-.708L4.5 12.293z"/>
  16. </svg>
  17. {% endif %}
  18. </span>
  19. {% endif %}
  20. {% endmacro %}
  21. {% macro map(entity, overpassResult='') %}
  22. <div
  23. id="map"
  24. class="img-fluid img-thumbnail min-vh-50"
  25. data-controller="map"
  26. data-map-geojson-value="{{ geoJsonManager.generateGeoJson(entity)|json_encode }}"
  27. {% if overpassResult is not empty %}
  28. data-map-overpass-result-value="{{ overpassResult }}"
  29. data-map-popup-url-value={{ url('app_map_popup') }}
  30. {% endif %}
  31. data-map-icon-value="{{ asset('images/marker.svg') }}"
  32. ></div>
  33. <details>
  34. <summary>Légende</summary>
  35. <span class="badge bg-info">Overpass</span>
  36. {% set stats = taskLifecycleManager.getProjectStats(entity) %}
  37. {% for place, data in stats %}
  38. <span class="badge {{ 'bg-' ~ data.color }}">{{ data.title }}</span>
  39. {% endfor %}
  40. </details>
  41. {% endmacro %}
  42. {% macro clipboard(text) %}
  43. <div class="input-group" data-controller="clipboard">
  44. <input type="text" readonly class="form-control" value="{{ text }}" data-clipboard-target="source" />
  45. <button class="btn btn-outline-secondary" type="button" data-action="clipboard#copy" title="Copier dans le presse-papier">
  46. <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-clipboard" viewBox="0 0 16 16">
  47. <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1z"/>
  48. <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0z"/>
  49. </svg>
  50. </button>
  51. </div>
  52. {% endmacro %}