added departments
This commit is contained in:
@@ -196,6 +196,61 @@ function getContrastTextColor($hexColor)
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
/* Quick filter buttons */
|
||||
.btn-quick-filter {
|
||||
border: none;
|
||||
font-weight: 700;
|
||||
font-size: 0.85rem;
|
||||
height: 38px;
|
||||
padding: 0 0.85rem;
|
||||
border-radius: 0.55rem;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.45rem;
|
||||
transition: all 0.2s ease;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.btn-quick-warning {
|
||||
background: #fff3cd;
|
||||
color: #8a5a00;
|
||||
border: 1px solid #ffd966;
|
||||
}
|
||||
|
||||
.btn-quick-warning:hover,
|
||||
.btn-quick-warning.active {
|
||||
background: #ffc107;
|
||||
color: #000;
|
||||
box-shadow: 0 4px 12px rgba(255, 193, 7, 0.35);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.btn-quick-danger {
|
||||
background: #fde2e6;
|
||||
color: #b02a37;
|
||||
border: 1px solid #f5a3ad;
|
||||
}
|
||||
|
||||
.btn-quick-danger:hover,
|
||||
.btn-quick-danger.active {
|
||||
background: #dc3545;
|
||||
color: #fff;
|
||||
box-shadow: 0 4px 12px rgba(220, 53, 69, 0.35);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
@media (max-width: 575.98px) {
|
||||
.btn-quick-filter span {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.btn-quick-filter {
|
||||
width: 38px;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Action buttons */
|
||||
.btn-action {
|
||||
width: 32px;
|
||||
@@ -633,18 +688,31 @@ function getContrastTextColor($hexColor)
|
||||
|
||||
<!-- Filter Toolbar -->
|
||||
<div class="filter-toolbar mb-3">
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<div class="d-flex align-items-center gap-2 flex-wrap">
|
||||
<button type="button" class="btn btn-scad-outline d-inline-flex align-items-center gap-2 flex-shrink-0" data-bs-toggle="modal" data-bs-target="#filtersModal">
|
||||
<i class="fa-solid fa-filter"></i>
|
||||
<span>Filtri</span>
|
||||
<span id="filterCountBadge" class="badge bg-primary rounded-pill d-none" style="font-size:0.7rem">0</span>
|
||||
</button>
|
||||
|
||||
<button id="btnResetFilters" type="button" class="btn btn-light border d-inline-flex align-items-center justify-content-center gap-1 flex-shrink-0" title="Reset filtri" style="min-width:38px;height:38px">
|
||||
<i class="fa-solid fa-rotate-left"></i>
|
||||
<span class="d-none d-sm-inline">Reset</span>
|
||||
</button>
|
||||
|
||||
<button id="btnQuickApproaching" type="button" class="btn-quick-filter btn-quick-warning flex-shrink-0" title="Mostra scadenze in scadenza">
|
||||
<i class="fa-solid fa-triangle-exclamation"></i>
|
||||
<span>In scadenza</span>
|
||||
</button>
|
||||
|
||||
<button id="btnQuickOverdue" type="button" class="btn-quick-filter btn-quick-danger flex-shrink-0" title="Mostra scadenze scadute">
|
||||
<i class="fa-solid fa-circle-exclamation"></i>
|
||||
<span>Scadute</span>
|
||||
</button>
|
||||
|
||||
<span id="activeFiltersSummary" class="text-muted small text-truncate d-none d-md-inline"></span>
|
||||
</div>
|
||||
|
||||
<div id="activeFiltersSummaryMobile" class="text-muted small d-md-none mt-1" style="padding-left:0.25rem"></div>
|
||||
</div>
|
||||
|
||||
@@ -1116,9 +1184,9 @@ function getContrastTextColor($hexColor)
|
||||
locale: 'it',
|
||||
allowInput: false,
|
||||
onChange: function() {
|
||||
if (table) table.draw();
|
||||
filterCards();
|
||||
if (typeof updateFilterBadge === 'function') updateFilterBadge();
|
||||
if (typeof applyFiltersRefresh === 'function') {
|
||||
applyFiltersRefresh();
|
||||
}
|
||||
}
|
||||
};
|
||||
var fpDue = flatpickr('#filterDueRange', fpOpts);
|
||||
@@ -1313,10 +1381,22 @@ function getContrastTextColor($hexColor)
|
||||
}
|
||||
|
||||
$('#filterStatus, #filterDepartment, #filterEmployee, #filterSubject').on('change', function() {
|
||||
applyFiltersRefresh();
|
||||
});
|
||||
|
||||
function applyFiltersRefresh() {
|
||||
if (table) table.draw();
|
||||
filterCards();
|
||||
updateFilterBadge();
|
||||
});
|
||||
updateQuickFilterButtons();
|
||||
}
|
||||
|
||||
function updateQuickFilterButtons() {
|
||||
var statusVal = $('#filterStatus').val();
|
||||
|
||||
$('#btnQuickApproaching').toggleClass('active', statusVal === 'in-scadenza');
|
||||
$('#btnQuickOverdue').toggleClass('active', statusVal === 'scaduta');
|
||||
}
|
||||
|
||||
function resetFilters() {
|
||||
$('#filterStatus').val('non-completata');
|
||||
@@ -1325,12 +1405,22 @@ function getContrastTextColor($hexColor)
|
||||
$('#filterSubject').val('');
|
||||
fpDue.clear();
|
||||
fpCheck.clear();
|
||||
if (table) table.draw();
|
||||
filterCards();
|
||||
updateFilterBadge();
|
||||
|
||||
applyFiltersRefresh();
|
||||
}
|
||||
|
||||
$('#btnResetFilters, #btnResetFiltersModal').on('click', resetFilters);
|
||||
|
||||
$('#btnQuickApproaching').on('click', function() {
|
||||
$('#filterStatus').val('in-scadenza');
|
||||
applyFiltersRefresh();
|
||||
});
|
||||
|
||||
$('#btnQuickOverdue').on('click', function() {
|
||||
$('#filterStatus').val('scaduta');
|
||||
applyFiltersRefresh();
|
||||
});
|
||||
|
||||
// Apply URL filters (e.g. from dashboard widgets)
|
||||
(function() {
|
||||
var qs = new URLSearchParams(window.location.search);
|
||||
@@ -1339,9 +1429,7 @@ function getContrastTextColor($hexColor)
|
||||
})();
|
||||
|
||||
// Apply default filter on load
|
||||
if (table) table.draw();
|
||||
filterCards();
|
||||
updateFilterBadge();
|
||||
applyFiltersRefresh();
|
||||
|
||||
// --- Modal ---
|
||||
var modal = new bootstrap.Modal(document.getElementById('deadlineModal'));
|
||||
|
||||
Reference in New Issue
Block a user