conflict resolved
This commit is contained in:
@@ -7,6 +7,11 @@
|
||||
{% block stylesheets %}
|
||||
{{ encore_entry_link_tags('app') }}
|
||||
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" />
|
||||
<style>
|
||||
#delete-modal {
|
||||
z-index: 1050;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
</head>
|
||||
{% endblock %}
|
||||
@@ -88,8 +93,14 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if app.user and app.user.idParticipant == sortie.organisateur.idParticipant %}
|
||||
<div class="mt-6 flex justify-end">
|
||||
{% if app.user and app.user.idParticipant == sortie.organisateur.idParticipant and sortie.etat.libelle == 'Créée' %}
|
||||
<div class="mt-6 flex justify-end space-x-4">
|
||||
<button
|
||||
type="button"
|
||||
id="open-delete-modal"
|
||||
class="px-6 py-3 bg-red-500 text-white rounded-md shadow hover:bg-red-600">
|
||||
❌ Annuler la sortie
|
||||
</button>
|
||||
<a href="{{ path('sortie_edit', { id: sortie.idSortie }) }}"
|
||||
class="px-6 py-3 bg-yellow-500 text-white rounded-md shadow hover:bg-yellow-600">
|
||||
✏️ Modifier la sortie
|
||||
@@ -112,6 +123,37 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modale pour annuler la sortie -->
|
||||
<div id="delete-modal" class="fixed inset-0 flex items-center justify-center bg-gray-800 bg-opacity-50 hidden">
|
||||
<div class="bg-white p-6 rounded-lg shadow-lg w-full max-w-lg">
|
||||
<h2 class="text-xl font-bold mb-4">Annuler la sortie</h2>
|
||||
<form action="{{ path('sortie_cancel', { id: sortie.idSortie }) }}" method="post">
|
||||
<div class="mb-4">
|
||||
<label for="motif" class="block text-sm font-medium text-gray-700">Motif d'annulation :</label>
|
||||
<textarea
|
||||
name="motif"
|
||||
id="motif"
|
||||
rows="4"
|
||||
class="block w-full mt-1 p-2 border border-gray-300 rounded-md shadow-sm focus:ring-red-500 focus:border-red-500"
|
||||
required></textarea>
|
||||
</div>
|
||||
<div class="flex justify-end space-x-4">
|
||||
<button
|
||||
type="button"
|
||||
id="cancel-modal"
|
||||
class="px-4 py-2 bg-gray-500 text-white rounded-md hover:bg-gray-600">
|
||||
Annuler
|
||||
</button>
|
||||
<button
|
||||
type="submit"
|
||||
class="px-4 py-2 bg-red-500 text-white rounded-md hover:bg-red-600">
|
||||
Confirmer l'annulation
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-center mt-8">
|
||||
<a href="{{ path('home') }}" class="px-6 py-3 bg-blue-500 text-white rounded-md shadow hover:bg-blue-600">
|
||||
🔙 Retour à l'accueil
|
||||
@@ -130,18 +172,28 @@
|
||||
maxZoom: 19,
|
||||
}).addTo(map);
|
||||
|
||||
// Définir l'icône personnalisée avec une taille plus grande
|
||||
const customIcon = L.icon({
|
||||
iconUrl: '/img/pointeur.png', // Chemin de l'image
|
||||
iconSize: [100, 100], // Taille ajustée [largeur, hauteur]
|
||||
iconAnchor: [50, 100], // Point correspondant à la base de l'icône [x, y]
|
||||
popupAnchor: [0, -100], // Position du popup par rapport à l'icône
|
||||
iconUrl: '/img/pointeur.png',
|
||||
iconSize: [100, 100],
|
||||
iconAnchor: [50, 100],
|
||||
popupAnchor: [0, -100],
|
||||
});
|
||||
|
||||
// Ajouter un marqueur avec l'icône personnalisée
|
||||
L.marker([{{ sortie.lieu.latitude }}, {{ sortie.lieu.longitude }}], { icon: customIcon }).addTo(map)
|
||||
.bindPopup("{{ sortie.lieu.nom }}")
|
||||
.openPopup();
|
||||
|
||||
const openModalButton = document.getElementById('open-delete-modal');
|
||||
const cancelModalButton = document.getElementById('cancel-modal');
|
||||
const deleteModal = document.getElementById('delete-modal');
|
||||
|
||||
openModalButton?.addEventListener('click', () => {
|
||||
deleteModal.classList.remove('hidden');
|
||||
});
|
||||
|
||||
cancelModalButton?.addEventListener('click', () => {
|
||||
deleteModal.classList.add('hidden');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user