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.

130 lines
4.8 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 workflow_metadata(task, 'locking', task.status) %}
  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. <h2 class="mb-3">Carte</h2>
  91. <div class="row">
  92. <div class="col mb-3">
  93. {{ macro.map(task, task.project.overpassResult) }}
  94. </div>
  95. </div>
  96. {% if not (task.comments is empty or not is_granted('IS_AUTHENTICATED_FULLY')) %}
  97. <h2 class="mb-3">Commentaires</h2>
  98. {% endif %}
  99. {% if task.comments is not empty %}
  100. <div class="row">
  101. <div class="col mb-3">
  102. {% for comment in task.comments %}
  103. <blockquote class="blockquote">
  104. {{ comment.content|markdown_to_html }}
  105. </blockquote>
  106. <figcaption class="blockquote-footer">
  107. {% include 'partials/_comment-metadata.html.twig' %}
  108. </figcaption>
  109. {% endfor %}
  110. </div>
  111. </div>
  112. {% endif %}
  113. {% if is_granted('IS_AUTHENTICATED_FULLY') %}
  114. <div class="row">
  115. <div class="col mb-3">
  116. {{ form(commentForm) }}
  117. </div>
  118. </div>
  119. {% endif %}
  120. {% endblock %}