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.

165 lines
6.5 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-commands-value="{{ josmCommands|escape('html_attr') }}"
  42. >Télécommande JOSM</button>
  43. {% endif %}
  44. {% endif %}
  45. {% if nextTask %}
  46. <a href="{{ path('app_task_show', {'slug': nextTask.slug}) }}" class="btn btn-secondary">Tâche suivante</a>
  47. {% endif %}
  48. </div>
  49. </div>
  50. </div>
  51. <div class="row">
  52. <div class="col mb-3">
  53. <p class="text-muted">
  54. {% include 'partials/_task-metadata.html.twig' %}
  55. {% include 'partials/_task-locking.html.twig' %}
  56. </p>
  57. </div>
  58. </div>
  59. {% if task.description is not empty %}
  60. <h2 class="mb-3">Description</h2>
  61. <div class="row">
  62. <div class="col mb-3 lead">{{ task.description|markdown_to_html }}</div>
  63. </div>
  64. {% endif %}
  65. {% if task.status == 'doing' %}
  66. <div class="row">
  67. <div class="col mb-3">
  68. <table class="table table-bordered table-sm">
  69. <tbody>
  70. <tr>
  71. <th scope="row">Commentaire</th>
  72. <td>
  73. {{ project.name }} {{ task.name }}
  74. {% for hashtag in project.hashtags|split(' ') %}
  75. {{ '#' ~ hashtag }}
  76. {% endfor %}
  77. </td>
  78. </tr>
  79. <tr>
  80. <th scope="row">Source</th>
  81. <td>
  82. {{ project.source }}
  83. </td>
  84. </tr>
  85. </tbody>
  86. </table>
  87. </div>
  88. </div>
  89. {% endif %}
  90. {% if task.status == 'done' and task.changesetsResult is not empty %}
  91. <div class="row">
  92. <div class="col mb-3">
  93. <div class="accordion" id="changsetsAccordion">
  94. {% set changesets = task.changesetsResult|json_decode %}
  95. {% for changeset in changesets %}
  96. {% set collapseId = 'collapse' ~ loop.index %}
  97. <div class="accordion-item">
  98. <h2 class="accordion-header">
  99. <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="{{ '#' ~ collapseId }}" aria-expanded="false" aria-controls="{{ collapseId }}">
  100. {{ 'Groupe de modifications ' ~ changeset.id }}
  101. </button>
  102. </h2>
  103. <div id="{{ collapseId }}" class="accordion-collapse collapse" data-bs-parent="#changesetsAccordion">
  104. <div class="accordion-body">
  105. <p> Voir sur <a href="{{ 'https://www.openstreetmap.org/changeset/' ~ changeset.id }}" target="_blank">OSM</a> ou <a href="{{ 'https://osmcha.org/changesets/' ~ changeset.id }}" target="_blank">OSMCha</a></p>
  106. <table class="table table-bordered table-sm">
  107. <tbody>
  108. {% for key, value in changeset %}
  109. <tr>
  110. <th scope="row">{{ key }}</th>
  111. <td>{{ value }}</td>
  112. </tr>
  113. {% endfor %}
  114. </tbody>
  115. </table>
  116. </div>
  117. </div>
  118. </div>
  119. {% endfor %}
  120. </div>
  121. </div>
  122. </div>
  123. {% endif %}
  124. <h2 class="mb-3">Carte</h2>
  125. <div class="row">
  126. <div class="col mb-3">
  127. {{ macro.map(task, task.project.overpassResult) }}
  128. </div>
  129. </div>
  130. {% if not (task.comments is empty or not is_granted('IS_AUTHENTICATED_FULLY')) %}
  131. <h2 class="mb-3">Commentaires</h2>
  132. {% endif %}
  133. {% if task.comments is not empty %}
  134. <div class="row">
  135. <div class="col mb-3">
  136. {% for comment in task.comments %}
  137. <blockquote class="blockquote">
  138. {{ comment.content|markdown_to_html }}
  139. </blockquote>
  140. <figcaption class="blockquote-footer">
  141. {% include 'partials/_comment-metadata.html.twig' %}
  142. </figcaption>
  143. {% endfor %}
  144. </div>
  145. </div>
  146. {% endif %}
  147. {% if is_granted('IS_AUTHENTICATED_FULLY') %}
  148. <div class="row">
  149. <div class="col mb-3">
  150. {{ form(commentForm) }}
  151. </div>
  152. </div>
  153. {% endif %}
  154. {% endblock %}