feat(profil): Ajoute la gestion de l'avatar et du mot de passe.

This commit is contained in:
Serreau Jovann
2025-07-21 09:47:40 +02:00
parent 20a5ea8779
commit 0fa8508fba
10 changed files with 189 additions and 12 deletions

View File

@@ -66,10 +66,31 @@
<div class="relative">
<a href="{{ path('artemis_profils') }}" class="relative z-10 block w-8 h-8 overflow-hidden rounded-full shadow focus:outline-none">
<img class="object-cover w-full h-full" src="{{ path('artemis_avatar')}}" alt="{{ app.user.username }}">
{% if app.user.avatarOriginalName is defined and app.user.avatarOriginalName is not empty %}
<img src="{{ vich_uploader_asset(app.user,'avatar') | imagine_filter('webp') }}" alt="Avatar de {{ app.user.username }}" class="object-cover w-full h-full">
{% else %}
<img src="{{ path('artemis_avatar') }}" alt="Avatar de {{ app.user.username }}" class="object-cover w-full h-full">
{% endif %}
</a>
</div>
</div>
<div id="flash-messages-container" class="absolute top-4 right-4 z-50 space-y-2 w-full max-w-xs">
{# This block demonstrates how Symfony flash messages would be displayed. #}
{# They are typically set in your Symfony controller and then iterated over in Twig. #}
{% for label, messages in app.flashes %}
{% for message in messages %}
<div class="p-4 rounded-lg shadow-md flex items-center justify-between transition-opacity duration-300
{% if label == 'success' %} bg-green-100 text-green-800 dark:bg-green-800 dark:text-green-100
{% elseif label == 'error' %} bg-red-100 text-red-800 dark:bg-red-800 dark:text-red-100
{% elseif label == 'warning' %} bg-yellow-100 text-yellow-800 dark:bg-yellow-800 dark:text-yellow-100
{% else %} bg-blue-100 text-blue-800 dark:bg-blue-800 dark:text-blue-100
{% endif %}">
<span>{{ message }}</span>
</div>
{% endfor %}
{% endfor %}
</div>
</header>
<!-- Content -->