style: aggiunta icona per visualizzare rapidamente gli allegati del ticket.

This commit is contained in:
Gabriele Cimaschi committed 2026-09-14 17:10:06 +02:00
1 parent d4ef03b6f4
commit ae458256d5
1 file changed
+20
+20
View File
@@ -2906,6 +2906,11 @@ const TicketDetailView = {
const hasEmailDraft = App.getDraft(id, 'email'); const hasEmailDraft = App.getDraft(id, 'email');
const emailBtnText = hasEmailDraft ? 'Continua mail' : 'Invia 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 = ` container.innerHTML = `
<a class="back-link" onclick="window.location.hash = App.lastListView || '#/tickets'"> <a class="back-link" onclick="window.location.hash = App.lastListView || '#/tickets'">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="width:16px;height:16px;"><path d="M19 12H5M12 19l-7-7 7-7"/></svg> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="width:16px;height:16px;"><path d="M19 12H5M12 19l-7-7 7-7"/></svg>
@@ -2931,6 +2936,11 @@ const TicketDetailView = {
<button class="assign-open-tab-btn" data-id="${ticket.id}" data-tn="${ticket.tn}" data-title="${App.escapeHtml(ticket.title || '(senza titolo)')}" onclick="App.assignAndOpenTab(${ticket.id}, '${ticket.tn}', this.dataset.title); event.stopPropagation();" title="Assegna a me ed apri in scheda" style="display:inline-flex; align-items:center; justify-content:center; height:20px; padding:0 8px; background:var(--accent-primary); color:#fff; border:none; border-radius:var(--radius-full); font-size:11px; font-weight:600; font-family:inherit; margin-left:6px; cursor:pointer; gap:3px;"> <button class="assign-open-tab-btn" data-id="${ticket.id}" data-tn="${ticket.tn}" data-title="${App.escapeHtml(ticket.title || '(senza titolo)')}" onclick="App.assignAndOpenTab(${ticket.id}, '${ticket.tn}', this.dataset.title); event.stopPropagation();" title="Assegna a me ed apri in scheda" style="display:inline-flex; align-items:center; justify-content:center; height:20px; padding:0 8px; background:var(--accent-primary); color:#fff; border:none; border-radius:var(--radius-full); font-size:11px; font-weight:600; font-family:inherit; margin-left:6px; cursor:pointer; gap:3px;">
👤+ Assegna & Scheda 👤+ Assegna & Scheda
</button> </button>
${ticketRealAttachments.length > 0 ? `
<button class="header-open-attachments-btn" style="display:inline-flex; align-items:center; justify-content:center; height:20px; padding:0 8px; background:var(--bg-tertiary); color:var(--accent-primary); border:1px solid var(--border-subtle); border-radius:var(--radius-full); font-size:11px; font-weight:600; font-family:inherit; margin-left:6px; cursor:pointer; gap:4px;" title="Visualizza allegati ticket (${ticketRealAttachments.length})">
📎 ${ticketRealAttachments.length}
</button>
` : ''}
</h2> </h2>
<div class="ticket-meta-badges"> <div class="ticket-meta-badges">
<span class="badge badge-state" data-state-type="${(ticket.state_type || '').toLowerCase()}">${ticket.state_name}</span> <span class="badge badge-state" data-state-type="${(ticket.state_type || '').toLowerCase()}">${ticket.state_name}</span>
@@ -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) // Keydown listener for Ticket Detail shortcut (Save Quick Edit / Send Note)
const handleTicketDetailShortcut = (e) => { const handleTicketDetailShortcut = (e) => {
if (!document.getElementById('qe-save')) { if (!document.getElementById('qe-save')) {