2022-08-13 23:36:10 +02:00
|
|
|
{% extends 'base.html' %}
|
|
|
|
|
2023-06-11 21:33:54 +02:00
|
|
|
{% block title %}{{ album.name }}{% endblock %}
|
2022-08-13 23:36:10 +02:00
|
|
|
|
2022-08-30 21:39:02 +02:00
|
|
|
|
2023-06-11 21:33:54 +02:00
|
|
|
{% block dialogs %}
|
|
|
|
<dialog id="add-partition">
|
|
|
|
<h2>Ajouter une partition à {{ album.name }}</h2>
|
|
|
|
<form action="/albums/{{ album.uuid }}/add-partition" method="post" enctype="multipart/form-data">
|
|
|
|
<input name="name" type="text" required="" placeholder="Titre"><br/>
|
|
|
|
<input name="author" type="text" placeholder="Auteur"><br/>
|
|
|
|
<textarea id="paroles" name="body" type="text" placeholder="Paroles"></textarea><br/>
|
2023-10-26 14:14:40 +02:00
|
|
|
<input name="file" type="file" accept=".pdf" required=""><br/>
|
2023-06-11 21:33:54 +02:00
|
|
|
<input type="submit" value="Ajouter">
|
|
|
|
</form>
|
|
|
|
<a href="#!" class="close-dialog">Close</a>
|
|
|
|
</dialog>
|
|
|
|
<dialog id="delete">
|
|
|
|
<h2>Supprimer l'album</h2>
|
|
|
|
Êtes vous sûr de vouloir supprimer cet album ?
|
|
|
|
<br/><br/>
|
|
|
|
<form method="post" action="/albums/{{ album.uuid }}/delete">
|
|
|
|
<input type="submit" style="background-color: var(--color-red);" value="Supprimer">
|
|
|
|
</form>
|
|
|
|
<a href="#!" class="close-dialog">Close</a>
|
|
|
|
</dialog>
|
2023-11-19 18:45:25 +01:00
|
|
|
{% if groupe %}
|
|
|
|
{% set current_url = "/groupe/" + groupe.uuid + "/" + album.uuid %}
|
|
|
|
{% else %}
|
|
|
|
{% set current_url = "/albums/" + album.uuid %}
|
|
|
|
{% endif %}
|
|
|
|
{% with share_link=config.BASE_URL+current_url, share_qrlink=current_url + "/qr" %}
|
|
|
|
{% include 'components/share_dialog.html' %}
|
|
|
|
{% endwith %}
|
|
|
|
|
2022-08-16 00:00:20 +02:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block content %}
|
2023-06-11 21:33:54 +02:00
|
|
|
<header id="album-header">
|
2023-10-11 17:15:49 +02:00
|
|
|
<h2 id="album-title">
|
|
|
|
{% if groupe %}<a href="/groupe/{{ groupe.uuid }}">{{ groupe.name}}</a> /
|
|
|
|
{% endif %}
|
|
|
|
{{ album.name }}
|
|
|
|
</h2>
|
2023-06-22 16:06:48 +02:00
|
|
|
{% if g.user %}
|
|
|
|
<div id="header-actions">
|
|
|
|
<section id="users">
|
|
|
|
{% for album_user in album.users %}
|
|
|
|
<div class="user-profile-picture" style="background-color:{{ album_user.color }};" title="{{ album_user.username }}">
|
|
|
|
{{ album_user.username[0] | upper }}
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
</section>
|
|
|
|
<div class="dropdown dp1">
|
|
|
|
+
|
|
|
|
<div class="dropdown-content dp1">
|
|
|
|
{% if g.user %}
|
|
|
|
<a href="#add-partition">Ajouter une partition</a>
|
|
|
|
{% endif %}
|
|
|
|
{% if not_participant %}
|
|
|
|
<a href="/albums/{{ album.uuid }}/join">Rejoindre</a>
|
|
|
|
{% elif album.users | length > 1 %}
|
|
|
|
<a href="/albums/{{ album.uuid }}/quit">Quitter</a>
|
|
|
|
{% endif %}
|
2023-11-19 18:45:25 +01:00
|
|
|
<a href="#share">Partager</a>
|
2023-06-22 16:06:48 +02:00
|
|
|
{% if g.user.access_level == 1 or (not not_participant and album.users | length == 1) %}
|
|
|
|
<a id="delete-album" href="#delete">Supprimer</a>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
2023-06-11 21:33:54 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-06-22 16:06:48 +02:00
|
|
|
{% endif %}
|
2023-06-11 21:33:54 +02:00
|
|
|
</header>
|
|
|
|
<hr/>
|
2022-08-13 23:36:10 +02:00
|
|
|
{% if partitions|length != 0 %}
|
2023-06-11 21:33:54 +02:00
|
|
|
<section id="partitions-grid">
|
2022-08-24 22:53:51 +02:00
|
|
|
{% for partition in partitions | reverse %}
|
2022-12-19 10:04:50 +01:00
|
|
|
<div>
|
2023-10-13 14:36:04 +02:00
|
|
|
<a href="/partition/{{ partition['uuid'] }}">
|
2023-06-11 21:33:54 +02:00
|
|
|
<div class="partition" id="partition-{{ partition['uuid'] }}">
|
2024-01-16 21:25:32 +01:00
|
|
|
<img class="partition-thumbnail" src="/thumbnails/{{ partition['uuid'] }}.jpg" loading="lazy">
|
2023-06-11 21:33:54 +02:00
|
|
|
<div class="partition-description">
|
|
|
|
<div class="partition-name">{{ partition["name"] }}</div>
|
|
|
|
<div class="partition-author">{{ partition["author"] }}</div>
|
|
|
|
</div>
|
2022-08-16 00:00:20 +02:00
|
|
|
</div>
|
2023-06-11 21:33:54 +02:00
|
|
|
</a>
|
2023-10-26 14:14:40 +02:00
|
|
|
<div class="partition-buttons">
|
|
|
|
{% if partition["has_attachment"] %}
|
|
|
|
<a href="/partition/{{ partition['uuid'] }}/attachments"><div class="partition-action">📎</div></a>
|
|
|
|
{% endif %}
|
|
|
|
{% if partition["user_id"] == g.user.id or g.user.access_level == 1 %}
|
|
|
|
<a href="/partition/{{ partition['uuid'] }}/edit"><div class="partition-action">✏️</div></a>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
2022-08-16 15:21:12 +02:00
|
|
|
</div>
|
2022-08-16 00:00:20 +02:00
|
|
|
{% endfor %}
|
2023-06-11 21:33:54 +02:00
|
|
|
</section>
|
2022-08-13 23:36:10 +02:00
|
|
|
{% else %}
|
2022-12-19 15:19:58 +01:00
|
|
|
<br/>
|
2023-11-24 12:08:47 +01:00
|
|
|
<section id="partitions-grid" style="display: inline;">Aucune partition disponible</section>
|
2022-08-13 23:36:10 +02:00
|
|
|
{% endif %}
|
2023-11-24 12:08:47 +01:00
|
|
|
{% endblock %}
|