"No album" displayed when user not logged in

This commit is contained in:
augustin64 2023-06-11 21:55:57 +02:00
parent fb630f863b
commit 7fb6648fa1
2 changed files with 9 additions and 3 deletions

View File

@ -275,6 +275,10 @@ img.partition-thumbnail {
height: 70vh; height: 70vh;
} }
#albums div {
padding: 5px;
}
.user { .user {
display: flex; display: flex;
} }

View File

@ -50,7 +50,11 @@
{% endif %} {% endif %}
<h1>Albums</h1> <h1>Albums</h1>
<section id="albums"> <section id="albums">
{% if g.user and user.get_albums() | length != 0 %} {% if not g.user %}
<div style="text-align: center;"><i>Connectez vous pour avoir accès à vos albums</i></div>
{% elif user.get_albums() | length == 0 %}
<div style="text-align: center;"><i>Aucun album disponible</i></div>
{% else %}
{% for album in user.albums %} {% for album in user.albums %}
<a href="/albums/{{ album['uuid'] }}"> <a href="/albums/{{ album['uuid'] }}">
<div class="album-cover" id="album-1"> <div class="album-cover" id="album-1">
@ -58,8 +62,6 @@
</div> </div>
</a> </a>
{% endfor %} {% endfor %}
{% else %}
<div>Aucun album disponible</div>
{% endif %} {% endif %}
</section> </section>