From 38105aff23d76772e48091daace3da9ba01d73e4 Mon Sep 17 00:00:00 2001 From: Matthieu Leproux Date: Mon, 3 Oct 2022 14:43:17 +0200 Subject: [PATCH] fix #1740 better UI for edit btn when the image is deleted --- admin/themes/default/js/history.js | 13 ++++++++++++- admin/themes/default/template/history.tpl | 5 +++++ include/ws_functions/pwg.php | 1 + language/en_UK/admin.lang.php | 1 + language/fr_FR/admin.lang.php | 1 + 5 files changed, 20 insertions(+), 1 deletion(-) diff --git a/admin/themes/default/js/history.js b/admin/themes/default/js/history.js index 7ad23d3a4..c7a0d3b08 100644 --- a/admin/themes/default/js/history.js +++ b/admin/themes/default/js/history.js @@ -301,7 +301,18 @@ function lineConstructor(line, id, imageDisplay) { fillHistoryResult(current_param); }); } - newLine.find(".edit-img").attr("href", line.EDIT_IMAGE) + + if (line.EDIT_IMAGE != "") { + newLine.find(".edit-img").attr("href", line.EDIT_IMAGE); + } else { + newLine.find(".edit-img") + .attr("href", "#") + .addClass("notClickable tiptip") + .attr('title', str_no_longer_exist_photo) + .on("click", (e) => { + e.preventDefault(); + }); + } switch (line.SECTION) { case "tags": diff --git a/admin/themes/default/template/history.tpl b/admin/themes/default/template/history.tpl index 6d21c8cef..de6752429 100644 --- a/admin/themes/default/template/history.tpl +++ b/admin/themes/default/template/history.tpl @@ -41,6 +41,7 @@ const str_favorites = "{'Your favorites'|translate}"; const str_recent_cats = "{'Recent albums'|translate}"; const str_recent_pics = "{'Recent photos'|translate}"; const str_memories = "{'Memories'|translate}"; +const str_no_longer_exist_photo = "{'This photo no longer exists'|@translate}"; const unit_MB = "{"%s MB"|@translate}"; const str_guest = '{'guest'|@translate}'; const guest_id = {$guest_id}; @@ -276,6 +277,10 @@ jQuery(document).ready( function() {