Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sources/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<groupId>tools.dynamia.themes</groupId>
<artifactId>tools.dynamia.themes.dynamical</artifactId>
<version>5.4.1</version>
<version>5.4.12</version>
<name>Themes - ZK Dynamical</name>
<url>https://www.dynamia.tools/themes/dynamical</url>
<description>Boostrap theme for DynamiaTools apps</description>
Expand Down Expand Up @@ -56,7 +56,7 @@
</scm>

<properties>
<dynamiatools.version>5.4.1</dynamiatools.version>
<dynamiatools.version>5.4.12</dynamiatools.version>
<java.version>21</java.version>
<maven.compiler>3.14.0</maven.compiler>
<source.encoding>UTF-8</source.encoding>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@

package tools.dynamia.themes.dynamical.viewers;

import tools.dynamia.ui.icons.IconSize;
import tools.dynamia.zk.crud.CrudViewRenderer;
import tools.dynamia.zk.util.ZKUtil;
import tools.dynamia.zk.viewers.BootstrapCrudView;

public class DynamicalCrudView<T> extends BootstrapCrudView<T> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ li.title-menu a span {
--bs-modal-border-width: var(--bs-border-width);
--bs-modal-border-radius: var(--bs-border-radius-lg);
--bs-modal-box-shadow: var(--bs-box-shadow-sm);
--bs-modal-inner-border-radius: calc(var(--bs-border-radius-lg) -(var(--bs-border-width)));
--bs-modal-inner-border-radius: calc(var(--bs-border-radius-lg) - (var(--bs-border-width)));
--bs-modal-header-padding-x: 1rem;
--bs-modal-header-padding-y: 1rem;
--bs-modal-header-padding: 1rem 1rem;
Expand Down Expand Up @@ -313,6 +313,13 @@ input[type=checkbox] {
text-align: center;
}

.dark-mode .actiontb-a.z-toolbarbutton {
background: var(--dt-background-dark-hover);
height: 30px !important;
min-width: 30px;
text-align: center;
}

.actiontb-a.btn {
padding: 2px 7px;
height: 30px;
Expand Down Expand Up @@ -703,7 +710,30 @@ input[type=checkbox] {
border-color: transparent;
}



.z-listheader-content,
.z-treecol-content {
color: #2d3238;
}

body.dark-mode img[src="/static/dynamia-tools/images/no-photo.jpg"] {
filter: brightness(0.7) invert(1);
}

.dark-mode .z-listbox-footer .z-listfooter {
background: var(--dt-background-dark);
border-color: transparent;
}

.dark-mode .dark-mode-switch .dark-icon {
display: none;
}

.dark-mode-switch .light-icon{
display: none;
}

.dark-mode .dark-mode-switch .light-icon{
Comment on lines +733 to +737
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a missing space after the colon in the CSS selector. This should be .dark-mode-switch .light-icon { (with a space before the opening brace).

Suggested change
.dark-mode-switch .light-icon{
display: none;
}
.dark-mode .dark-mode-switch .light-icon{
.dark-mode-switch .light-icon {
display: none;
}
.dark-mode .dark-mode-switch .light-icon {

Copilot uses AI. Check for mistakes.
display: inline;
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
function initDarkMode(toggleSelector) {
const body = document.body;
const toggleBtn = document.querySelector(toggleSelector);

// Función para aplicar modo según preferencia
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spanish comment in JavaScript code. Consider using English for consistency with the rest of the codebase.

Copilot uses AI. Check for mistakes.
function applyTheme(theme) {
if (theme === "dark") {
body.classList.add("dark-mode");
body.classList.remove("light-mode");
} else {
body.classList.add("light-mode");
body.classList.remove("dark-mode");
}
localStorage.setItem("theme", theme);
}

// Inicializar: leer localStorage o usar default "light"
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spanish comment in JavaScript code. Consider using English for consistency with the rest of the codebase.

Copilot uses AI. Check for mistakes.
const savedTheme = localStorage.getItem("theme") || "light";
applyTheme(savedTheme);

// Toggle al dar clic
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spanish comment in JavaScript code. Consider using English for consistency with the rest of the codebase.

Copilot uses AI. Check for mistakes.
toggleBtn.addEventListener("click", () => {
const newTheme = body.classList.contains("dark-mode") ? "light" : "dark";
applyTheme(newTheme);
});
Comment on lines +21 to +25
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The toggleBtn element existence should be validated before adding an event listener. If the selector doesn't match any element, this will throw an error when trying to call addEventListener on null.

Suggested change
// Toggle al dar clic
toggleBtn.addEventListener("click", () => {
const newTheme = body.classList.contains("dark-mode") ? "light" : "dark";
applyTheme(newTheme);
});
// Toggle al dar clic (solo si el elemento existe)
if (toggleBtn) {
toggleBtn.addEventListener("click", () => {
const newTheme = body.classList.contains("dark-mode") ? "light" : "dark";
applyTheme(newTheme);
});
}

Copilot uses AI. Check for mistakes.
}

function detectDevice() {
const body = document.body;
body.classList.remove("device-smartphone", "device-tablet", "device-desktop");

const width = window.innerWidth;

if (width <= 767) {
body.classList.add("device-smartphone");
} else if (width <= 1024) {
body.classList.add("device-tablet");
} else {
body.classList.add("device-desktop");
}
}


zk.afterMount(function () {
initDarkMode(".dark-mode-switch");
detectDevice();
window.addEventListener("resize", detectDevice);
});
18 changes: 10 additions & 8 deletions sources/src/main/resources/web/templates/dynamical/views/index.zul
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
<?meta name="skin" content="${appTemplate.skin.id}"?>
<?link rel="manifest" href="/manifest.json"?>

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

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


<?script src="${contextPath}/static/js/adminlte.min.js?v=5.4.1"?>
<?script src="${contextPath}/static/js/dynamical.js?v=5.4.1"?>
<?script src="${contextPath}/static/js/popper.min.js?v=5.4.12"?>
<?script src="${contextPath}/static/js/bootstrap.min.js?v=5.4.12"?>
<?script src="${contextPath}/static/js/adminlte.min.js?v=5.4.12"?>
<?script src="${contextPath}/static/js/dynamical.js?v=5.4.12"?>
<?script src="${contextPath}/static/js/dark-mode.js?v=5.4.12"?>


<zk>
<zk >
<import src="classpath:/zk/dynamical/index-main.zul"/>


Expand Down
12 changes: 10 additions & 2 deletions sources/src/main/resources/zk/dynamical/index-main.zul
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
</li>
</z:zk>

<li class="nav-item">
<a class="nav-link dark-mode-switch" href="#">
<i class="fa fa-moon dark-icon"/>
<i class="fa fa-sun light-icon"/>
</a>
</li>

<li class="nav-item">
<a class="nav-link" data-lte-toggle="fullscreen" href="#">
Expand All @@ -43,9 +49,11 @@
</a>
</li>

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

</div>
Expand Down