|
|
- {% extends 'base.html.twig' %}
- {% import 'macro.html.twig' as macro %}
-
- {% block breadcrumb %}
- <li class="breadcrumb-item"><a href="{{ path('app_project') }}">Projets</a></li>
- <li class="breadcrumb-item"><a href="{{ path('app_project_show', {'slug': project.slug}) }}">{{ project.name }}</a></li>
- {% endblock %}
-
- {% block page_title %}
- {{ project.name }}
- {% for tag in project.tags %}
- <span class="badge text-bg-info ms-2">{{ tag.name }}</span>
- {% endfor %}
- {% endblock %}
-
- {% block page_content %}
- <div class="row">
- <div class="col mb-3">
- <div class="btn-group">
- <a href="{{ path('app_project') }}" class="btn btn-secondary">Revenir aux projets</a>
- {% if is_granted('IS_AUTHENTICATED_FULLY') %}
- {% if app.user is same as(project.createdBy) %}
- <a href="{{ path('app_project_update', {'slug': project.slug}) }}" class="btn btn-secondary">Modifier le projet</a>
- <a href="{{ path('app_project_remove', {'slug': project.slug}) }}" class="btn btn-secondary">Supprimer le projet</a>
- {% endif %}
- {% if project.overpassQuery %}
- <a href="{{ path('app_project_overpass', {'slug': project.slug}) }}" class="btn btn-secondary">Requêter Overpass</a>
- {% endif %}
- <button type="button" class="btn btn-secondary" data-bs-toggle="modal" data-bs-target="#modal">Importer des tâches</button>
- <a href="{{ path('app_task_csv', {'slug': project.slug}) }}" class="btn btn-secondary">Exporter les tâches</a>
- <a href="{{ path('app_task_create', {'slug': project.slug}) }}" class="btn btn-secondary">Créer une tâche</a>
- {% endif %}
- {% if randomTask %}
- <a href="{{ path('app_task_show', {'slug': randomTask.slug}) }}" class="btn btn-secondary">Piocher une tâche</a>
- {% endif %}
- </div>
- </div>
- </div>
-
- <div class="row">
- <div class="col mb-3">
- <p class="text-muted">{% include 'partials/_project-metadata.html.twig' %}</p>
- </div>
- </div>
-
- {% if project.description is not empty %}
- <div class="row">
- <div class="col mb-3 lead">{{ project.description|markdown_to_html }}</div>
- </div>
- {% endif %}
-
- {% if project.tasks is not empty %}
- <h2 class="mb-3">Carte</h2>
- <div class="row">
- <div class="col mb-3">
- {{ macro.map(project, project.overpassResult ? project.overpassResult : '') }}
- </div>
- </div>
- {% endif %}
-
- {% if project.tasks is not empty %}
- {% set dummy = tasks.setParam('_fragment', 'tasks') %}
- <h2 id="tasks" class="mb-3">Tâches</h2>
- <div class="row">
- <div class="col mb-3">
- <div class="progress-stacked">
- {% set stats = taskLifecycleManager.getProjectStats(project) %}
- {% for place, data in stats %}
- <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 ~ '%' }}">
- <div class="progress-bar {{ 'bg-' ~ data.color }}">{{ data.percentage|format_number({fraction_digit: 0}) ~ '%' }}</div>
- </div>
- {% endfor %}
- </div>
- </div>
- </div>
-
- <div class="row">
- <div class="col">
- <table class="table table-sm table-hover">
- <thead>
- <tr>
- <th scope="col">{{ macro.paginated(tasks, 'Nom', 't.name') }}</th>
- <th scope="col">{{ macro.paginated(tasks, 'État', 't.status') }}</th>
- <th scope="col">{{ macro.paginated(tasks, 'Importance', 't.important') }}</th>
- <th scope="col">{{ macro.paginated(tasks, 'Urgence', 't.urgent') }}</th>
- </tr>
- </thead>
- <tbody>
- {% for task in tasks %}
- <tr class="{{ 'table-' ~ workflow_metadata(task, 'color', task.status) }}">
- <td><a href="{{ path('app_task_show', {'slug': task.slug}) }}">{{ task.name }}</a></td>
- <td>{{ workflow_metadata(task, 'title', task.status) }}</td>
- <td>{{ task.important }}</td>
- <td>{{ task.urgent }}</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- </div>
- {% endif %}
-
- {% if comments is not empty %}
- <h2 class="mb-3">Commentaires</h2>
- <div class="row">
- <div class="col mb-3">
- {% for comment in comments %}
- <blockquote class="blockquote">
- {{ comment.content|markdown_to_html }}
- </blockquote>
- <figcaption class="blockquote-footer">
- {{ comment.task.name }}
- {% include 'partials/_comment-metadata.html.twig' %}
- </figcaption>
- {% endfor %}
- </div>
- </div>
- {% endif %}
- {% endblock %}
-
- {% block modals %}
- {{ form_start(csv_form) }}
- <div class="modal fade" id="modal" tabindex="-1" aria-labelledby="modalLabel" aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <h1 class="modal-title fs-5" id="modalLabel">Importer des tâches</h1>
- <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
- </div>
- <div class="modal-body">
- {{ form_row(csv_form.csv) }}
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Fermer</button>
- {{ form_widget(csv_form.submit) }}
- </div>
- </div>
- </div>
- </div>
- {{ form_end(csv_form) }}
- {% endblock %}
|