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\PasswordResetToken;
|
||||||
use App\Entity\Site;
|
use App\Entity\Site;
|
||||||
use App\Entity\Ville;
|
use App\Entity\Ville;
|
||||||
|
use App\Repository\EtatRepository;
|
||||||
use App\Repository\ParticipantRepository;
|
use App\Repository\ParticipantRepository;
|
||||||
use App\Repository\SiteRepository;
|
use App\Repository\SiteRepository;
|
||||||
use App\Repository\SortieRepository;
|
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');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,4 +22,4 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -16,7 +16,6 @@
|
|||||||
<table class="min-w-full bg-white divide-y divide-gray-200">
|
<table class="min-w-full bg-white divide-y divide-gray-200">
|
||||||
<thead class="bg-gray-50">
|
<thead class="bg-gray-50">
|
||||||
<tr>
|
<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">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">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>
|
<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">
|
<tbody class="divide-y divide-gray-200">
|
||||||
{% for sortie in sorties %}
|
{% for sortie in sorties %}
|
||||||
<tr>
|
<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.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.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.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.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.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.lieu.nom }}</td>
|
||||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ sortie.etat.libelle }}</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 sortie.etat.libelle != 'Annulée' and sortie.etat.libelle != 'Terminée' %}
|
||||||
{# {% if not sortie.etat %}
|
<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>
|
||||||
{% endif %}
|
</td>
|
||||||
<a href="{{ path('app_adminUserDisable', {'id': participant.idParticipant}) }}" class="items-centerp pr-4">
|
{% endif %}
|
||||||
<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> #}
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
{% else %}
|
{% else %}
|
||||||
<tr>
|
<tr>
|
||||||
@@ -63,7 +55,6 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<footer class="w-full bg-green-700 text-white py-4">
|
<footer class="w-full bg-green-700 text-white py-4">
|
||||||
<div class="flex justify-center">
|
<div class="flex justify-center">
|
||||||
git s ENI © Sortie {{ "now"|date("Y") }}
|
ENI © Sortie {{ "now"|date("Y") }}
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="container mx-auto p-6 bg-gray-50 rounded-lg shadow-lg mt-6">
|
<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="grid grid-cols-1 lg:grid-cols-12 gap-8">
|
||||||
<div class="lg:col-span-7 bg-white rounded-lg shadow p-6">
|
<div class="lg:col-span-7 bg-white rounded-lg shadow p-6">
|
||||||
@@ -129,11 +129,21 @@
|
|||||||
<script>
|
<script>
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
const map = L.map('map').setView([{{ sortie.lieu.latitude }}, {{ sortie.lieu.longitude }}], 15);
|
const map = L.map('map').setView([{{ sortie.lieu.latitude }}, {{ sortie.lieu.longitude }}], 15);
|
||||||
|
|
||||||
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||||
maxZoom: 19,
|
maxZoom: 19,
|
||||||
}).addTo(map);
|
}).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 }}")
|
.bindPopup("{{ sortie.lieu.nom }}")
|
||||||
.openPopup();
|
.openPopup();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user