set admin user

This commit is contained in:
jleroy2023
2024-11-20 10:40:08 +01:00
parent caa78c634b
commit 74f6db8a80
9 changed files with 273 additions and 26 deletions

View File

@@ -29,9 +29,16 @@
Importer CSV
</button>
</form>
<a href="{{ path('participant_export') }}" class="bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600">
Exporter CSV
</a>
<button
id="openModal"
class="bg-green-600 text-white px-4 py-2 rounded hover:bg-green-700">
Ajouter un utilisateur
</button>
<button
type="submit"
class="bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600">
<a href="{{ path('participant_export') }}">Exporter CSV</a>
</button>
</div>
<!-- Participants Table -->
@@ -83,5 +90,52 @@
</table>
</div>
</div>
<!-- Modale pour ajouter une ville -->
<div id="userModal" class="fixed inset-0 z-50 hidden bg-gray-900 bg-opacity-50">
<div class="flex justify-center items-center min-h-screen">
<div class="bg-white p-6 rounded shadow-md w-1/3">
<h2 class="text-xl font-semibold mb-4">Ajouter un utilisateur</h2>
<form id="addUserForm" method="POST" action="{{ path('app_adminUserAdd') }}">
<div class="mb-4">
<label for="nom" class="block text-sm font-medium text-gray-700">Nom</label>
<input id="nom" name="nom" type="text" class="mt-1 block w-full px-4 py-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
<div class="mb-4">
<label for="prenom" class="block text-sm font-medium text-gray-700">Prénom</label>
<input id="prenom" name="prenom" type="text" class="mt-1 block w-full px-4 py-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
<div class="mb-4">
<label for="pseudo" class="block text-sm font-medium text-gray-700">Pseudo *</label>
<input id="pseudo" name="pseudo" type="text" class="mt-1 block w-full px-4 py-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500" required>
</div>
<div class="mb-4">
<label for="phone" class="block text-sm font-medium text-gray-700">téléphone</label>
<input id="phone" name="phone" type="text" class="mt-1 block w-full px-4 py-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
<div class="mb-4">
<label for="mail" class="block text-sm font-medium text-gray-700">Email *</label>
<input id="mail" name="mail" type="text" class="mt-1 block w-full px-4 py-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500" required>
</div>
<p>* Champ obligatoire</p>
<div class="flex justify-end">
<button type="submit" class="bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-700">Ajouter</button>
<button type="button" id="closeModal" class="ml-2 bg-gray-500 text-white px-4 py-2 rounded hover:bg-gray-700">Annuler</button>
</div>
</form>
</div>
</div>
</div>
<script>
// Ouvrir la modale manuellement
document.getElementById('openModal').addEventListener('click', function() {
document.getElementById('userModal').classList.remove('hidden');
});
// Fermer la modale
document.getElementById('closeModal').addEventListener('click', function() {
document.getElementById('userModal').classList.add('hidden');
});
</script>
</div>
{% endblock %}