partitioncloud-server/partitioncloud/templates/albums/album.html

100 lines
3.4 KiB
HTML
Raw Permalink Normal View History

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">
2024-01-25 16:22:04 +01:00
{% include 'components/add_partition.html' %}
2023-06-11 21:33:54 +02:00
<a href="#!" class="close-dialog">Close</a>
</dialog>
<dialog id="delete">
<h2>{{ _("Delete l'album") }}</h2>
{{ _("Do you really want to delete this album?") }}
2023-06-11 21:33:54 +02:00
<br/><br/>
<form method="post" action="/albums/{{ album.uuid }}/delete">
<input type="submit" style="background-color: var(--color-red);" value="{{ _('Delete') }}">
2023-06-11 21:33:54 +02:00
</form>
<a href="#!" class="close-dialog">Close</a>
</dialog>
{% 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 %}
{% 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">
2024-01-25 16:22:04 +01:00
{% if groupe %}<a href="/groupe/{{ groupe.uuid }}">{{ groupe.name }}</a> /
2023-10-11 17:15:49 +02:00
{% endif %}
{{ album.name }}
</h2>
2024-04-10 18:45:38 +02:00
<div id="header-actions">
{% if g.user %}
2023-06-22 16:06:48 +02:00
<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>
2024-04-10 18:45:38 +02:00
{% endif %}
<div class="dropdown dp1">
+
<div class="dropdown-content dp1">
{% if g.user %}
<a href="#add-partition">{{ _("Add a score") }}</a>
{% endif %}
{% if not_participant %}
<a href="/albums/{{ album.uuid }}/join">{{ _("Join") }}</a>
2024-04-19 18:48:19 +02:00
{% elif g.user and not not_participant %}
2024-04-10 18:45:38 +02:00
<a href="/albums/{{ album.uuid }}/quit">{{ _("Quit") }}</a>
{% endif %}
<a href="#share">{{ _("Share") }}</a>
{% if g.user or not config["ZIP_REQUIRE_LOGIN"] %}
<a href="/albums/{{ album.uuid }}/zip">{{ _("Download as zip") }}</a>
{% endif %}
{% if g.user.access_level == 1 or (g.user and not not_participant and album.users | length == 1) %}
<a id="delete-album" href="#delete">{{ _("Delete") }}</a>
{% endif %}
2023-06-11 21:33:54 +02:00
</div>
</div>
2024-04-10 18:45:38 +02:00
</div>
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">
{% for partition in partitions | reverse %}
2022-12-19 10:04:50 +01:00
<div>
<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>
</div>
2023-06-11 21:33:54 +02:00
</a>
<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>
</div>
{% 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/>
<section id="partitions-grid" style="display: inline;">{{ _("No available scores") }}</section>
2022-08-13 23:36:10 +02:00
{% endif %}
2023-11-24 12:08:47 +01:00
{% endblock %}