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.

141 lines
5.6 KiB

4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
  1. {% extends 'base.html.twig' %}
  2. {% import 'macro.html.twig' as macro %}
  3. {% block breadcrumb %}
  4. <li class="breadcrumb-item"><a href="{{ path('app_project') }}">Projets</a></li>
  5. <li class="breadcrumb-item"><a href="{{ path('app_project_show', {'slug': project.slug}) }}">{{ project.name }}</a></li>
  6. <li class="breadcrumb-item"><a href="{{ path('app_task_show', {'slug': task.slug}) }}">{{ task.name }}</a></li>
  7. {% endblock %}
  8. {% block page_title %}
  9. {% include 'partials/_task-title.html.twig' %}
  10. {% endblock %}
  11. {% block page_content %}
  12. <div class="row">
  13. <div class="col mb-3">
  14. <div class="btn-group">
  15. <a href="{{ path('app_project_show', {'slug': project.slug}) }}" class="btn btn-secondary">Revenir au projet</a>
  16. {% if is_granted('IS_AUTHENTICATED_FULLY') %}
  17. {% if app.user is same as(task.createdBy) %}
  18. <a href="{{ path('app_task_update', {'slug': task.slug}) }}" class="btn btn-secondary">Modifier la tâche</a>
  19. <a href="{{ path('app_task_remove', {'slug': task.slug}) }}" target="_blank" class="btn btn-secondary">Supprimer la tâche</a>
  20. {% endif %}
  21. {% for transition in workflow_transitions(task) %}
  22. {% if not workflow_metadata(task, 'locking', task.status) or app.user is same as(task.lockedBy) %}
  23. <a href="{{ path(workflow_metadata(task, 'route', transition), {'slug': task.slug}) }}" class="btn btn-secondary">{{ workflow_metadata(task, 'title', transition) }}</a>
  24. {% endif %}
  25. {% endfor %}
  26. {% if workflow_metadata(task, 'locking', task.status) and app.user is same as(task.lockedBy) %}
  27. <div class="btn-group">
  28. <button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
  29. Télécharger la tâche
  30. </button>
  31. <ul class="dropdown-menu">
  32. <li><a class="dropdown-item" href="{{ path('app_task_geojson', {'slug': task.slug}) }}">.geojson</a></li>
  33. <li><a class="dropdown-item" href="{{ path('app_task_gpx', {'slug': task.slug}) }}">.gpx</a></li>
  34. </ul>
  35. </div>
  36. <button
  37. class="btn btn-secondary"
  38. type="button"
  39. data-controller="josm"
  40. data-action="click->josm#remoteControl"
  41. data-josm-imagery-value="{{ project.imagery is not empty ? project.imagery : 'osmfr' }}"
  42. data-josm-importurl-value="{{ url('app_task_osm', {'slug': task.slug}) }}"
  43. data-josm-layername-value="{{ task.name }}"
  44. data-josm-sendosm-value="{{ task.osm is not empty }}"
  45. data-josm-bottom-value="{{ bbox.miny }}" {# Minimum latitude 43.923196020314 #}
  46. data-josm-top-value="{{ bbox.maxy }}" {# Maximum latitude 43.94450663651 #}
  47. data-josm-left-value="{{ bbox.minx }}" {# Minimum longitude 4.3220213108728 #}
  48. data-josm-right-value="{{ bbox.maxx }}" {# Maximum longitude 4.37742111766 #}
  49. data-josm-comment-value="{{ project.name }} {{ task.name }}"
  50. data-josm-source-value="{{ project.source }}"
  51. data-josm-hashtags-value="{{ project.hashtags }}"
  52. >Télécommande JOSM</button>
  53. {% endif %}
  54. {% endif %}
  55. {% if nextTask %}
  56. <a href="{{ path('app_task_show', {'slug': nextTask.slug}) }}" class="btn btn-secondary">Tâche suivante</a>
  57. {% endif %}
  58. </div>
  59. </div>
  60. </div>
  61. <div class="row">
  62. <div class="col mb-3">
  63. <p class="text-muted">
  64. {% include 'partials/_task-metadata.html.twig' %}
  65. {% include 'partials/_task-locking.html.twig' %}
  66. </p>
  67. </div>
  68. </div>
  69. {% if task.description is not empty %}
  70. <h2 class="mb-3">Description</h2>
  71. <div class="row">
  72. <div class="col mb-3 lead">{{ task.description|markdown_to_html }}</div>
  73. </div>
  74. {% endif %}
  75. {% if workflow_metadata(task, 'locking', task.status) %}
  76. <div class="row">
  77. <div class="col mb-3">
  78. <table class="table table-bordered table-sm">
  79. <tbody>
  80. <tr>
  81. <th scope="row">Commentaire</th>
  82. <td>
  83. {{ project.name }} {{ task.name }}
  84. {% for hashtag in project.hashtags|split(' ') %}
  85. {{ '#' ~ hashtag }}
  86. {% endfor %}
  87. </td>
  88. </tr>
  89. <tr>
  90. <th scope="row">Source</th>
  91. <td>
  92. {{ project.source }}
  93. </td>
  94. </tr>
  95. </tbody>
  96. </table>
  97. </div>
  98. </div>
  99. {% endif %}
  100. <h2 class="mb-3">Carte</h2>
  101. <div class="row">
  102. <div class="col mb-3">
  103. {{ macro.map(task, task.project.overpassResult) }}
  104. </div>
  105. </div>
  106. {% if not (task.comments is empty or not is_granted('IS_AUTHENTICATED_FULLY')) %}
  107. <h2 class="mb-3">Commentaires</h2>
  108. {% endif %}
  109. {% if task.comments is not empty %}
  110. <div class="row">
  111. <div class="col mb-3">
  112. {% for comment in task.comments %}
  113. <blockquote class="blockquote">
  114. {{ comment.content|markdown_to_html }}
  115. </blockquote>
  116. <figcaption class="blockquote-footer">
  117. {% include 'partials/_comment-metadata.html.twig' %}
  118. </figcaption>
  119. {% endfor %}
  120. </div>
  121. </div>
  122. {% endif %}
  123. {% if is_granted('IS_AUTHENTICATED_FULLY') %}
  124. <div class="row">
  125. <div class="col mb-3">
  126. {{ form(commentForm) }}
  127. </div>
  128. </div>
  129. {% endif %}
  130. {% endblock %}