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.
 
 
 

165 lines
6.5 KiB

{% 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>
<li class="breadcrumb-item"><a href="{{ path('app_task_show', {'slug': task.slug}) }}">{{ task.name }}</a></li>
{% endblock %}
{% block page_title %}
{% include 'partials/_task-title.html.twig' %}
{% endblock %}
{% block page_content %}
<div class="row">
<div class="col mb-3">
<div class="btn-group">
<a href="{{ path('app_project_show', {'slug': project.slug}) }}" class="btn btn-secondary">Revenir au projet</a>
{% if is_granted('IS_AUTHENTICATED_FULLY') %}
{% if app.user is same as(task.createdBy) %}
<a href="{{ path('app_task_update', {'slug': task.slug}) }}" class="btn btn-secondary">Modifier la tâche</a>
<a href="{{ path('app_task_remove', {'slug': task.slug}) }}" target="_blank" class="btn btn-secondary">Supprimer la tâche</a>
{% endif %}
{% for transition in workflow_transitions(task) %}
{% if not workflow_metadata(task, 'locking', task.status) or app.user is same as(task.lockedBy) %}
<a href="{{ path(workflow_metadata(task, 'route', transition), {'slug': task.slug}) }}" class="btn btn-secondary">{{ workflow_metadata(task, 'title', transition) }}</a>
{% endif %}
{% endfor %}
{% if workflow_metadata(task, 'locking', task.status) and app.user is same as(task.lockedBy) %}
<div class="btn-group">
<button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
Télécharger la tâche
</button>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="{{ path('app_task_geojson', {'slug': task.slug}) }}">.geojson</a></li>
<li><a class="dropdown-item" href="{{ path('app_task_gpx', {'slug': task.slug}) }}">.gpx</a></li>
</ul>
</div>
<button
class="btn btn-secondary"
type="button"
data-controller="josm"
data-action="click->josm#remoteControl"
data-josm-commands-value="{{ josmCommands|escape('html_attr') }}"
>Télécommande JOSM</button>
{% endif %}
{% endif %}
{% if nextTask %}
<a href="{{ path('app_task_show', {'slug': nextTask.slug}) }}" class="btn btn-secondary">Tâche suivante</a>
{% endif %}
</div>
</div>
</div>
<div class="row">
<div class="col mb-3">
<p class="text-muted">
{% include 'partials/_task-metadata.html.twig' %}
{% include 'partials/_task-locking.html.twig' %}
</p>
</div>
</div>
{% if task.description is not empty %}
<h2 class="mb-3">Description</h2>
<div class="row">
<div class="col mb-3 lead">{{ task.description|markdown_to_html }}</div>
</div>
{% endif %}
{% if task.status == 'doing' %}
<div class="row">
<div class="col mb-3">
<table class="table table-bordered table-sm">
<tbody>
<tr>
<th scope="row">Commentaire</th>
<td>
{{ project.name }} {{ task.name }}
{% for hashtag in project.hashtags|split(' ') %}
{{ '#' ~ hashtag }}
{% endfor %}
</td>
</tr>
<tr>
<th scope="row">Source</th>
<td>
{{ project.source }}
</td>
</tr>
</tbody>
</table>
</div>
</div>
{% endif %}
{% if task.status == 'done' and task.changesetsResult is not empty %}
<div class="row">
<div class="col mb-3">
<div class="accordion" id="changsetsAccordion">
{% set changesets = task.changesetsResult|json_decode %}
{% for changeset in changesets %}
{% set collapseId = 'collapse' ~ loop.index %}
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="{{ '#' ~ collapseId }}" aria-expanded="false" aria-controls="{{ collapseId }}">
{{ 'Groupe de modifications ' ~ changeset.id }}
</button>
</h2>
<div id="{{ collapseId }}" class="accordion-collapse collapse" data-bs-parent="#changesetsAccordion">
<div class="accordion-body">
<p> Voir sur <a href="{{ 'https://www.openstreetmap.org/changeset/' ~ changeset.id }}" target="_blank">OSM</a> ou <a href="{{ 'https://osmcha.org/changesets/' ~ changeset.id }}" target="_blank">OSMCha</a></p>
<table class="table table-bordered table-sm">
<tbody>
{% for key, value in changeset %}
<tr>
<th scope="row">{{ key }}</th>
<td>{{ value }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
{% endif %}
<h2 class="mb-3">Carte</h2>
<div class="row">
<div class="col mb-3">
{{ macro.map(task, task.project.overpassResult) }}
</div>
</div>
{% if not (task.comments is empty or not is_granted('IS_AUTHENTICATED_FULLY')) %}
<h2 class="mb-3">Commentaires</h2>
{% endif %}
{% if task.comments is not empty %}
<div class="row">
<div class="col mb-3">
{% for comment in task.comments %}
<blockquote class="blockquote">
{{ comment.content|markdown_to_html }}
</blockquote>
<figcaption class="blockquote-footer">
{% include 'partials/_comment-metadata.html.twig' %}
</figcaption>
{% endfor %}
</div>
</div>
{% endif %}
{% if is_granted('IS_AUTHENTICATED_FULLY') %}
<div class="row">
<div class="col mb-3">
{{ form(commentForm) }}
</div>
</div>
{% endif %}
{% endblock %}