mirror of
https://github.com/partitioncloud/partitioncloud-server.git
synced 2025-01-23 17:26:26 +01:00
Compare commits
3 Commits
972231e4b2
...
1d02292c61
Author | SHA1 | Date | |
---|---|---|---|
1d02292c61 | |||
2ed8c92533 | |||
340b6541ca |
@ -92,32 +92,6 @@ def album(uuid):
|
|||||||
return abort(404)
|
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"])
|
@bp.route("/create-album", methods=["POST"])
|
||||||
@login_required
|
@login_required
|
||||||
def create_album():
|
def create_album():
|
||||||
|
@ -13,7 +13,6 @@ from .utils import get_all_partitions, User, Partition
|
|||||||
bp = Blueprint("partition", __name__, url_prefix="/partition")
|
bp = Blueprint("partition", __name__, url_prefix="/partition")
|
||||||
|
|
||||||
@bp.route("/<uuid>")
|
@bp.route("/<uuid>")
|
||||||
@login_required
|
|
||||||
def partition(uuid):
|
def partition(uuid):
|
||||||
db = get_db()
|
db = get_db()
|
||||||
partition = db.execute(
|
partition = db.execute(
|
||||||
|
@ -381,7 +381,7 @@ img.partition-thumbnail {
|
|||||||
|
|
||||||
#sidebar-navigation {
|
#sidebar-navigation {
|
||||||
overflow: scroll;
|
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;
|
padding: 0 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@
|
|||||||
<section id="partitions-grid">
|
<section id="partitions-grid">
|
||||||
{% for partition in partitions | reverse %}
|
{% for partition in partitions | reverse %}
|
||||||
<div>
|
<div>
|
||||||
<a href="/albums/{{ album.uuid }}/{{ partition['uuid'] }}">
|
<a href="/partition/{{ partition['uuid'] }}">
|
||||||
<div class="partition" id="partition-{{ partition['uuid'] }}">
|
<div class="partition" id="partition-{{ partition['uuid'] }}">
|
||||||
<img class="partition-thumbnail" src="/static/thumbnails/{{ partition['uuid'] }}.jpg">
|
<img class="partition-thumbnail" src="/static/thumbnails/{{ partition['uuid'] }}.jpg">
|
||||||
<div class="partition-description">
|
<div class="partition-description">
|
||||||
|
@ -54,6 +54,11 @@
|
|||||||
{% for album in user.albums %}
|
{% for album in user.albums %}
|
||||||
<option value="{{ album['uuid'] }}">{{ album["name"] }}</option>
|
<option value="{{ album['uuid'] }}">{{ album["name"] }}</option>
|
||||||
{% endfor %}
|
{% 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>
|
</select>
|
||||||
<input type="hidden" value="{{ partition['uuid'] }}" name="partition-uuid">
|
<input type="hidden" value="{{ partition['uuid'] }}" name="partition-uuid">
|
||||||
<input type="hidden" value="online_search" name="partition-type">
|
<input type="hidden" value="online_search" name="partition-type">
|
||||||
|
@ -25,6 +25,9 @@
|
|||||||
<input type="text" name="name" id="name" placeholder="Nom" required><br/>
|
<input type="text" name="name" id="name" placeholder="Nom" required><br/>
|
||||||
<input type="submit" value="Créer">
|
<input type="submit" value="Créer">
|
||||||
</form>
|
</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>
|
<a href="#!" class="close-dialog">Close</a>
|
||||||
</dialog>
|
</dialog>
|
||||||
<dialog id="create-groupe">
|
<dialog id="create-groupe">
|
||||||
@ -72,11 +75,6 @@
|
|||||||
Créer un album
|
Créer un album
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
<a href="#create-groupe">
|
|
||||||
<div class="create-button">
|
|
||||||
Créer un groupe
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if g.user %}
|
{% if g.user %}
|
||||||
@ -94,7 +92,7 @@
|
|||||||
Aucun album
|
Aucun album
|
||||||
{% else %}
|
{% else %}
|
||||||
{% for album in groupe.get_albums() %}
|
{% 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">
|
<div class="groupe-album-cover">
|
||||||
{{ album["name"] }}
|
{{ album["name"] }}
|
||||||
</div>
|
</div>
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<form method="post">
|
<form method="post">
|
||||||
<input type="submit" id="delete-partition" value="Supprimer">
|
<input type="submit" id="delete-partition" value="Supprimer">
|
||||||
</form>
|
</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>
|
<button id="cancel-deletion">Annuler</button>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user