Fix gallery photo deletion gap and uncensor UI glitche.
This commit is contained in:
parent
ed28d4a9c4
commit
72e9344102
4 changed files with 26 additions and 2 deletions
|
|
@ -399,6 +399,10 @@ msgstr "Aucune galerie trouvée."
|
||||||
msgid "to"
|
msgid "to"
|
||||||
msgstr "au"
|
msgstr "au"
|
||||||
|
|
||||||
|
#: photologue/templates/photologue/gallery_detail.html:49
|
||||||
|
msgid "censored photos"
|
||||||
|
msgstr "photos censurées"
|
||||||
|
|
||||||
#: photologue/templates/photologue/gallery_detail.html:53
|
#: photologue/templates/photologue/gallery_detail.html:53
|
||||||
msgid "Public link:"
|
msgid "Public link:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,7 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.applyJustifiedLayout = applyLayout;
|
||||||
document.addEventListener('DOMContentLoaded', applyLayout);
|
document.addEventListener('DOMContentLoaded', applyLayout);
|
||||||
window.addEventListener('resize', applyLayout);
|
window.addEventListener('resize', applyLayout);
|
||||||
})();
|
})();
|
||||||
|
|
|
||||||
|
|
@ -76,9 +76,15 @@ class lgAdmin {
|
||||||
if (el) {
|
if (el) {
|
||||||
el.dataset.isPublic = 'true';
|
el.dataset.isPublic = 'true';
|
||||||
const img = el.querySelector('img');
|
const img = el.querySelector('img');
|
||||||
if (img) img.classList.remove('border-danger', 'border-5');
|
if (img) img.classList.remove('border-danger', 'border-5', 'photo-private');
|
||||||
}
|
}
|
||||||
document.getElementById("lg-restore").style.display = 'none';
|
document.getElementById("lg-restore").style.display = 'none';
|
||||||
|
const countSpan = document.getElementById('private-count');
|
||||||
|
if (countSpan) {
|
||||||
|
const newCount = parseInt(countSpan.textContent, 10) - 1;
|
||||||
|
if (newCount <= 0) document.getElementById('private-count-line').remove();
|
||||||
|
else countSpan.textContent = newCount;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -101,6 +107,7 @@ class lgAdmin {
|
||||||
this.core.LGel.off('lgAfterSlide.adminRemove');
|
this.core.LGel.off('lgAfterSlide.adminRemove');
|
||||||
const thumb = document.querySelector(`[data-slide-name='${photoId}']`);
|
const thumb = document.querySelector(`[data-slide-name='${photoId}']`);
|
||||||
if (thumb) thumb.remove();
|
if (thumb) thumb.remove();
|
||||||
|
if (typeof window.applyJustifiedLayout === 'function') window.applyJustifiedLayout();
|
||||||
const lgId = this.core.lgId;
|
const lgId = this.core.lgId;
|
||||||
const deletedItem = document.getElementById(`lg-item-${lgId}-${currentIndex}`);
|
const deletedItem = document.getElementById(`lg-item-${lgId}-${currentIndex}`);
|
||||||
if (deletedItem) deletedItem.remove();
|
if (deletedItem) deletedItem.remove();
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,19 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</h1>
|
</h1>
|
||||||
{% if gallery.date_start %}<p class="text-muted small">{{ gallery.date_start }}{% if gallery.date_end and gallery.date_end != gallery.date_start %} {% trans "to" %} {{ gallery.date_end }}{% endif %}</p>{% endif %}
|
{% if gallery.date_start %}<p class="text-muted small">{{ gallery.date_start }}{% if gallery.date_end and gallery.date_end != gallery.date_start %} {% trans "to" %} {{ gallery.date_end }}{% endif %}</p>{% endif %}
|
||||||
{% if request.user.is_staff and gallery.photo_private_count %}<p class="text-danger small">{{ gallery.photo_private_count }} photos censurées</p>{% endif %}
|
{% if request.user.is_staff and gallery.photo_private_count %}<p class="text-danger small" id="private-count-line"><span id="private-count">{{ gallery.photo_private_count }}</span> {% trans "censored photos" %}</p>{% endif %}
|
||||||
|
{% if request.user.is_staff %}
|
||||||
|
{% if public_url %}
|
||||||
|
<div class="alert alert-secondary py-1 d-flex align-items-center gap-2 small" role="alert">
|
||||||
|
<span>{% trans "Public link:" %}</span>
|
||||||
|
<input type="text" class="form-control form-control-sm" id="public-link-input" value="{{ public_url }}" readonly style="max-width:400px">
|
||||||
|
<button class="btn btn-outline-secondary btn-sm" data-clipboard-text="{{ public_url }}">{% trans "Copy" %}</button>
|
||||||
|
<form method="post" action="{% url 'photologue:pl-gallery-token' gallery.slug %}" class="mb-0">{% csrf_token %}<input type="hidden" name="action" value="revoke"><button type="submit" class="btn btn-outline-danger btn-sm">{% trans "Revoke" %}</button></form>
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
|
<form method="post" action="{% url 'photologue:pl-gallery-token' gallery.slug %}" class="mb-2">{% csrf_token %}<input type="hidden" name="action" value="generate"><button type="submit" class="btn btn-outline-primary btn-sm">{% trans "Generate public link" %}</button></form>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
{% if gallery.tags.all %}
|
{% if gallery.tags.all %}
|
||||||
<p class="text-muted">
|
<p class="text-muted">
|
||||||
Tags : {% for tag in gallery.tags.all %}
|
Tags : {% for tag in gallery.tags.all %}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue