feat: Enhance email actions UI with improved layout and attachment handling
This commit is contained in:
parent
7f325b5c32
commit
c4c9b8a04a
@ -263,12 +263,10 @@
|
||||
}
|
||||
|
||||
.email-actions {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
padding: 1rem 1.5rem;
|
||||
border-bottom: 1px solid rgba(0,0,0,0.05);
|
||||
background: var(--bg-body);
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.email-actions .btn-primary {
|
||||
@ -1111,7 +1109,8 @@ function renderEmailDetail(email) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="email-actions">
|
||||
<div class="email-actions d-flex justify-content-between align-items-center">
|
||||
<div class="d-flex gap-2">
|
||||
<button class="btn btn-sm btn-light border" onclick="archiveEmail()" title="Arkivér (e)">
|
||||
<i class="bi bi-archive"></i>
|
||||
</button>
|
||||
@ -1125,13 +1124,35 @@ function renderEmailDetail(email) {
|
||||
<i class="bi bi-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
${email.attachments && email.attachments.length > 0 ? `
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<span class="text-muted"><i class="bi bi-paperclip me-1"></i>${email.attachments.length} vedhæftning${email.attachments.length > 1 ? 'er' : ''}</span>
|
||||
${email.attachments.map(att => {
|
||||
const canPreview = canPreviewFile(att.content_type);
|
||||
return `
|
||||
${canPreview ? `
|
||||
<button onclick="previewAttachment(${email.id}, ${att.id}, '${escapeHtml(att.filename)}', '${att.content_type}')"
|
||||
class="btn btn-sm btn-outline-primary" title="Se ${att.filename}">
|
||||
<i class="bi bi-eye me-1"></i>${att.filename}
|
||||
</button>
|
||||
` : `
|
||||
<a href="/api/v1/emails/${email.id}/attachments/${att.id}"
|
||||
class="btn btn-sm btn-outline-secondary"
|
||||
download="${att.filename}"
|
||||
title="Download ${att.filename}">
|
||||
<i class="bi bi-download me-1"></i>${att.filename}
|
||||
</a>
|
||||
`}
|
||||
`;
|
||||
}).join('')}
|
||||
</div>
|
||||
` : ''}
|
||||
</div>
|
||||
|
||||
<div class="email-body">
|
||||
${email.body_html ? `<iframe srcdoc="${email.body_html.replace(/"/g, '"')}"></iframe>` :
|
||||
`<pre style="white-space: pre-wrap; font-family: inherit;">${escapeHtml(email.body_text || 'Ingen indhold')}</pre>`}
|
||||
</div>
|
||||
|
||||
${attachmentsHtml}
|
||||
`;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user