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.

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