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.

140 lines
5.4 KiB

2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 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_create', {'slug': project.slug}) }}" class="btn btn-secondary">Créer une tâche</a>
  28. {% endif %}
  29. {% if randomTask %}
  30. <a href="{{ path('app_task_show', {'slug': randomTask.slug}) }}" class="btn btn-secondary">Piocher une tâche</a>
  31. {% endif %}
  32. </div>
  33. </div>
  34. </div>
  35. <div class="row">
  36. <div class="col mb-3">
  37. <p class="text-muted">{% include 'partials/_project-metadata.html.twig' %}</p>
  38. </div>
  39. </div>
  40. {% if project.description is not empty %}
  41. <div class="row">
  42. <div class="col mb-3 lead">{{ project.description|markdown_to_html }}</div>
  43. </div>
  44. {% endif %}
  45. {% if project.tasks is not empty %}
  46. <h2 class="mb-3">Carte</h2>
  47. <div class="row">
  48. <div class="col mb-3">
  49. {{ macro.map(project, project.overpassResult ? project.overpassResult : '') }}
  50. </div>
  51. </div>
  52. {% endif %}
  53. {% if project.tasks is not empty %}
  54. {% set dummy = tasks.setParam('_fragment', 'tasks') %}
  55. <h2 id="tasks" class="mb-3">Tâches</h2>
  56. <div class="row">
  57. <div class="col mb-3">
  58. <div class="progress-stacked">
  59. {% set stats = taskLifecycleManager.getProjectStats(project) %}
  60. {% for place, data in stats %}
  61. <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 ~ '%' }}">
  62. <div class="progress-bar {{ 'bg-' ~ data.color }}">{{ data.percentage|format_number({fraction_digit: 0}) ~ '%' }}</div>
  63. </div>
  64. {% endfor %}
  65. </div>
  66. </div>
  67. </div>
  68. <div class="row">
  69. <div class="col">
  70. <table class="table table-sm table-hover">
  71. <thead>
  72. <tr>
  73. <th scope="col">{{ macro.paginated(tasks, 'Nom', 't.name') }}</th>
  74. <th scope="col">{{ macro.paginated(tasks, 'État', 't.status') }}</th>
  75. <th scope="col">{{ macro.paginated(tasks, 'Importance', 't.important') }}</th>
  76. <th scope="col">{{ macro.paginated(tasks, 'Urgence', 't.urgent') }}</th>
  77. </tr>
  78. </thead>
  79. <tbody>
  80. {% for task in tasks %}
  81. <tr class="{{ 'table-' ~ workflow_metadata(task, 'color', task.status) }}">
  82. <td><a href="{{ path('app_task_show', {'slug': task.slug}) }}">{{ task.name }}</a></td>
  83. <td>{{ workflow_metadata(task, 'title', task.status) }}</td>
  84. <td>{{ task.important }}</td>
  85. <td>{{ task.urgent }}</td>
  86. </tr>
  87. {% endfor %}
  88. </tbody>
  89. </table>
  90. </div>
  91. </div>
  92. {% endif %}
  93. {% if comments is not empty %}
  94. <h2 class="mb-3">Commentaires</h2>
  95. <div class="row">
  96. <div class="col mb-3">
  97. {% for comment in comments %}
  98. <blockquote class="blockquote">
  99. {{ comment.content|markdown_to_html }}
  100. </blockquote>
  101. <figcaption class="blockquote-footer">
  102. {{ comment.task.name }}
  103. {% include 'partials/_comment-metadata.html.twig' %}
  104. </figcaption>
  105. {% endfor %}
  106. </div>
  107. </div>
  108. {% endif %}
  109. {% endblock %}
  110. {% block modals %}
  111. {{ form_start(csv_form) }}
  112. <div class="modal fade" id="modal" tabindex="-1" aria-labelledby="modalLabel" aria-hidden="true">
  113. <div class="modal-dialog">
  114. <div class="modal-content">
  115. <div class="modal-header">
  116. <h1 class="modal-title fs-5" id="modalLabel">Importer des tâches</h1>
  117. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  118. </div>
  119. <div class="modal-body">
  120. {{ form_row(csv_form.csv) }}
  121. </div>
  122. <div class="modal-footer">
  123. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Fermer</button>
  124. {{ form_widget(csv_form.submit) }}
  125. </div>
  126. </div>
  127. </div>
  128. </div>
  129. {{ form_end(csv_form) }}
  130. {% endblock %}