Skip to content

Commit ddd8d3d

Browse files
Merge pull request #17 from dynamiatools/5.4.x
Upgrade to DynamiaTools v5.4.12
2 parents 8735c2f + 7071568 commit ddd8d3d

7 files changed

Lines changed: 108 additions & 15 deletions

File tree

sources/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
<groupId>tools.dynamia.themes</groupId>
2525
<artifactId>tools.dynamia.themes.dynamical</artifactId>
26-
<version>5.4.1</version>
26+
<version>5.4.12</version>
2727
<name>Themes - ZK Dynamical</name>
2828
<url>https://www.dynamia.tools/themes/dynamical</url>
2929
<description>Boostrap theme for DynamiaTools apps</description>
@@ -56,7 +56,7 @@
5656
</scm>
5757

5858
<properties>
59-
<dynamiatools.version>5.4.1</dynamiatools.version>
59+
<dynamiatools.version>5.4.12</dynamiatools.version>
6060
<java.version>21</java.version>
6161
<maven.compiler>3.14.0</maven.compiler>
6262
<source.encoding>UTF-8</source.encoding>

sources/src/main/java/tools/dynamia/themes/dynamical/viewers/DynamicalCrudView.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717

1818
package tools.dynamia.themes.dynamical.viewers;
1919

20-
import tools.dynamia.ui.icons.IconSize;
2120
import tools.dynamia.zk.crud.CrudViewRenderer;
22-
import tools.dynamia.zk.util.ZKUtil;
2321
import tools.dynamia.zk.viewers.BootstrapCrudView;
2422

2523
public class DynamicalCrudView<T> extends BootstrapCrudView<T> {

sources/src/main/resources/web/templates/dynamical/static/css/dynamical.css

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ li.title-menu a span {
200200
--bs-modal-border-width: var(--bs-border-width);
201201
--bs-modal-border-radius: var(--bs-border-radius-lg);
202202
--bs-modal-box-shadow: var(--bs-box-shadow-sm);
203-
--bs-modal-inner-border-radius: calc(var(--bs-border-radius-lg) -(var(--bs-border-width)));
203+
--bs-modal-inner-border-radius: calc(var(--bs-border-radius-lg) - (var(--bs-border-width)));
204204
--bs-modal-header-padding-x: 1rem;
205205
--bs-modal-header-padding-y: 1rem;
206206
--bs-modal-header-padding: 1rem 1rem;
@@ -313,6 +313,13 @@ input[type=checkbox] {
313313
text-align: center;
314314
}
315315

316+
.dark-mode .actiontb-a.z-toolbarbutton {
317+
background: var(--dt-background-dark-hover);
318+
height: 30px !important;
319+
min-width: 30px;
320+
text-align: center;
321+
}
322+
316323
.actiontb-a.btn {
317324
padding: 2px 7px;
318325
height: 30px;
@@ -703,7 +710,30 @@ input[type=checkbox] {
703710
border-color: transparent;
704711
}
705712

713+
714+
706715
.z-listheader-content,
707716
.z-treecol-content {
708717
color: #2d3238;
709718
}
719+
720+
body.dark-mode img[src="/static/dynamia-tools/images/no-photo.jpg"] {
721+
filter: brightness(0.7) invert(1);
722+
}
723+
724+
.dark-mode .z-listbox-footer .z-listfooter {
725+
background: var(--dt-background-dark);
726+
border-color: transparent;
727+
}
728+
729+
.dark-mode .dark-mode-switch .dark-icon {
730+
display: none;
731+
}
732+
733+
.dark-mode-switch .light-icon{
734+
display: none;
735+
}
736+
737+
.dark-mode .dark-mode-switch .light-icon{
738+
display: inline;
739+
}

sources/src/main/resources/web/templates/dynamical/static/js/bootstrap.min.js

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
function initDarkMode(toggleSelector) {
2+
const body = document.body;
3+
const toggleBtn = document.querySelector(toggleSelector);
4+
5+
// Función para aplicar modo según preferencia
6+
function applyTheme(theme) {
7+
if (theme === "dark") {
8+
body.classList.add("dark-mode");
9+
body.classList.remove("light-mode");
10+
} else {
11+
body.classList.add("light-mode");
12+
body.classList.remove("dark-mode");
13+
}
14+
localStorage.setItem("theme", theme);
15+
}
16+
17+
// Inicializar: leer localStorage o usar default "light"
18+
const savedTheme = localStorage.getItem("theme") || "light";
19+
applyTheme(savedTheme);
20+
21+
// Toggle al dar clic
22+
toggleBtn.addEventListener("click", () => {
23+
const newTheme = body.classList.contains("dark-mode") ? "light" : "dark";
24+
applyTheme(newTheme);
25+
});
26+
}
27+
28+
function detectDevice() {
29+
const body = document.body;
30+
body.classList.remove("device-smartphone", "device-tablet", "device-desktop");
31+
32+
const width = window.innerWidth;
33+
34+
if (width <= 767) {
35+
body.classList.add("device-smartphone");
36+
} else if (width <= 1024) {
37+
body.classList.add("device-tablet");
38+
} else {
39+
body.classList.add("device-desktop");
40+
}
41+
}
42+
43+
44+
zk.afterMount(function () {
45+
initDarkMode(".dark-mode-switch");
46+
detectDevice();
47+
window.addEventListener("resize", detectDevice);
48+
});

sources/src/main/resources/web/templates/dynamical/views/index.zul

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
<?meta name="skin" content="${appTemplate.skin.id}"?>
3131
<?link rel="manifest" href="/manifest.json"?>
3232

33-
<?link href="${contextPath}/static/css/adminlte.min.css?v=5.4.1" rel="stylesheet" type="text/css"?>
34-
<?link href="${contextPath}/static/css/skins/dynamical-${appTemplate.skin.id}.css?v=5.4.1" rel="stylesheet" type="text/css"?>
35-
<?link href="${contextPath}/static/css/dynamical.css?v=5.4.1" rel="stylesheet" type="text/css"?>
36-
<?link href="${contextPath}/static/css/dynamical-mobile.css?v=5.4.1" rel="stylesheet" type="text/css"?>
33+
<?link href="${contextPath}/static/css/adminlte.min.css?v=5.4.12" rel="stylesheet" type="text/css"?>
34+
<?link href="${contextPath}/static/css/skins/dynamical-${appTemplate.skin.id}.css?v=5.4.12" rel="stylesheet" type="text/css"?>
35+
<?link href="${contextPath}/static/css/dynamical.css?v=5.4.12" rel="stylesheet" type="text/css"?>
36+
<?link href="${contextPath}/static/css/dynamical-mobile.css?v=5.4.12" rel="stylesheet" type="text/css"?>
3737
<?link href="${contextPath}/static/fonts/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css"?>
3838

3939
<?link rel="shortcut icon" href="${contextPath}/static/favicon.ico"?>
@@ -42,11 +42,13 @@
4242
<?link rel="icon" type="image/png" sizes="16x16" href="${contextPath}/static/favicon-16x16.png"?>
4343

4444

45-
<?script src="${contextPath}/static/js/adminlte.min.js?v=5.4.1"?>
46-
<?script src="${contextPath}/static/js/dynamical.js?v=5.4.1"?>
45+
<?script src="${contextPath}/static/js/popper.min.js?v=5.4.12"?>
46+
<?script src="${contextPath}/static/js/bootstrap.min.js?v=5.4.12"?>
47+
<?script src="${contextPath}/static/js/adminlte.min.js?v=5.4.12"?>
48+
<?script src="${contextPath}/static/js/dynamical.js?v=5.4.12"?>
49+
<?script src="${contextPath}/static/js/dark-mode.js?v=5.4.12"?>
4750

48-
49-
<zk>
51+
<zk >
5052
<import src="classpath:/zk/dynamical/index-main.zul"/>
5153

5254

sources/src/main/resources/zk/dynamical/index-main.zul

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@
3535
</li>
3636
</z:zk>
3737

38+
<li class="nav-item">
39+
<a class="nav-link dark-mode-switch" href="#">
40+
<i class="fa fa-moon dark-icon"/>
41+
<i class="fa fa-sun light-icon"/>
42+
</a>
43+
</li>
3844

3945
<li class="nav-item">
4046
<a class="nav-link" data-lte-toggle="fullscreen" href="#">
@@ -43,9 +49,11 @@
4349
</a>
4450
</li>
4551

52+
<!-- User Account: style can be found in dropdown.less -->
4653
<z:zk if="${userInfo.enabled}">
4754
<li class="nav-item dropdown user-menu">
48-
<a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown">
55+
<a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown"
56+
aria-expanded="false">
4957
<img src="${userInfo.image}" class="user-image shadow"/>
5058
<span class="d-none d-md-inline">${userInfo.fullName}</span>
5159
</a>
@@ -65,7 +73,7 @@
6573
<li class="user-footer">
6674
<div class="pull-left">
6775
<z:a zclass="btn btn-primary btn-flat" label=" ${labels.profile}"
68-
iconSclass="fa fa-user"
76+
iconSclass="fa fa-user" if="${userInfo.profilePath != null}"
6977
onClick='navManager.navigateTo(userInfo.profilePath)'/>
7078

7179
</div>

0 commit comments

Comments
 (0)