diff --git a/app/util.php b/app/util.php index cc44182..aa7661b 100644 --- a/app/util.php +++ b/app/util.php @@ -89,7 +89,7 @@ function url(string $path = '/'): string } /** Cache-Buster: bei Änderungen an app.css/app.js erhöhen. */ -const DIC_ASSET_VERSION = '5'; +const DIC_ASSET_VERSION = '7'; function asset(string $path): string { diff --git a/views/admin_trailers.php b/views/admin_trailers.php index 2b72887..3fe0256 100644 --- a/views/admin_trailers.php +++ b/views/admin_trailers.php @@ -25,129 +25,135 @@ $createError = static fn (string $key): string => (string) ($createErrors[$key] -
> - - - - Anhänger anlegen - - Nur bei Bedarf – z. B. für einen zusätzlichen Mietanhänger. - - - -
-

Neue Anhänger stehen sofort im Kalender und in der Buchungsmaske zur Auswahl. Die Sortierung bestimmt die Reihenfolge der Zeilen.

- - - - - -
- - - - - - - -
- Farbe - - - - - - - - - -
- - - -
- Status - -
- -
- -
-
-
-
- -
- - +

Anhänger & Farben

Inaktive Anhänger erscheinen nicht in der Buchungsmaske; historische Buchungen bleiben erhalten.

- +
+
> + + Anhänger anlegen + +
+
+
+ Neuer Anhänger + Er steht sofort im Kalender und in der Buchungsmaske zur Auswahl. +
+ Sortierung bestimmt die Zeilenreihenfolge +
+ + + + + + + + + + + + + +
+ Farbe + + + + + + + + + +
+ + + +
+ Status + +
+ +
+ +
+ +
+
+ +
-
- - - -
- - - - - - - - - - - - - - - - Buchung - - +
+ + + +
+ - -
-

Hinweis: Die Farbe wird bei allen Buchungen dieses Anhängers sofort übernommen. Der Buchungstext selbst bleibt unverändert.

-
+ + +
+ + + + + + + + + + + + + + + + Buchung + + +
+ +
+

Hinweis: Die Farbe wird bei allen Buchungen dieses Anhängers sofort übernommen. Der Buchungstext selbst bleibt unverändert.

+ +
diff --git a/web/assets/app.css b/web/assets/app.css index b592e99..d436430 100644 --- a/web/assets/app.css +++ b/web/assets/app.css @@ -688,25 +688,32 @@ a .ico, button .ico { pointer-events: none; } .reminder-note { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; background: var(--ice-50); border: 1px solid var(--ice-200); color: var(--brand-800); font-size: .82rem; max-width: 900px; } /* --------------------------------------------------------------- Admin */ -.create-trailer { padding: 0; overflow: hidden; } +.panel__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; position: relative; } +.create-trailer { position: relative; } .create-trailer__summary { list-style: none; cursor: pointer; - display: flex; align-items: center; gap: 11px; - padding: 17px 22px; - transition: background .15s; } .create-trailer__summary::-webkit-details-marker { display: none; } -.create-trailer__summary:hover { background: var(--ice-50); } -.create-trailer__title { - display: inline-flex; align-items: center; gap: 8px; - font-family: var(--font-display); font-weight: 800; font-size: 1rem; color: var(--ink); +.create-trailer__summary::marker { content: ''; } +.create-trailer[open] .create-trailer__summary { + background: var(--ice-100); border-color: var(--ice-300); color: var(--brand-700); } -.create-trailer__title .ico { color: var(--brand); } -.create-trailer__hint { font-size: .8rem; color: var(--muted); } -.create-trailer__chevron { margin-left: auto; color: var(--muted); transform: rotate(90deg); transition: transform .2s; } -.create-trailer[open] .create-trailer__chevron { transform: rotate(-90deg); } -.create-trailer__body { padding: 0 22px 22px; border-top: 1px solid var(--line-soft); } -.create-trailer__body > .muted { padding-top: 14px; margin-bottom: 14px; } +.create-trailer__body { + position: absolute; right: 0; top: calc(100% + 10px); z-index: 60; + width: min(660px, calc(100vw - 32px)); + padding: 20px; background: #fff; + border: 1px solid var(--line); border-radius: var(--radius-lg); + box-shadow: var(--shadow-lg); +} +.create-trailer__body-head { + display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; + margin-bottom: 16px; +} +.create-trailer__body-head strong { display: block; font-family: var(--font-display); font-size: 1rem; color: var(--ink); } +.create-trailer__body-head span { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; } +.create-trailer__body-head > .muted { margin-top: 0; white-space: nowrap; } +.create-trailer__body .form-grid { gap: 12px 14px; } +.create-trailer__body .trailer-admin__preview { margin-top: 2px; } .admin-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line); } .admin-nav a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; font-size: .84rem; font-weight: 600; color: var(--ink-2); } @@ -901,9 +908,15 @@ a .ico, button .ico { pointer-events: none; } .trailer-admin__row > .link-button, .trailer-admin__row > .muted { grid-column: 1 / -1; } .trailer-admin__row input[type="number"] { width: 100%; } .admin-nav { overflow-x: auto; flex-wrap: nowrap; } - .create-trailer__summary { padding: 14px 16px; } - .create-trailer__hint { display: none; } - .create-trailer__body { padding: 0 16px 16px; } + .panel__head { flex-wrap: wrap; } + .panel__actions { width: 100%; } + .create-trailer[open] { flex: 1 1 100%; order: 2; } + .create-trailer__body { + position: static; width: 100%; margin-top: 10px; + padding: 16px; box-shadow: var(--shadow-sm); + } + .create-trailer__body-head { flex-direction: column; gap: 4px; } + .create-trailer__body-head > .muted { white-space: normal; } .admin-nav a { flex: 0 0 auto; } .panel-head { padding: 16px 16px 12px; } .panel-head h2 { font-size: 1.15rem; } diff --git a/web/sw.js b/web/sw.js index 2d50f02..91c4d72 100644 --- a/web/sw.js +++ b/web/sw.js @@ -6,7 +6,7 @@ * zwischengespeichert, damit niemand veraltete Buchungen sieht. */ -const VERSION = 'dic-v5'; +const VERSION = 'dic-v7'; const CACHE = VERSION; const BASE = new URL(self.registration.scope).pathname.replace(/\/$/, ''); @@ -76,23 +76,24 @@ async function cacheFirst(event, request) { return (await network) || new Response('', { status: 504, statusText: 'Offline' }); } -async function staleWhileRevalidate(event, request) { +async function assetResponse(request) { const cache = await caches.open(CACHE); - const cached = await cache.match(request, { ignoreSearch: true }); - const network = fetch(request) - .then((response) => { - if (response && response.ok) { - cache.put(cacheKey(request), response.clone()); - } - return response; - }) - .catch(() => null); - - if (cached) { - event.waitUntil(network); - return cached; + // Exakter Treffer inklusive Versions-Query. Dadurch wird nach einem + // Deployment sofort die neue Datei geladen statt noch einmal die alte. + const exact = await cache.match(request); + if (exact) { + return exact; + } + try { + const response = await fetch(request); + if (response && response.ok) { + cache.put(request, response.clone()); + } + return response; + } catch (error) { + const fallback = await cache.match(request, { ignoreSearch: true }); + return fallback || new Response('', { status: 504, statusText: 'Offline' }); } - return (await network) || new Response('', { status: 504, statusText: 'Offline' }); } async function navigate(request) { @@ -130,7 +131,7 @@ self.addEventListener('fetch', (event) => { } if (url.pathname.startsWith(assetPrefix)) { - event.respondWith(staleWhileRevalidate(event, request)); + event.respondWith(assetResponse(request)); return; }