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.
 
 
 

115 lines
4.8 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-imagery-value="{{ project.imagery is not empty ? project.imagery : 'osmfr' }}"
data-josm-importurl-value="{{ url('app_task_osm', {'slug': task.slug}) }}"
data-josm-layername-value="{{ task.name }}"
data-josm-sendosm-value="{{ task.osm is not empty }}"
data-josm-bottom-value="{{ bbox.miny }}" {# Minimum latitude 43.923196020314 #}
data-josm-top-value="{{ bbox.maxy }}" {# Maximum latitude 43.94450663651 #}
data-josm-left-value="{{ bbox.minx }}" {# Minimum longitude 4.3220213108728 #}
data-josm-right-value="{{ bbox.maxx }}" {# Maximum longitude 4.37742111766 #}
data-josm-comment-value="{{ project.name }} {{ task.name }}"
data-josm-source-value="{{ project.source }}"
data-josm-hashtags-value="{{ project.hashtags }}"
>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 %}
<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 %}