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.

162 lines
6.4 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. {{ macro.clipboard(sourceGenerator.generate(task)) }}
  74. </td>
  75. </tr>
  76. <tr>
  77. <th scope="row">Source</th>
  78. <td>
  79. {{ macro.clipboard(project.source) }}
  80. </td>
  81. </tr>
  82. </tbody>
  83. </table>
  84. </div>
  85. </div>
  86. {% endif %}
  87. {% if task.status == 'done' and task.changesetsResult is not empty %}
  88. <div class="row">
  89. <div class="col mb-3">
  90. <div class="accordion" id="changsetsAccordion">
  91. {% set changesets = task.changesetsResult|json_decode %}
  92. {% for changeset in changesets %}
  93. {% set collapseId = 'collapse' ~ loop.index %}
  94. <div class="accordion-item">
  95. <h2 class="accordion-header">
  96. <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="{{ '#' ~ collapseId }}" aria-expanded="false" aria-controls="{{ collapseId }}">
  97. {{ 'Groupe de modifications ' ~ changeset.id }}
  98. </button>
  99. </h2>
  100. <div id="{{ collapseId }}" class="accordion-collapse collapse" data-bs-parent="#changesetsAccordion">
  101. <div class="accordion-body">
  102. <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>
  103. <table class="table table-bordered table-sm">
  104. <tbody>
  105. {% for key, value in changeset %}
  106. <tr>
  107. <th scope="row">{{ key }}</th>
  108. <td>{{ value }}</td>
  109. </tr>
  110. {% endfor %}
  111. </tbody>
  112. </table>
  113. </div>
  114. </div>
  115. </div>
  116. {% endfor %}
  117. </div>
  118. </div>
  119. </div>
  120. {% endif %}
  121. <h2 class="mb-3">Carte</h2>
  122. <div class="row">
  123. <div class="col mb-3">
  124. {{ macro.map(task, task.project.overpassResult) }}
  125. </div>
  126. </div>
  127. {% if not (task.comments is empty or not is_granted('IS_AUTHENTICATED_FULLY')) %}
  128. <h2 class="mb-3">Commentaires</h2>
  129. {% endif %}
  130. {% if task.comments is not empty %}
  131. <div class="row">
  132. <div class="col mb-3">
  133. {% for comment in task.comments %}
  134. <blockquote class="blockquote">
  135. {{ comment.content|markdown_to_html }}
  136. </blockquote>
  137. <figcaption class="blockquote-footer">
  138. {% include 'partials/_comment-metadata.html.twig' %}
  139. </figcaption>
  140. {% endfor %}
  141. </div>
  142. </div>
  143. {% endif %}
  144. {% if is_granted('IS_AUTHENTICATED_FULLY') %}
  145. <div class="row">
  146. <div class="col mb-3">
  147. {{ form(commentForm) }}
  148. </div>
  149. </div>
  150. {% endif %}
  151. {% endblock %}