Skip to content

Commit ceee099

Browse files
committed
refactor: miglioria header attività
1 parent 8cd643a commit ceee099

File tree

6 files changed

+218
-50
lines changed

6 files changed

+218
-50
lines changed

assets/src/css/style.css

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1505,6 +1505,69 @@ kbd{
15051505
z-index: 10;
15061506
}
15071507

1508+
/* Stili per le icone di stato nella card centrale dell'header */
1509+
.status-item {
1510+
transition: all 0.3s ease;
1511+
border-radius: 6px;
1512+
}
1513+
1514+
.status-icon {
1515+
width: 28px;
1516+
height: 28px;
1517+
display: flex;
1518+
align-items: center;
1519+
justify-content: center;
1520+
border-radius: 50%;
1521+
transition: all 0.3s ease;
1522+
}
1523+
1524+
.status-icon i {
1525+
font-size: 12px;
1526+
}
1527+
1528+
.status-text {
1529+
font-weight: normal;
1530+
}
1531+
1532+
/* Stili specifici per ciascuna icona */
1533+
.insoluti-item:hover .badge-danger {
1534+
background-color: #dc3545;
1535+
}
1536+
1537+
.insoluti-item:hover .badge-success {
1538+
background-color: #28a745;
1539+
}
1540+
1541+
.attivita-item:hover .badge-warning {
1542+
background-color: #ffc107;
1543+
}
1544+
1545+
.attivita-item:hover .badge-success {
1546+
background-color: #28a745;
1547+
}
1548+
1549+
.contratto-item:hover .badge-info,
1550+
.preventivo-item:hover .badge-info,
1551+
.ordine-item:hover .badge-info {
1552+
background-color: #17a2b8;
1553+
}
1554+
1555+
/* Effetto hover per i pulsanti delle attività */
1556+
.btn-outline-primary.btn-sm:hover {
1557+
color: white !important;
1558+
}
1559+
1560+
.btn-outline-primary.btn-sm:hover .badge-light {
1561+
color: white !important;
1562+
}
1563+
1564+
/* Effetto hover per cambiare il testo in bianco */
1565+
.btn-outline-primary.btn-sm:hover,
1566+
.btn-outline-primary.btn-sm:hover span,
1567+
.btn-outline-primary.btn-sm:hover i {
1568+
color: white !important;
1569+
}
1570+
15081571
.login-box .form-control-feedback{
15091572
pointer-events: all;
15101573
}
@@ -2165,6 +2228,31 @@ body:not(.sidebar-collapse) .sidebar .nav-treeview .nav-treeview .nav-link {
21652228
opacity:1 !important;
21662229
}
21672230

2231+
/* Improved styling for unpaid items and open activities */
2232+
.badge-danger i.fa, .badge-success i.fa, .badge-warning i.fa {
2233+
font-size: 14px;
2234+
}
2235+
2236+
/* Remove bold formatting from activity status text */
2237+
.font-weight-bold {
2238+
font-weight: normal !important;
2239+
}
2240+
2241+
/* Activity buttons hover effect */
2242+
.btn-outline-primary.btn-sm:hover {
2243+
background-color: #007bff;
2244+
color: white !important;
2245+
}
2246+
2247+
.btn-outline-primary.btn-sm:hover i,
2248+
.btn-outline-primary.btn-sm:hover .badge {
2249+
color: white !important;
2250+
}
2251+
2252+
.btn-outline-primary.btn-sm:hover .badge-light {
2253+
background-color: rgba(255, 255, 255, 0.2) !important;
2254+
}
2255+
21682256
@media screen and (max-width: 767px) {
21692257
.navbar-left {
21702258
display: inline-block;

assets/src/js/base/navigation.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,12 @@ $(document).ready(function () {
6565
$('a[data-widget="tab"]').on('shown.bs.tab', function (e) {
6666
$($.fn.dataTable.tables(true)).DataTable().columns.adjust();
6767
$($.fn.dataTable.tables(true)).DataTable().scroller.measure();
68+
69+
// Reinizializza readmore per il contenuto del tab
70+
if (typeof initTextShortener === 'function') {
71+
setTimeout(function() {
72+
initTextShortener();
73+
}, 100);
74+
}
6875
});
6976
});

assets/src/js/base/sidebar.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ $(document).ready(function () {
7272

7373
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
7474
window.dispatchEvent(new Event('resize'));
75+
76+
// Reinizializza readmore per il contenuto del tab
77+
if (typeof initTextShortener === 'function') {
78+
setTimeout(function() {
79+
initTextShortener();
80+
}, 100);
81+
}
7582
});
7683
});
7784

assets/src/js/functions/text-shortener.js

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,14 @@
1010
function initTextShortener() {
1111
// Converti elementi che usano jquery.shorten a readmore.js
1212
$('.shorten').each(function() {
13+
// Verifica se l'elemento è già stato inizializzato
14+
if ($(this).data('readmore')) {
15+
return;
16+
}
17+
1318
// Ottieni eventuali opzioni personalizzate dall'elemento
1419
const showChars = $(this).data('show-chars') || 70;
15-
20+
1621
// Inizializza readmore.js con opzioni compatibili
1722
$(this).readmore({
1823
collapsedHeight: 0, // Collassa completamente
@@ -27,12 +32,12 @@ function initTextShortener() {
2732
if (text.length > showChars) {
2833
const visibleText = text.substr(0, showChars);
2934
const hiddenText = text.substr(showChars, text.length - showChars);
30-
35+
3136
$(element).html(
3237
'<span class="shortcontent">' + visibleText + '...</span>' +
3338
'<span class="allcontent">' + text + '</span>'
3439
);
35-
40+
3641
$(element).find('.allcontent').hide();
3742
}
3843
} else {
@@ -48,8 +53,13 @@ function initTextShortener() {
4853

4954
// Inizializza readmore.js su elementi con classe .readmore
5055
$('.readmore').each(function() {
56+
// Verifica se l'elemento è già stato inizializzato
57+
if ($(this).data('readmore')) {
58+
return;
59+
}
60+
5161
const height = $(this).data('height') ? parseInt($(this).data('height')) : 50;
52-
62+
5363
$(this).readmore({
5464
collapsedHeight: height,
5565
moreLink: '<a href="#">' + (globals.translations.readmore || 'Leggi tutto') + '</a>',
@@ -61,7 +71,32 @@ function initTextShortener() {
6171
});
6272
}
6373

74+
/**
75+
* Reinizializza readmore.js su elementi specifici
76+
* Utile quando il contenuto viene caricato dinamicamente
77+
* @param {string} selector - Selettore CSS per gli elementi da reinizializzare
78+
*/
79+
function reinitReadmore(selector) {
80+
// Rimuovi l'inizializzazione precedente
81+
$(selector).each(function() {
82+
if ($(this).data('readmore')) {
83+
$(this).readmore('destroy');
84+
}
85+
});
86+
87+
// Reinizializza
88+
initTextShortener();
89+
}
90+
6491
// Inizializza quando il documento è pronto
6592
$(document).ready(function() {
6693
initTextShortener();
94+
95+
// Reinizializza quando si cambia tab o si carica un plugin
96+
$(document).on('shown.bs.tab', 'a[data-toggle="tab"]', function() {
97+
// Timeout per assicurarsi che il contenuto sia completamente caricato
98+
setTimeout(function() {
99+
initTextShortener();
100+
}, 100);
101+
});
67102
});

include/top.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,14 @@ function checkActiveTab() {
671671
672672
// Controlla anche quando viene cliccato un tab nella barra laterale
673673
$("a[data-toggle=\'control-sidebar\']").on("click", function() {
674-
setTimeout(checkActiveTab, 100); // Piccolo ritardo per assicurarsi che il tab sia cambiato
674+
setTimeout(function() {
675+
checkActiveTab();
676+
677+
// Reinizializza readmore per il contenuto del plugin
678+
if (typeof initTextShortener === "function") {
679+
initTextShortener();
680+
}
681+
}, 100); // Piccolo ritardo per assicurarsi che il tab sia cambiato
675682
});
676683
});
677684
</script>';

0 commit comments

Comments
 (0)