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

100 lines
3.4 KiB
HTML

{% extends 'base.html' %}
{% block title %}{{ album.name }}{% endblock %}
{% block dialogs %}
<dialog id="add-partition">
{% include 'components/add_partition.html' %}
<a href="#!" class="close-dialog">Close</a>
</dialog>
<dialog id="delete">
<h2>{{ _("Delete l'album") }}</h2>
{{ _("Do you really want to delete this album?") }}
<br/><br/>
<form method="post" action="/albums/{{ album.uuid }}/delete">
<input type="submit" style="background-color: var(--color-red);" value="{{ _('Delete') }}">
</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 %}
<header id="album-header">
<h2 id="album-title">
{% if groupe %}<a href="/groupe/{{ groupe.uuid }}">{{ groupe.name }}</a> /
{% endif %}
{{ album.name }}
</h2>
<div id="header-actions">
{% if g.user %}
<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>
{% 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>
{% elif g.user and not not_participant %}
<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 %}
</div>
</div>
</div>
</header>
<hr/>
{% if partitions|length != 0 %}
<section id="partitions-grid">
{% for partition in partitions | reverse %}
<div>
<a href="/partition/{{ partition['uuid'] }}">
<div class="partition" id="partition-{{ partition['uuid'] }}">
<img class="partition-thumbnail" src="/thumbnails/{{ partition['uuid'] }}.jpg" loading="lazy">
<div class="partition-description">
<div class="partition-name">{{ partition["name"] }}</div>
<div class="partition-author">{{ partition["author"] }}</div>
</div>
</div>
</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 %}
</section>
{% else %}
<br/>
<section id="partitions-grid" style="display: inline;">{{ _("No available scores") }}</section>
{% endif %}
{% endblock %}