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.

115 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
  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. <h2 class="mb-3">Carte</h2>
  76. <div class="row">
  77. <div class="col mb-3">
  78. {{ macro.map(task) }}
  79. </div>
  80. </div>
  81. {% if not (task.comments is empty or not is_granted('IS_AUTHENTICATED_FULLY')) %}
  82. <h2 class="mb-3">Commentaires</h2>
  83. {% endif %}
  84. {% if task.comments is not empty %}
  85. <div class="row">
  86. <div class="col mb-3">
  87. {% for comment in task.comments %}
  88. <blockquote class="blockquote">
  89. {{ comment.content|markdown_to_html }}
  90. </blockquote>
  91. <figcaption class="blockquote-footer">
  92. {% include 'partials/_comment-metadata.html.twig' %}
  93. </figcaption>
  94. {% endfor %}
  95. </div>
  96. </div>
  97. {% endif %}
  98. {% if is_granted('IS_AUTHENTICATED_FULLY') %}
  99. <div class="row">
  100. <div class="col mb-3">
  101. {{ form(commentForm) }}
  102. </div>
  103. </div>
  104. {% endif %}
  105. {% endblock %}