fixed import fogli di lavoro and disegni tecnici
This commit is contained in:
@@ -1912,7 +1912,9 @@ if (!empty($_GET['ajax'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
const files = r.attachments || [];
|
||||
const files = (r.attachments || []).sort((a, b) =>
|
||||
(parseInt(b.is_disegno, 10) || 0) - (parseInt(a.is_disegno, 10) || 0)
|
||||
);
|
||||
|
||||
if (!files.length) {
|
||||
$("#matriceFilesList").html('<div style="color:#64748b;">Nessun allegato disponibile per questa matrice.</div>');
|
||||
@@ -1929,6 +1931,7 @@ if (!empty($_GET['ajax'])) {
|
||||
const ext = getFileExt(fileName);
|
||||
const icon = getFileIcon(ext);
|
||||
const badge = getFileBadge(ext);
|
||||
const isDisegno = (parseInt(f.is_disegno, 10) || 0) === 1;
|
||||
|
||||
let actionHtml = '';
|
||||
if (isImageExt(ext) || ext === 'pdf') {
|
||||
@@ -1966,7 +1969,9 @@ if (!empty($_GET['ajax'])) {
|
||||
}
|
||||
|
||||
html += `
|
||||
<div style="border:1px solid #e2e8f0; border-radius:14px; padding:12px; background:#fff;">
|
||||
<div style="${isDisegno
|
||||
? 'border:2px solid #6f42c1; background:#f7f3ff;'
|
||||
: 'border:1px solid #e2e8f0; background:#fff;'} border-radius:14px; padding:12px;">
|
||||
<div style="display:flex; gap:14px; align-items:flex-start;">
|
||||
<div>${previewHtml}</div>
|
||||
|
||||
@@ -1974,7 +1979,10 @@ if (!empty($_GET['ajax'])) {
|
||||
<div style="display:flex; justify-content:space-between; align-items:flex-start; gap:12px;">
|
||||
<div>
|
||||
<div style="font-weight:700; color:#1f2d3d;">${escapeHtml(fileName)}</div>
|
||||
<div style="margin-top:4px;">${badge}</div>
|
||||
<div style="margin-top:4px; display:flex; gap:6px; flex-wrap:wrap; align-items:center;">
|
||||
${badge}
|
||||
${isDisegno ? '<span style="background:#6f42c1;color:#fff;padding:3px 10px;border-radius:999px;font-size:0.78rem;font-weight:700;">📐 Disegno tecnico</span>' : ''}
|
||||
</div>
|
||||
${createdAt ? `<div style="margin-top:6px; color:#64748b; font-size:0.88rem;">${escapeHtml(createdAt)}</div>` : ''}
|
||||
</div>
|
||||
<div>${actionHtml}</div>
|
||||
|
||||
Reference in New Issue
Block a user