Files
ENI-sortir/templates/main/dashboard.html.twig
Olivier PARPAILLON 266a338b24 link fix
2024-11-26 16:30:10 +01:00

133 lines
8.6 KiB
Twig

{% extends 'main/base.html.twig' %}
{% block head %}
<head>
<meta charset="UTF-8">
{% block title %}&#128227; Sortie.com {{ profile.pseudo }} &#128266;{% endblock %}
{% block stylesheets %}
{{ encore_entry_link_tags('app') }}
{% endblock %}
</head>
{% endblock %}
{% block content %}
<h3 class="text-center text-base mb-8 mt-4 font-bold uppercase">Bonjour, {{ profile.nom }} {{ profile.prenom }}</h3>
{# Tableau des sorties globales#}
<div class="flex flex-col bg-white shadow-lg rounded-lg mx-8 mb-10">
<h4 class="text-start bg-gray-50 items-start justify-start text-base p-2 font-bold uppercase">Les sorties en cours</h4>
<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">Nom</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Etat</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Adresse</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">Date limite inscription</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Action</th>
</tr>
</thead>
<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">{{ sortie.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.lieu ? (sortie.lieu.ville ?: '') ~ ' ' ~ (sortie.lieu.codePostal ?: '') ~ ', ' ~ (sortie.lieu.rue ?: '') : '' }}
</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|date('d/m/Y H:i') }}</td>
<td class="flex flex-row px-6 py-4 whitespace-nowrap text-base text-gray-900">
{% if not sortie.participants.contains(app.user) and sortie.etat.libelle == 'Ouverte' %}
<form action="{{ path('sortie_inscription', { id: sortie.idSortie }) }}" method="post">
<button type="submit">🔔</button>
</form>
{% elseif sortie.participants.contains(app.user) and sortie.etat.libelle == 'Ouverte' %}
<form method="post" action="{{ path('sortie_unsubscribe', { id: sortie.idSortie }) }}">
<button type="submit">🔕</button>
</form>
{% endif %}
<a href="{{ path('sortie_view', { id: sortie.idSortie }) }}" class="px-2">👁️</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="8" class="px-6 py-4 text-center text-gray-500">Aucune participant trouvé</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="flex flex-row flex-wrap mx-8">
{# Tableau des sorties dont je suis participant#}
<div class="w-1/2 p-4 shadow-lg rounded-lg">
<h4 class="text-start bg-gray-50 items-start justify-start text-base p-2 font-bold uppercase">Mes participations</h4>
<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">Nom</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Adresse</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">Action</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200">
{% for sortie in sortiesParticipation %}
<tr>
<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.lieu ? (sortie.lieu.ville ?: '') ~ ' ' ~ (sortie.lieu.codePostal ?: '') ~ ', ' ~ (sortie.lieu.rue ?: '') : '' }}
</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="flex flex-row px-6 py-4 whitespace-nowrap text-base text-gray-900">
<a href={{ path('sortie_view', { id: sortie.idSortie }) }}>👁️</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="8" class="px-6 py-4 text-center text-gray-500">Vous ne participez à aucune sortie</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{# Tableau des sorties dont je suis organisateur #}
<div class="w-1/2 p-4 shadow-lg rounded-lg">
<h4 class="text-start bg-gray-50 items-start justify-start text-base p-2 font-bold uppercase">Mes organisations</h4>
<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">Nom</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Adresse</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">Action</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200">
{% for sortie in sortiesOrganisation %}
<tr>
<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.lieu ? (sortie.lieu.ville ?: '') ~ ' ' ~ (sortie.lieu.codePostal ?: '') ~ ', ' ~ (sortie.lieu.rue ?: '') : '' }}
</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="flex flex-row px-6 py-4 whitespace-nowrap text-base text-gray-900">
<a href={{ path('sortie_view', { id: sortie.idSortie }) }}>👁️</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="8" class="px-6 py-4 text-center text-gray-500">Vous n'organisez aucune sortie</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock %}