Skip to content

Commit a63a527

Browse files
authored
Merge pull request #143 from cakephp/refactor-with-daisyui-and-htmx
Refactor UI with DaisyUI v5 and htmx
2 parents 108df28 + 1b4138e commit a63a527

File tree

17 files changed

+611
-166
lines changed

17 files changed

+611
-166
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: phpmyadmin
2+
repository: ddev/ddev-phpmyadmin
3+
version: v1.0.2
4+
install_date: "2026-04-04T16:48:16+02:00"
5+
project_files:
6+
- docker-compose.phpmyadmin.yaml
7+
- docker-compose.phpmyadmin_norouter.yaml
8+
- commands/host/phpmyadmin
9+
global_files: []
10+
removal_actions: []

.ddev/commands/host/phpmyadmin

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
3+
## #ddev-generated: If you want to edit and own this file, remove this line.
4+
## Description: Launch a browser with PhpMyAdmin
5+
## Usage: phpmyadmin
6+
## Example: "ddev phpmyadmin"
7+
8+
DDEV_PHPMYADMIN_PORT=8036
9+
DDEV_PHPMYADMIN_HTTPS_PORT=8037
10+
if [ ${DDEV_PRIMARY_URL%://*} = "http" ] || [ -n "${GITPOD_WORKSPACE_ID:-}" ] || [ "${CODESPACES:-}" = "true" ]; then
11+
# Gitpod: "gp preview" opens a blank page for PhpMyAdmin, use "xdg-open" instead
12+
if [ "${OSTYPE:-}" = "linux-gnu" ] && [ -n "${GITPOD_WORKSPACE_ID:-}" ] && [ -z "${DDEV_DEBUG:-}" ]; then
13+
xdg-open "$(DDEV_DEBUG=true ddev launch :$DDEV_PHPMYADMIN_PORT | grep "FULLURL" | awk '{print $2}')"
14+
else
15+
ddev launch :$DDEV_PHPMYADMIN_PORT
16+
fi
17+
else
18+
ddev launch :$DDEV_PHPMYADMIN_HTTPS_PORT
19+
fi

.ddev/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ type: cakephp
33
docroot: webroot
44
php_version: "8.4"
55
webserver_type: nginx-fpm
6-
xdebug_enabled: true
6+
xdebug_enabled: false
77
additional_hostnames: []
88
additional_fqdns: []
99
database:
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#ddev-generated
2+
services:
3+
phpmyadmin:
4+
container_name: ddev-${DDEV_SITENAME}-phpmyadmin
5+
image: ${PHPMYADMIN_DOCKER_IMAGE:-phpmyadmin:5}
6+
working_dir: "/root"
7+
restart: "no"
8+
labels:
9+
com.ddev.site-name: ${DDEV_SITENAME}
10+
com.ddev.approot: ${DDEV_APPROOT}
11+
volumes:
12+
- ".:/mnt/ddev_config"
13+
- "ddev-global-cache:/mnt/ddev-global-cache"
14+
expose:
15+
- "80"
16+
environment:
17+
- PMA_USER=root
18+
- PMA_PASSWORD=root
19+
- PMA_HOST=db
20+
- PMA_PORT=3306
21+
- VIRTUAL_HOST=$DDEV_HOSTNAME
22+
- UPLOAD_LIMIT=4000M
23+
- HTTP_EXPOSE=8036:80
24+
- HTTPS_EXPOSE=8037:80
25+
healthcheck:
26+
test: ["CMD-SHELL", "true"]
27+
interval: 120s
28+
timeout: 2s
29+
retries: 1
30+
depends_on:
31+
- db
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#ddev-generated
2+
# If omit_containers[ddev-router] then this file will be replaced
3+
# with another with a `ports` statement to directly expose port 80 to 8036
4+
services: {}

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
"config": {
4242
"allow-plugins": {
4343
"cakephp/plugin-installer": true,
44-
"dealerdirect/phpcodesniffer-composer-installer": true
44+
"dealerdirect/phpcodesniffer-composer-installer": true,
45+
"php-http/discovery": true
4546
},
4647
"platform-check": true,
4748
"sort-packages": true

config/form-templates.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Custom templates for pagination elements.
66
*/
77
return [
8-
'button' => '<button class="bg-cake-red hover:cursor-pointer p-2 text-white rounded-sm"{{attrs}}>{{text}}</button>',
8+
'button' => '<button class="btn btn-soft btn-primary"{{attrs}}>{{text}}</button>',
99
'checkbox' => '<input class="justify-self-start" type="checkbox" name="{{name}}" value="{{value}}"{{attrs}}>',
1010
'checkboxWrapper' => '<div class="col-span-2 col-start-2 flex gap-2">{{label}}</div>',
1111
'error' => '<div class="col-start-2 col-end-4 text-cake-red" id="{{id}}">{{content}}</div>',

package-lock.json

Lines changed: 64 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"type": "module",
33
"devDependencies": {
44
"@tailwindcss/vite": "^4.1.4",
5+
"daisyui": "^5.5.19",
56
"tailwindcss": "^4.0.0",
67
"vite": "^8.0.0"
78
},
@@ -10,6 +11,8 @@
1011
"build": "vite build"
1112
},
1213
"dependencies": {
14+
"htmx.org": "^2.0.8",
15+
"slim-select": "^3.4.3",
1316
"swiper": "^12.1.3"
1417
}
1518
}

resources/css/style.css

Lines changed: 82 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,48 @@
22
@import "./fonts.css";
33
@import "swiper/css";
44
@import "swiper/css/navigation";
5+
@import "swiper/css/pagination";
6+
@import "slim-select/styles";
7+
@plugin "daisyui" {
8+
themes: cakephp --default;
9+
}
10+
11+
@plugin "daisyui/theme" {
12+
name: "cakephp";
13+
default: true;
14+
prefersdark: false;
15+
color-scheme: light;
16+
17+
--color-base-100: hsl(0 0% 100%);
18+
--color-base-200: hsl(210 20% 98%);
19+
--color-base-300: hsl(210 20% 94%);
20+
--color-base-content: hsl(220 13% 18%);
21+
22+
--color-primary: hsl(214 84% 46%);
23+
--color-primary-content: hsl(0 0% 100%);
24+
--color-secondary: hsl(262 80% 50%);
25+
--color-secondary-content: hsl(0 0% 100%);
26+
--color-accent: hsl(199 89% 48%);
27+
--color-accent-content: hsl(0 0% 100%);
28+
--color-neutral: hsl(220 13% 18%);
29+
--color-neutral-content: hsl(0 0% 100%);
30+
31+
--color-info: hsl(198 93% 60%);
32+
--color-info-content: hsl(198 100% 12%);
33+
--color-success: hsl(158 64% 52%);
34+
--color-success-content: hsl(158 100% 10%);
35+
--color-warning: hsl(43 96% 56%);
36+
--color-warning-content: hsl(43 100% 11%);
37+
--color-error: hsl(0 72% 46%);
38+
--color-error-content: hsl(0 0% 100%);
39+
40+
--radius-box: 1.5rem;
41+
--radius-field: 1rem;
42+
--radius-selector: 1rem;
43+
--border: 1px;
44+
--depth: 1;
45+
--noise: 0;
46+
}
547

648
@theme {
749
--font-raleway: "Raleway", sans-serif;
@@ -40,9 +82,46 @@
4082
--ss-primary-color: var(--color-blue-500);
4183
}
4284

85+
.htmx-indicator {
86+
opacity: 1;
87+
transition: opacity 0.2s ease;
88+
}
89+
90+
.htmx-request .htmx-indicator,
91+
.htmx-request.htmx-indicator {
92+
opacity: 1;
93+
}
94+
95+
.main-loading-overlay {
96+
position: fixed;
97+
inset: 0;
98+
z-index: 80;
99+
display: flex;
100+
align-items: center;
101+
justify-content: center;
102+
background: hsl(210 40% 98% / 0.72);
103+
backdrop-filter: blur(2px);
104+
opacity: 0;
105+
visibility: hidden;
106+
pointer-events: none;
107+
transition: opacity 0.2s ease;
108+
}
109+
110+
body.is-htmx-loading .main-loading-overlay,
111+
.main-loading-overlay.htmx-request {
112+
opacity: 1;
113+
visibility: visible;
114+
pointer-events: auto;
115+
}
116+
117+
.main-loading-indicator-card {
118+
opacity: 1;
119+
z-index: 90;
120+
}
121+
43122
@layer components {
44123
.featured-packages-slider-shell {
45-
@apply -mx-3 px-3 pb-4;
124+
@apply pb-4;
46125
}
47126

48127
.featured-packages-slider {
@@ -53,21 +132,13 @@
53132
@apply h-auto py-2;
54133
}
55134

56-
.featured-packages-slider-button {
57-
@apply inline-flex h-11 w-11 items-center justify-center rounded-full border border-slate-200 bg-white text-lg text-slate-700 shadow-sm transition hover:border-cake-red hover:text-cake-red disabled:cursor-not-allowed disabled:opacity-40;
58-
}
59-
60-
.featured-packages-slider-button::after {
61-
content: none;
62-
}
63-
64135
.packages-section-divider {
65-
@apply flex items-center gap-4 text-xs font-semibold uppercase tracking-[0.24em] text-slate-400;
136+
@apply flex items-center gap-4 text-xs font-semibold uppercase tracking-[0.24em] opacity-40;
66137
}
67138

68139
.packages-section-divider::before,
69140
.packages-section-divider::after {
70141
content: "";
71-
@apply h-px flex-1 bg-slate-200;
142+
@apply h-px flex-1 bg-base-300;
72143
}
73144
}

0 commit comments

Comments
 (0)