diff --git a/photologue/static/lightgallery/plugins/admin/lg-admin.js b/photologue/static/lightgallery/plugins/admin/lg-admin.js
index 64ba238..53b0f4f 100644
--- a/photologue/static/lightgallery/plugins/admin/lg-admin.js
+++ b/photologue/static/lightgallery/plugins/admin/lg-admin.js
@@ -8,6 +8,7 @@ class lgAdmin {
constructor(instance, $LG) {
this.core = instance;
this.$LG = $LG;
+ this.isStaff = instance.settings.isStaff;
return this;
}
@@ -19,6 +20,7 @@ class lgAdmin {
onAfterSlide(event) {
const photoId = this.core.galleryItems[event.detail.index].slideName;
document.getElementById("lg-admin").href = `https://photos.crans.org/admin/photologue/photo/${photoId}/change/`;
+ document.getElementById("lg-admin").style.display = this.isStaff ? 'block' : 'none';
}
// Admin must have destroy prototype
diff --git a/photologue/templates/photologue/gallery_detail.html b/photologue/templates/photologue/gallery_detail.html
index 4975d54..3561932 100644
--- a/photologue/templates/photologue/gallery_detail.html
+++ b/photologue/templates/photologue/gallery_detail.html
@@ -20,8 +20,9 @@ SPDX-License-Identifier: GPL-3.0-or-later
{% endblock %}