diff --git a/public/css/style.css b/public/css/style.css index da41d19..ff7f32b 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -2697,4 +2697,21 @@ body { .line-config-row .line-actions { display: flex; gap: 6px; +} + +/* Hover popover per dettagli articolo (pulsante i) */ +.article-info-popover-wrapper:hover .article-info-popover, +.article-info-popover:hover { + display: block !important; +} + +.article-info-popover::before { + content: ''; + position: absolute; + top: -25px; + bottom: -25px; + left: -30px; + right: -80px; + background: transparent; + pointer-events: auto; } \ No newline at end of file diff --git a/public/js/views/emailCompose.js b/public/js/views/emailCompose.js index 7f11fe9..6f05434 100644 --- a/public/js/views/emailCompose.js +++ b/public/js/views/emailCompose.js @@ -96,14 +96,30 @@ const EmailCompose = (() => { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); overflow: hidden; - background: var(--bg-tertiary); + background: #ffffff; + color: #1e293b; + } + [data-theme="dark"] #email-compose-modal .ec-editor-wrapper, + body.dark-mode #email-compose-modal .ec-editor-wrapper { + background: #0f172a; + color: #f8fafc; } #email-compose-modal .ec-editor-wrapper .ql-toolbar { border: none; border-bottom: 1px solid var(--border-subtle); background: var(--bg-secondary); } #email-compose-modal .ec-editor-wrapper .ql-container { - border: none; min-height: 220px; font-size: 0.9rem; + border: none; min-height: 260px; font-size: 0.92rem; font-family: Inter, -apple-system, sans-serif; + } + #email-compose-modal .ec-editor-wrapper .ql-editor { + min-height: 260px; + padding: 16px; + line-height: 1.6; + color: inherit; + } + #email-compose-modal .ec-editor-wrapper .ql-editor.ql-blank::before { + color: var(--text-muted); + font-style: normal; } #email-compose-modal .ec-attachments-zone { border: 2px dashed var(--border-subtle); diff --git a/public/js/views/ticketDetail.js b/public/js/views/ticketDetail.js index af907cc..b92ea2d 100644 --- a/public/js/views/ticketDetail.js +++ b/public/js/views/ticketDetail.js @@ -1962,7 +1962,7 @@ const TicketDetailView = { const extractedLinks = this.extractLinks(processedBody || a.a_body || ''); return ` -
+
${a.sender_type || 'System'} @@ -1972,6 +1972,74 @@ const TicketDetailView = { + + + + @@ -2007,65 +2075,20 @@ const TicketDetailView = {
${a.a_subject ? `
${App.escapeHtml(a.a_subject)}
` : ''} -
-
- ${displayBody} - - ${visibleAttachments.length > 0 ? ` -
- ${visibleAttachments.map(att => ` - - 📎 - ${App.escapeHtml(att.filename)} - (${Math.round(att.content_size / 1024)} KB) - - `).join('')} -
- ` : ''} -
- - -
-
- - Dettagli Mail +
+ ${displayBody} + + ${visibleAttachments.length > 0 ? ` +
+ ${visibleAttachments.map(att => ` + + 📎 + ${App.escapeHtml(att.filename)} + (${Math.round(att.content_size / 1024)} KB) + + `).join('')}
-
- Da: - ${App.escapeHtml(a.a_from || '—')} -
-
- A: - ${App.escapeHtml(a.a_to || '—')} -
- ${a.a_cc ? ` -
- Cc: - ${App.escapeHtml(a.a_cc)} -
- ` : ''} - -
- - - Link contenuti - - ${extractedLinks.length} -
- - ${extractedLinks.length > 0 ? ` -
- ${extractedLinks.map(link => ` - - 🌐 - ${App.escapeHtml(link.text || link.url)} - - `).join('')} -
- ` : ` -
Nessun link presente
- `} -
+ ` : ''}
`; @@ -2695,9 +2718,10 @@ const TicketDetailView = { if (!article) return; if (window.EmailCompose) { - const hasHtml = (article.a_content_type || '').toLowerCase().includes('html') || article.a_body.includes(''); + const rawQuotedBody = article.html_body || article.a_body || ''; + const hasHtml = article.has_html || (article.a_content_type || '').toLowerCase().includes('html') || rawQuotedBody.includes(''); - let processedQuoted = article.a_body || ''; + let processedQuoted = rawQuotedBody; if (hasHtml) { const articleAttachments = (attachments || []).filter(att => att.article_id === article.article_id); articleAttachments.forEach(att => { @@ -2721,8 +2745,8 @@ const TicketDetailView = { const initialBodyHtml = `


-

Il ${App.formatDateTime(article.create_time)}, ${App.escapeHtml(article.a_from || 'Sistema')} ha scritto:

-
+

Il ${App.formatDateTime(article.create_time)}, ${App.escapeHtml(article.a_from || 'Sistema')} ha scritto:

+
${quotedBody}


@@ -2786,6 +2810,27 @@ const TicketDetailView = { }); }); + // Event listener for email address copy buttons inside popover + container.querySelectorAll('.btn-copy-email-addr').forEach(btn => { + btn.addEventListener('click', (e) => { + e.stopPropagation(); + const textToCopy = btn.dataset.copyText || ''; + if (textToCopy) { + navigator.clipboard.writeText(textToCopy).then(() => { + const origText = btn.textContent; + btn.textContent = '✓ Copiato!'; + btn.style.color = 'var(--success)'; + setTimeout(() => { + btn.textContent = origText; + btn.style.color = 'var(--text-secondary)'; + }, 1500); + }).catch(err => { + Toast.error('Impossibile copiare: ' + err.message); + }); + } + }); + }); + // Retrodate Ticket Event Listeners const btnEditTicketDate = document.getElementById('btn-edit-ticket-date'); const ticketDateEditor = document.getElementById('ticket-date-editor');