Merge branch 'Johan'
This commit is contained in:
BIN
public/img/pointeur.png
Normal file
BIN
public/img/pointeur.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 186 KiB |
@@ -6,6 +6,7 @@ use App\Entity\Participant;
|
||||
use App\Entity\PasswordResetToken;
|
||||
use App\Entity\Site;
|
||||
use App\Entity\Ville;
|
||||
use App\Repository\EtatRepository;
|
||||
use App\Repository\ParticipantRepository;
|
||||
use App\Repository\SiteRepository;
|
||||
use App\Repository\SortieRepository;
|
||||
@@ -400,4 +401,17 @@ class AdminController extends AbstractController
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/admin/sortie/annuler/{id}', name: 'app_adminSortieAnnuler')]
|
||||
public function sortieAnuler(String $id, EntityManagerInterface $entityManager,
|
||||
SortieRepository $sortieRepository, EtatRepository $etatRepository): Response
|
||||
{
|
||||
$etat = $etatRepository->findOneBy(["libelle" => "Annulée"]);
|
||||
$sortie = $sortieRepository->find($id);
|
||||
$sortie->setEtat($etat);
|
||||
$entityManager->persist($sortie);
|
||||
$entityManager->flush();
|
||||
$this->addFlash('success', "La sortie a bien été annuler");
|
||||
return $this->redirectToRoute('app_adminSortie');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
<table class="min-w-full bg-white divide-y divide-gray-200">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"><input type="checkbox" id="selectAll" /></th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Nom</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Date début</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">durée</th>
|
||||
@@ -32,27 +31,20 @@
|
||||
<tbody class="divide-y divide-gray-200">
|
||||
{% for sortie in sorties %}
|
||||
<tr>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900"><span><input type="checkbox" value="{{ sortie.idSortie }}" name="userList[]"></span></td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ sortie.nom }}</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ sortie.dateHeureDebut }}</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ sortie.dateHeureDebut|date('d/m/Y H:i') }}</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ sortie.duree }}</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ sortie.dateLimiteInscription }}</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ sortie.dateLimiteInscription|date('d/m/Y H:i') }}</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ sortie.nbInscriptionsMax }}</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ sortie.organisateur.pseudo }}</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ sortie.site.nom }}</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ sortie.lieu.nom }}</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ sortie.etat.libelle }}</td>
|
||||
<td class="flex flex-row px-6 py-4 whitespace-nowrap items-center font-medium">
|
||||
{# {% if not sortie.etat %}
|
||||
|
||||
{% endif %}
|
||||
<a href="{{ path('app_adminUserDisable', {'id': participant.idParticipant}) }}" class="items-centerp pr-4">
|
||||
<img src="{{ participant.actif ? asset('img/user-able.svg') : asset('img/user-disable.svg') }}" alt="Logo" height="32px" width="32px">
|
||||
</a>
|
||||
<a href="{{ path('app_adminUserDelete', {'id': participant.idParticipant}) }}" class="items-center">
|
||||
<img src="{{ asset('img/user-delete.svg') }}" alt="Logo" height="32px" width="32px">
|
||||
</a> #}
|
||||
{% if sortie.etat.libelle != 'Annulée' and sortie.etat.libelle != 'Terminée' %}
|
||||
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
||||
<a href="{{ path('app_adminSortieAnnuler', {'id': sortie.idSortie}) }}" class="text-red-600 hover:text-red-900 ml-4">Annuler</a>
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
@@ -63,7 +55,6 @@
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,5 +1,5 @@
|
||||
<footer class="w-full bg-green-700 text-white py-4">
|
||||
<div class="flex justify-center">
|
||||
git s ENI © Sortie {{ "now"|date("Y") }}
|
||||
ENI © Sortie {{ "now"|date("Y") }}
|
||||
</div>
|
||||
</footer>
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
{% block content %}
|
||||
<div class="container mx-auto p-6 bg-gray-50 rounded-lg shadow-lg mt-6">
|
||||
<h1 class="text-4xl font-bold text-center text-gray-800 mb-8">🎉 Détails de la sortie</h1>
|
||||
<h1 class="text-4xl font-bold text-center text-gray-800 mb-8">🎉 {{ sortie.nom }} 🎉</h1>
|
||||
|
||||
<div class="grid grid-cols-1 lg:grid-cols-12 gap-8">
|
||||
<div class="lg:col-span-7 bg-white rounded-lg shadow p-6">
|
||||
@@ -129,11 +129,21 @@
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const map = L.map('map').setView([{{ sortie.lieu.latitude }}, {{ sortie.lieu.longitude }}], 15);
|
||||
|
||||
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||
maxZoom: 19,
|
||||
}).addTo(map);
|
||||
|
||||
L.marker([{{ sortie.lieu.latitude }}, {{ sortie.lieu.longitude }}]).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
|
||||
});
|
||||
|
||||
// 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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user