Compare commits

...

3 Commits

Author SHA1 Message Date
1d02292c61 remove big "Create groupe" button 2023-10-13 14:46:22 +02:00
2ed8c92533 Added the ability to add online search to groupe 2023-10-13 14:37:10 +02:00
340b6541ca Shorter path for partitions
`/albums/<album_uuid>/<partition_uuid>` -> `/partition/<partition_uuid>`
2023-10-13 14:36:04 +02:00
7 changed files with 12 additions and 36 deletions

View File

@ -92,32 +92,6 @@ def album(uuid):
return abort(404)
@bp.route("/<album_uuid>/<partition_uuid>")
def partition(album_uuid, partition_uuid):
"""
Returns a partition in a given album
"""
db = get_db()
partition = db.execute(
"""
SELECT * FROM partition
JOIN contient_partition ON partition_uuid = partition.uuid
JOIN album ON album.id = album_id
WHERE album.uuid = ?
AND partition.uuid = ?
""",
(album_uuid, partition_uuid),
).fetchone()
if partition is None:
return abort(404)
return send_file(
os.path.join("partitions", f"{partition_uuid}.pdf"),
download_name = f"{partition['name']}.pdf"
)
@bp.route("/create-album", methods=["POST"])
@login_required
def create_album():

View File

@ -13,7 +13,6 @@ from .utils import get_all_partitions, User, Partition
bp = Blueprint("partition", __name__, url_prefix="/partition")
@bp.route("/<uuid>")
@login_required
def partition(uuid):
db = get_db()
partition = db.execute(

View File

@ -381,7 +381,7 @@ img.partition-thumbnail {
#sidebar-navigation {
overflow: scroll;
height: calc(100% - 400px); /* we don't want it hidden behind settings */
height: calc(100% - 375px); /* we don't want it hidden behind settings */
padding: 0 5px;
}

View File

@ -66,7 +66,7 @@
<section id="partitions-grid">
{% for partition in partitions | reverse %}
<div>
<a href="/albums/{{ album.uuid }}/{{ partition['uuid'] }}">
<a href="/partition/{{ partition['uuid'] }}">
<div class="partition" id="partition-{{ partition['uuid'] }}">
<img class="partition-thumbnail" src="/static/thumbnails/{{ partition['uuid'] }}.jpg">
<div class="partition-description">

View File

@ -54,6 +54,11 @@
{% for album in user.albums %}
<option value="{{ album['uuid'] }}">{{ album["name"] }}</option>
{% endfor %}
{% for groupe in user.get_groupes() %}
{% for album in groupe.get_albums() %}
<option value="{{ album['uuid'] }}">{{ groupe.name }}/{{ album["name"] }}</option>
{% endfor %}
{% endfor %}
</select>
<input type="hidden" value="{{ partition['uuid'] }}" name="partition-uuid">
<input type="hidden" value="online_search" name="partition-type">

View File

@ -25,6 +25,9 @@
<input type="text" name="name" id="name" placeholder="Nom" required><br/>
<input type="submit" value="Créer">
</form>
<br/>
<br/>
Je souhaite créer plusieurs albums et pouvoir tous les partager avec un seul lien. <a href="#create-groupe">Créer un groupe</a>.
<a href="#!" class="close-dialog">Close</a>
</dialog>
<dialog id="create-groupe">
@ -72,11 +75,6 @@
Créer un album
</div>
</a>
<a href="#create-groupe">
<div class="create-button">
Créer un groupe
</div>
</a>
{% endif %}
{% if g.user %}
@ -94,7 +92,7 @@
Aucun album
{% else %}
{% for album in groupe.get_albums() %}
<a href="/groupe/{{ groupe.uuid }}/{{ album["uuid"] }}">
<a href="/groupe/{{ groupe.uuid }}/{{ album['uuid'] }}">
<div class="groupe-album-cover">
{{ album["name"] }}
</div>

View File

@ -9,7 +9,7 @@
<form method="post">
<input type="submit" id="delete-partition" value="Supprimer">
</form>
<a class="button-href" href="/albums/{{ partition.uuid }}/edit">
<a class="button-href" href="/partition/{{ partition.uuid }}/edit">
<button id="cancel-deletion">Annuler</button>
</a>