From ae458256d53fbea349cba02398408184aa45986c Mon Sep 17 00:00:00 2001 From: Gabriele Cimaschi Date: Mon, 14 Sep 2026 17:10:06 +0200 Subject: [PATCH] style: aggiunta icona per visualizzare rapidamente gli allegati del ticket. --- public/js/views/ticketDetail.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/public/js/views/ticketDetail.js b/public/js/views/ticketDetail.js index 6da781d..d95aa1c 100644 --- a/public/js/views/ticketDetail.js +++ b/public/js/views/ticketDetail.js @@ -2906,6 +2906,11 @@ const TicketDetailView = { const hasEmailDraft = App.getDraft(id, 'email'); const emailBtnText = hasEmailDraft ? 'Continua mail' : 'Invia Email'; + const ticketRealAttachments = (attachments || []).filter(att => { + const fname = (att.filename || '').toLowerCase(); + return !fname.startsWith('file-1') && !fname.startsWith('file-2') && !fname.startsWith('file-3'); + }); + container.innerHTML = ` @@ -2931,6 +2936,11 @@ const TicketDetailView = { + ${ticketRealAttachments.length > 0 ? ` + + ` : ''}
${ticket.state_name} @@ -4289,6 +4299,16 @@ const TicketDetailView = { }); }); + const headerAttBtn = document.querySelector('.header-open-attachments-btn'); + if (headerAttBtn) { + headerAttBtn.addEventListener('click', (e) => { + e.stopPropagation(); + const firstBadge = document.querySelector('.attachment-badge'); + const firstSrc = firstBadge ? firstBadge.href : ''; + this.openImageLightbox(firstSrc); + }); + } + // Keydown listener for Ticket Detail shortcut (Save Quick Edit / Send Note) const handleTicketDetailShortcut = (e) => { if (!document.getElementById('qe-save')) {