fixed table dscaeznairio

This commit is contained in:
2026-07-19 15:17:18 +02:00
parent 58af735082
commit f2cb6343f7
+59 -4
View File
@@ -653,6 +653,38 @@ function getContrastTextColor($hexColor)
width: 100%; width: 100%;
} }
} }
/* Law badge */
.law-badge {
display: inline-flex;
align-items: center;
gap: 0.25rem;
padding: 0.1rem 0.45rem;
border-radius: 0.35rem;
font-size: 0.68rem;
font-weight: 700;
background: #eef3ff;
color: var(--scad-primary);
border: 1px solid #d0d9e8;
cursor: pointer;
vertical-align: middle;
white-space: nowrap;
}
.law-badge:hover {
background: var(--scad-primary);
color: #fff;
border-color: var(--scad-primary);
}
.popover {
max-width: 320px;
}
.popover-body {
font-size: 0.85rem;
color: var(--scad-heading);
}
</style> </style>
</head> </head>
@@ -970,7 +1002,6 @@ function getContrastTextColor($hexColor)
<tr> <tr>
<th style="width:110px">Argomento</th> <th style="width:110px">Argomento</th>
<th>Dettaglio</th> <th>Dettaglio</th>
<th class="d-none d-lg-table-cell">Legge/Art.</th>
<th>Scadenza</th> <th>Scadenza</th>
<th class="d-none d-lg-table-cell">Verifica</th> <th class="d-none d-lg-table-cell">Verifica</th>
<th>Funzione</th> <th>Funzione</th>
@@ -1025,8 +1056,18 @@ function getContrastTextColor($hexColor)
<?php if ((int)$row['attachment_count'] > 0): ?> <?php if ((int)$row['attachment_count'] > 0): ?>
<span class="text-muted ms-1" title="<?= (int)$row['attachment_count'] ?> allegati"><i class="fa-solid fa-paperclip"></i> <?= (int)$row['attachment_count'] ?></span> <span class="text-muted ms-1" title="<?= (int)$row['attachment_count'] ?> allegati"><i class="fa-solid fa-paperclip"></i> <?= (int)$row['attachment_count'] ?></span>
<?php endif; ?> <?php endif; ?>
<?php if (!empty($row['law_regulation'])): ?>
<span class="law-badge ms-1 js-law-popover"
data-bs-toggle="popover"
data-bs-trigger="focus"
data-bs-placement="top"
data-bs-title="Legge / Articolo"
data-bs-content="<?= htmlspecialchars($row['law_regulation'], ENT_QUOTES, 'UTF-8') ?>"
tabindex="0" role="button">
<i class="fa-solid fa-scale-balanced"></i> Legge
</span>
<?php endif; ?>
</td> </td>
<td class="d-none d-lg-table-cell text-muted"><?= htmlspecialchars($row['law_regulation'] ?? '—', ENT_QUOTES, 'UTF-8') ?></td>
<td><span class="text-nowrap"><?= $row['_dueFmt'] ?></span></td> <td><span class="text-nowrap"><?= $row['_dueFmt'] ?></span></td>
<td class="d-none d-lg-table-cell text-muted"><?= $row['_checkFmt'] ?></td> <td class="d-none d-lg-table-cell text-muted"><?= $row['_checkFmt'] ?></td>
@@ -1133,7 +1174,7 @@ function getContrastTextColor($hexColor)
if ($('#deadlinesTable').length) { if ($('#deadlinesTable').length) {
table = $('#deadlinesTable').DataTable({ table = $('#deadlinesTable').DataTable({
order: [ order: [
[3, 'asc'] [2, 'asc']
], ],
pageLength: 25, pageLength: 25,
language: { language: {
@@ -1145,7 +1186,21 @@ function getContrastTextColor($hexColor)
}] }]
}); });
} }
// --- Popover Legge/Articolo ---
function initLawPopovers() {
$('.js-law-popover').each(function() {
if (!bootstrap.Popover.getInstance(this)) {
new bootstrap.Popover(this, {
html: false,
container: 'body'
});
}
});
}
initLawPopovers();
if (table) {
table.on('draw', initLawPopovers);
}
// --- Filters --- // --- Filters ---
function filterCards() { function filterCards() {
var statusVal = $('#filterStatus').val(); var statusVal = $('#filterStatus').val();