Add UI button

This commit is contained in:
augustin64 2024-04-10 18:45:38 +02:00
parent d1812cdde7
commit dbe77d0ece
2 changed files with 42 additions and 36 deletions

View File

@ -35,8 +35,8 @@
{% endif %} {% endif %}
{{ album.name }} {{ album.name }}
</h2> </h2>
{% if g.user %} <div id="header-actions">
<div id="header-actions"> {% if g.user %}
<section id="users"> <section id="users">
{% for album_user in album.users %} {% for album_user in album.users %}
<div class="user-profile-picture" style="background-color:{{ album_user.color }};" title="{{ album_user.username }}"> <div class="user-profile-picture" style="background-color:{{ album_user.color }};" title="{{ album_user.username }}">
@ -44,25 +44,28 @@
</div> </div>
{% endfor %} {% endfor %}
</section> </section>
<div class="dropdown dp1"> {% endif %}
+ <div class="dropdown dp1">
<div class="dropdown-content dp1"> +
{% if g.user %} <div class="dropdown-content dp1">
<a href="#add-partition">{{ _("Add a score") }}</a> {% if g.user %}
{% endif %} <a href="#add-partition">{{ _("Add a score") }}</a>
{% if not_participant %} {% endif %}
<a href="/albums/{{ album.uuid }}/join">{{ _("Join") }}</a> {% if not_participant %}
{% elif album.users | length > 1 %} <a href="/albums/{{ album.uuid }}/join">{{ _("Join") }}</a>
<a href="/albums/{{ album.uuid }}/quit">{{ _("Quit") }}</a> {% elif album.users | length > 1 %}
{% endif %} <a href="/albums/{{ album.uuid }}/quit">{{ _("Quit") }}</a>
<a href="#share">{{ _("Share") }}</a> {% endif %}
{% if g.user.access_level == 1 or (not not_participant and album.users | length == 1) %} <a href="#share">{{ _("Share") }}</a>
<a id="delete-album" href="#delete">{{ _("Delete") }}</a> {% if g.user or not config["ZIP_REQUIRE_LOGIN"] %}
{% endif %} <a href="/albums/{{ album.uuid }}/zip">{{ _("Download as zip") }}</a>
</div> {% 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> </div>
{% endif %} </div>
</header> </header>
<hr/> <hr/>
{% if partitions|length != 0 %} {% if partitions|length != 0 %}

View File

@ -30,8 +30,8 @@
{% block content %} {% block content %}
<header id="album-header"> <header id="album-header">
<h2 id="groupe-title">{{ groupe.name }}</h2> <h2 id="groupe-title">{{ groupe.name }}</h2>
{% if g.user %} <div id="header-actions">
<div id="header-actions"> {% if g.user %}
<section id="users"> <section id="users">
{% for groupe_user in groupe.users %} {% for groupe_user in groupe.users %}
<div class="user-profile-picture" style="background-color:{{ groupe_user.color }};" title="{{ groupe_user.username }}"> <div class="user-profile-picture" style="background-color:{{ groupe_user.color }};" title="{{ groupe_user.username }}">
@ -39,23 +39,26 @@
</div> </div>
{% endfor %} {% endfor %}
</section> </section>
<div class="dropdown dp1"> {% endif %}
+ <div class="dropdown dp1">
<div class="dropdown-content dp1"> +
{% if not_participant %} <div class="dropdown-content dp1">
<a href="/groupe/{{ groupe.uuid }}/join">{{ _("Join") }}</a> {% if not_participant %}
{% elif groupe.users | length > 1 %} <a href="/groupe/{{ groupe.uuid }}/join">{{ _("Join") }}</a>
<a href="/groupe/{{ groupe.uuid }}/quit">{{ _("Quit") }}</a> {% elif groupe.users | length > 1 and g.user %}
{% endif %} <a href="/groupe/{{ groupe.uuid }}/quit">{{ _("Quit") }}</a>
<a href="#share">{{ _("Share") }}</a> {% endif %}
{% if g.user.access_level == 1 or user.id in groupe.get_admins() %} <a href="#share">{{ _("Share") }}</a>
<a href="#create-groupe-album">{{ _("Add an album") }}</a> {% if g.user or not config["ZIP_REQUIRE_LOGIN"] %}
<a id="delete-album" href="#delete">{{ _("Delete") }}</a> <a href="/groupe/{{ groupe.uuid }}/zip">{{ _("Download as zip") }}</a>
{% endif %} {% endif %}
</div> {% if g.user.access_level == 1 or (g.user and user.id in groupe.get_admins()) %}
<a href="#create-groupe-album">{{ _("Add an album") }}</a>
<a id="delete-album" href="#delete">{{ _("Delete") }}</a>
{% endif %}
</div> </div>
</div> </div>
{% endif %} </div>
</header> </header>
<hr/> <hr/>
{% if groupe.albums|length != 0 %} {% if groupe.albums|length != 0 %}