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.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
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. {% endblock %}
  7. {% block page_title %}
  8. {{ project.name }}
  9. {% for tag in project.tags %}
  10. <span class="badge text-bg-info ms-2">{{ tag.name }}</span>
  11. {% endfor %}
  12. {% endblock %}
  13. {% block page_content %}
  14. <div class="row">
  15. <div class="col mb-3">
  16. <div class="btn-group">
  17. <a href="{{ path('app_project') }}" class="btn btn-secondary">Revenir aux projets</a>
  18. {% if is_granted('IS_AUTHENTICATED_FULLY') %}
  19. {% if app.user is same as(project.createdBy) %}
  20. <a href="{{ path('app_project_update', {'slug': project.slug}) }}" class="btn btn-secondary">Modifier le projet</a>
  21. <a href="{{ path('app_project_remove', {'slug': project.slug}) }}" class="btn btn-secondary">Supprimer le projet</a>
  22. {% endif %}
  23. {% if project.overpassQuery %}
  24. <a href="{{ path('app_project_overpass', {'slug': project.slug}) }}" class="btn btn-secondary">Requêter Overpass</a>
  25. {% endif %}
  26. <button type="button" class="btn btn-secondary" data-bs-toggle="modal" data-bs-target="#modal">Importer des tâches</button>
  27. <a href="{{ path('app_task_csv', {'slug': project.slug}) }}" class="btn btn-secondary">Exporter les tâches</a>
  28. <a href="{{ path('app_task_create', {'slug': project.slug}) }}" class="btn btn-secondary">Créer une tâche</a>
  29. {% endif %}
  30. {% if randomTask %}
  31. <a href="{{ path('app_task_show', {'slug': randomTask.slug}) }}" class="btn btn-secondary">Piocher une tâche</a>
  32. {% endif %}
  33. </div>
  34. </div>
  35. </div>
  36. <div class="row">
  37. <div class="col mb-3">
  38. <p class="text-muted">{% include 'partials/_project-metadata.html.twig' %}</p>
  39. </div>
  40. </div>
  41. {% if project.description is not empty %}
  42. <div class="row">
  43. <div class="col mb-3 lead">{{ project.description|markdown_to_html }}</div>
  44. </div>
  45. {% endif %}
  46. {% if project.tasks is not empty %}
  47. <h2 class="mb-3">Carte</h2>
  48. <div class="row">
  49. <div class="col mb-3">
  50. {{ macro.map(project, project.overpassResult ? project.overpassResult : '') }}
  51. </div>
  52. </div>
  53. {% endif %}
  54. {% if project.tasks is not empty %}
  55. {% set dummy = tasks.setParam('_fragment', 'tasks') %}
  56. <h2 id="tasks" class="mb-3">Tâches</h2>
  57. <div class="row">
  58. <div class="col mb-3">
  59. <div class="progress-stacked">
  60. {% set stats = taskLifecycleManager.getProjectStats(project) %}
  61. {% for place, data in stats %}
  62. <div class="progress" role="progressbar" data-bs-toggle="tooltip" data-bs-title="{{ data.title }} {{ data.value ~ '/' ~ data.max }}" aria-label="{{ data.title }}" aria-valuenow="{{ data.value }}" aria-valuemin="0" aria-valuemax="{{ data.max }}" style="width:{{ data.percentage ~ '%' }}">
  63. <div class="progress-bar {{ 'bg-' ~ data.color }}">{{ data.percentage|format_number({fraction_digit: 0}) ~ '%' }}</div>
  64. </div>
  65. {% endfor %}
  66. </div>
  67. </div>
  68. </div>
  69. <div class="row">
  70. <div class="col">
  71. <table class="table table-sm table-hover">
  72. <thead>
  73. <tr>
  74. <th scope="col">{{ macro.paginated(tasks, 'Nom', 't.name') }}</th>
  75. <th scope="col">{{ macro.paginated(tasks, 'État', 't.status') }}</th>
  76. <th scope="col">{{ macro.paginated(tasks, 'Importance', 't.important') }}</th>
  77. <th scope="col">{{ macro.paginated(tasks, 'Urgence', 't.urgent') }}</th>
  78. </tr>
  79. </thead>
  80. <tbody>
  81. {% for task in tasks %}
  82. <tr class="{{ 'table-' ~ workflow_metadata(task, 'color', task.status) }}">
  83. <td><a href="{{ path('app_task_show', {'slug': task.slug}) }}">{{ task.name }}</a></td>
  84. <td>{{ workflow_metadata(task, 'title', task.status) }}</td>
  85. <td>{{ task.important }}</td>
  86. <td>{{ task.urgent }}</td>
  87. </tr>
  88. {% endfor %}
  89. </tbody>
  90. </table>
  91. </div>
  92. </div>
  93. {% endif %}
  94. {% if comments is not empty %}
  95. <h2 class="mb-3">Commentaires</h2>
  96. <div class="row">
  97. <div class="col mb-3">
  98. {% for comment in comments %}
  99. <blockquote class="blockquote">
  100. {{ comment.content|markdown_to_html }}
  101. </blockquote>
  102. <figcaption class="blockquote-footer">
  103. {{ comment.task.name }}
  104. {% include 'partials/_comment-metadata.html.twig' %}
  105. </figcaption>
  106. {% endfor %}
  107. </div>
  108. </div>
  109. {% endif %}
  110. {% endblock %}
  111. {% block modals %}
  112. {{ form_start(csv_form) }}
  113. <div class="modal fade" id="modal" tabindex="-1" aria-labelledby="modalLabel" aria-hidden="true">
  114. <div class="modal-dialog">
  115. <div class="modal-content">
  116. <div class="modal-header">
  117. <h1 class="modal-title fs-5" id="modalLabel">Importer des tâches</h1>
  118. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  119. </div>
  120. <div class="modal-body">
  121. {{ form_row(csv_form.csv) }}
  122. </div>
  123. <div class="modal-footer">
  124. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Fermer</button>
  125. {{ form_widget(csv_form.submit) }}
  126. </div>
  127. </div>
  128. </div>
  129. </div>
  130. {{ form_end(csv_form) }}
  131. {% endblock %}