Bilder im Admin austauschbar: Link-Vorschau, Einblicke, Startseite, Hintergruende, Paketkacheln
Neue Seite Einstellungen > Bilder (Titelbild und Logos dorthin verschoben) plus "Bild tauschen" im Live-Bearbeiten-Modus. Gespeichert als JSON in app_settings.site_images (Auto-Migration). Startseite und SPA-Fallback laufen ueber api/public/page.php, das og:image und Favicon serverseitig ins HTML setzt. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PBCD1KUwiqh1kdMwDSwVfD
This commit is contained in:
parent
be14d274a3
commit
296c196d06
91 changed files with 1166 additions and 444 deletions
|
|
@ -159,6 +159,7 @@ export default function App() {
|
||||||
<Route path="website" element={<Navigate to="../company" replace />} />
|
<Route path="website" element={<Navigate to="../company" replace />} />
|
||||||
<Route path="company" element={<RequirePermission permission="settings.manage"><WebsiteSettings section="company" /></RequirePermission>} />
|
<Route path="company" element={<RequirePermission permission="settings.manage"><WebsiteSettings section="company" /></RequirePermission>} />
|
||||||
<Route path="design" element={<RequirePermission permission="settings.manage"><WebsiteSettings section="design" /></RequirePermission>} />
|
<Route path="design" element={<RequirePermission permission="settings.manage"><WebsiteSettings section="design" /></RequirePermission>} />
|
||||||
|
<Route path="images" element={<RequirePermission permission="settings.manage"><WebsiteSettings section="images" /></RequirePermission>} />
|
||||||
<Route path="legal" element={<RequirePermission permission="settings.manage"><LegalSettings /></RequirePermission>} />
|
<Route path="legal" element={<RequirePermission permission="settings.manage"><LegalSettings /></RequirePermission>} />
|
||||||
<Route path="maintenance" element={<RequirePermission permission="settings.manage"><MaintenanceSettings /></RequirePermission>} />
|
<Route path="maintenance" element={<RequirePermission permission="settings.manage"><MaintenanceSettings /></RequirePermission>} />
|
||||||
<Route path="countdown" element={<RequirePermission permission="settings.manage"><CountdownSettings /></RequirePermission>} />
|
<Route path="countdown" element={<RequirePermission permission="settings.manage"><CountdownSettings /></RequirePermission>} />
|
||||||
|
|
|
||||||
|
|
@ -128,6 +128,7 @@ export default function AdminLayout() {
|
||||||
links: [
|
links: [
|
||||||
{ to: '/admin/settings/company', label: 'Firmendaten', icon: 'building', permission: 'settings.manage' },
|
{ to: '/admin/settings/company', label: 'Firmendaten', icon: 'building', permission: 'settings.manage' },
|
||||||
{ to: '/admin/settings/design', label: 'Aussehen', icon: 'palette', permission: 'settings.manage' },
|
{ to: '/admin/settings/design', label: 'Aussehen', icon: 'palette', permission: 'settings.manage' },
|
||||||
|
{ to: '/admin/settings/images', label: 'Bilder', icon: 'image', permission: 'settings.manage' },
|
||||||
{ to: '/admin/settings/legal', label: 'Rechtstexte', icon: 'file', permission: 'settings.manage' },
|
{ to: '/admin/settings/legal', label: 'Rechtstexte', icon: 'file', permission: 'settings.manage' },
|
||||||
{ to: '/admin/settings/maintenance', label: 'Wartungsmodus', icon: 'pause', permission: 'settings.manage' },
|
{ to: '/admin/settings/maintenance', label: 'Wartungsmodus', icon: 'pause', permission: 'settings.manage' },
|
||||||
{ to: '/admin/settings/countdown', label: 'Launch-Countdown', icon: 'timer', permission: 'settings.manage' },
|
{ to: '/admin/settings/countdown', label: 'Launch-Countdown', icon: 'timer', permission: 'settings.manage' },
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { LogIn, Phone, X } from 'lucide-react';
|
||||||
import { useLanguage } from '../context/LanguageContext.jsx';
|
import { useLanguage } from '../context/LanguageContext.jsx';
|
||||||
import { telHref } from '../utils/contactLinks.js';
|
import { telHref } from '../utils/contactLinks.js';
|
||||||
import logoDark from '../assets/logo-dark.png';
|
import logoDark from '../assets/logo-dark.png';
|
||||||
import background from '../assets/contact/bg-dark.webp';
|
import useSiteImages from '../hooks/useSiteImages.js';
|
||||||
|
|
||||||
// Farben/Schriften aus dem Kontaktformular-Design (Dark-Variante, referenz/Kontaktformular
|
// Farben/Schriften aus dem Kontaktformular-Design (Dark-Variante, referenz/Kontaktformular
|
||||||
// Redesign) - der Teaser ist immer dunkel, unabhaengig vom Hell/Dunkel-Schalter.
|
// Redesign) - der Teaser ist immer dunkel, unabhaengig vom Hell/Dunkel-Schalter.
|
||||||
|
|
@ -80,6 +80,8 @@ function AccentTitle({ text }) {
|
||||||
export default function CountdownTeaser({ countdown, clockOffset = 0, settings = {}, preview = false, onClosePreview, onLaunch }) {
|
export default function CountdownTeaser({ countdown, clockOffset = 0, settings = {}, preview = false, onClosePreview, onLaunch }) {
|
||||||
const { t, language, toggleLanguage } = useLanguage();
|
const { t, language, toggleLanguage } = useLanguage();
|
||||||
const [remaining, setRemaining] = useState(() => countdownRemaining(countdown, clockOffset));
|
const [remaining, setRemaining] = useState(() => countdownRemaining(countdown, clockOffset));
|
||||||
|
// Liegt ausserhalb des SiteSettingsProviders - daher die Einstellungen direkt uebergeben.
|
||||||
|
const background = useSiteImages(settings).slot('countdown_bg');
|
||||||
const launched = remaining <= 0;
|
const launched = remaining <= 0;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -124,7 +126,7 @@ export default function CountdownTeaser({ countdown, clockOffset = 0, settings =
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="flex min-h-[100svh] flex-col bg-[#0a0c06] bg-cover bg-center"
|
className="flex min-h-[100svh] flex-col bg-[#0a0c06] bg-cover bg-center"
|
||||||
style={{ backgroundImage: `url(${background})`, color: C.text, fontFamily: "'Barlow', sans-serif" }}
|
style={{ backgroundImage: `url(${background.src})`, color: C.text, fontFamily: "'Barlow', sans-serif" }}
|
||||||
>
|
>
|
||||||
{preview && (
|
{preview && (
|
||||||
<div className="flex items-center justify-center gap-3 px-4 py-2 text-xs font-semibold" style={{ background: C.accent, color: '#0f1208' }}>
|
<div className="flex items-center justify-center gap-3 px-4 py-2 text-xs font-semibold" style={{ background: C.accent, color: '#0f1208' }}>
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ export default function ImageUploadField({ value, onChange, label = 'Bild', aspe
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<label className="mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300">{label}</label>
|
<label className="mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300">{label}</label>
|
||||||
<div className="flex items-center gap-3">
|
<div className="flex flex-wrap items-center gap-3">
|
||||||
{value && (
|
{value && (
|
||||||
<div className="relative">
|
<div className="relative">
|
||||||
<img src={value} alt="" className="h-12 w-12 rounded-md object-cover" />
|
<img src={value} alt="" className="h-12 w-12 rounded-md object-cover" />
|
||||||
|
|
@ -100,7 +100,7 @@ export default function ImageUploadField({ value, onChange, label = 'Bild', aspe
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<input type="file" accept="image/png,image/jpeg,image/webp" onChange={handleFile} className="text-sm" />
|
<input type="file" accept="image/png,image/jpeg,image/webp" onChange={handleFile} className="min-w-0 max-w-full text-sm" />
|
||||||
{value && (
|
{value && (
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
|
|
|
||||||
218
hifi-src/src/components/admin/SiteImagesEditor.jsx
Normal file
218
hifi-src/src/components/admin/SiteImagesEditor.jsx
Normal file
|
|
@ -0,0 +1,218 @@
|
||||||
|
import ImageUploadField from '../ImageUploadField.jsx';
|
||||||
|
import SortableList from './SortableList.jsx';
|
||||||
|
import { PACKAGE_TIERS } from '../../constants/packageTiers.js';
|
||||||
|
import {
|
||||||
|
SITE_IMAGE_SLOTS,
|
||||||
|
INSIGHTS_MAX,
|
||||||
|
PACKAGE_TIER_DEFAULTS,
|
||||||
|
defaultInsightTokens,
|
||||||
|
insightSrc,
|
||||||
|
} from '../../constants/siteImages.js';
|
||||||
|
|
||||||
|
// Bearbeitet app_settings.site_images (Einstellungen > Bilder): Einzelbilder, die Fotos der
|
||||||
|
// Rubrik "Einblicke in unsere Umbauten" und die Hintergruende der Paketkacheln. value ist das
|
||||||
|
// Objekt aus /site-settings, onChange bekommt das komplette neue Objekt. Gespeichert wird mit
|
||||||
|
// dem Formular der Seite (POST /site-settings).
|
||||||
|
|
||||||
|
const card = 'rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900';
|
||||||
|
|
||||||
|
function Preview({ src, custom, className = 'h-20 w-32' }) {
|
||||||
|
return (
|
||||||
|
<div className="relative shrink-0">
|
||||||
|
<img src={src} alt="" className={`${className} rounded-md border border-neutral-200 bg-neutral-100 object-cover dark:border-neutral-700 dark:bg-neutral-800`} />
|
||||||
|
<span className={`absolute bottom-1 left-1 rounded px-1.5 py-0.5 text-[10px] font-semibold ${custom ? 'bg-brand-500 text-white' : 'bg-black/60 text-white'}`}>
|
||||||
|
{custom ? 'Eigenes Bild' : 'Standard'}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function SlotField({ slotKey, value, onChange, hint }) {
|
||||||
|
const slot = SITE_IMAGE_SLOTS[slotKey];
|
||||||
|
const custom = value || '';
|
||||||
|
return (
|
||||||
|
<div className="flex flex-col gap-3 border-t border-neutral-100 pt-4 first:border-t-0 first:pt-0 dark:border-neutral-800 sm:flex-row sm:items-start">
|
||||||
|
<Preview src={custom || slot.src} custom={!!custom} />
|
||||||
|
<div className="min-w-0 flex-1">
|
||||||
|
<ImageUploadField value={custom} onChange={(path) => onChange(path || '')} label={slot.label} aspect={slot.aspect} />
|
||||||
|
{hint && <p className="mt-1 text-xs text-neutral-500 dark:text-neutral-400">{hint}</p>}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function SiteImagesEditor({ value, onChange }) {
|
||||||
|
const images = value || {};
|
||||||
|
const setSlot = (key, path) => {
|
||||||
|
const next = { ...images };
|
||||||
|
if (path) next[key] = path;
|
||||||
|
else delete next[key];
|
||||||
|
onChange(next);
|
||||||
|
};
|
||||||
|
|
||||||
|
// --- Einblicke ---
|
||||||
|
const insightTokens = Array.isArray(images.insights) ? images.insights : defaultInsightTokens();
|
||||||
|
const insightItems = insightTokens.map((token) => ({ id: token, token }));
|
||||||
|
const setInsights = (tokens) => onChange({ ...images, insights: tokens });
|
||||||
|
const replaceInsight = (index, path) => {
|
||||||
|
const tokens = [...insightTokens];
|
||||||
|
// × am eigenen Foto: an dieser Stelle wieder das eingebaute Foto, falls es eins gab.
|
||||||
|
if (path) tokens[index] = path;
|
||||||
|
else if (index < defaultInsightTokens().length && !tokens.includes(`default:${index}`)) tokens[index] = `default:${index}`;
|
||||||
|
else tokens.splice(index, 1);
|
||||||
|
setInsights(tokens);
|
||||||
|
};
|
||||||
|
const resetInsights = () => {
|
||||||
|
const next = { ...images };
|
||||||
|
delete next.insights;
|
||||||
|
onChange(next);
|
||||||
|
};
|
||||||
|
|
||||||
|
// --- Paketkacheln ---
|
||||||
|
const tierList = Array.isArray(images.package_tiers) ? images.package_tiers : [];
|
||||||
|
const setTier = (index, path) => {
|
||||||
|
const list = PACKAGE_TIER_DEFAULTS.map((_, i) => tierList[i] || null);
|
||||||
|
list[index] = path || null;
|
||||||
|
const next = { ...images };
|
||||||
|
if (list.some(Boolean)) next.package_tiers = list;
|
||||||
|
else delete next.package_tiers;
|
||||||
|
onChange(next);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<section className={card}>
|
||||||
|
<h2 className="mb-1 font-semibold text-neutral-900 dark:text-white">Link-Vorschau und Browser-Symbol</h2>
|
||||||
|
<p className="mb-4 text-sm text-neutral-500 dark:text-neutral-400">
|
||||||
|
Das Vorschaubild erscheint, wenn jemand den Link zur Website in WhatsApp, Facebook, Signal & Co. teilt
|
||||||
|
(ideal 1200 × 630 Pixel). WhatsApp merkt sich Vorschauen eine Weile, ein neues Bild kann daher erst nach
|
||||||
|
einigen Tagen bei bereits geteilten Links auftauchen.
|
||||||
|
</p>
|
||||||
|
<div className="space-y-4">
|
||||||
|
<SlotField slotKey="og_image" value={images.og_image} onChange={(p) => setSlot('og_image', p)} />
|
||||||
|
<SlotField
|
||||||
|
slotKey="favicon"
|
||||||
|
value={images.favicon}
|
||||||
|
onChange={(p) => setSlot('favicon', p)}
|
||||||
|
hint="Das kleine Symbol im Browser-Tab. Am besten ein quadratisches PNG."
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section className={card}>
|
||||||
|
<h2 className="mb-1 font-semibold text-neutral-900 dark:text-white">Bilder auf der Startseite</h2>
|
||||||
|
<p className="mb-4 text-sm text-neutral-500 dark:text-neutral-400">
|
||||||
|
Tipp: Im Live-Bearbeiten-Modus der Website lassen sich diese Bilder auch direkt auf der Seite tauschen.
|
||||||
|
</p>
|
||||||
|
<div className="space-y-4">
|
||||||
|
{['craft', 'advice', 'youtube_poster', 'more'].map((key) => (
|
||||||
|
<SlotField
|
||||||
|
key={key}
|
||||||
|
slotKey={key}
|
||||||
|
value={images[key]}
|
||||||
|
onChange={(p) => setSlot(key, p)}
|
||||||
|
hint={key === 'youtube_poster' ? 'Wird gezeigt, bis das Video startet, und dauerhaft auf Geräten, die keine Videos automatisch abspielen.' : undefined}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section className={card}>
|
||||||
|
<div className="mb-1 flex flex-wrap items-center justify-between gap-2">
|
||||||
|
<h2 className="font-semibold text-neutral-900 dark:text-white">„Einblicke in unsere Umbauten“</h2>
|
||||||
|
{Array.isArray(images.insights) && (
|
||||||
|
<button type="button" onClick={resetInsights} className="text-xs font-medium text-brand-600 hover:underline dark:text-brand-400">
|
||||||
|
Standardfotos wiederherstellen
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<p className="mb-4 text-sm text-neutral-500 dark:text-neutral-400">
|
||||||
|
Die Fotos unter der Überschrift auf der Startseite. Tauschen, entfernen, neue hinzufügen und am Griff in
|
||||||
|
die gewünschte Reihenfolge ziehen. Angezeigt werden sie quadratisch, drei pro Reihe.
|
||||||
|
</p>
|
||||||
|
<SortableList
|
||||||
|
items={insightItems}
|
||||||
|
onReorder={(items) => setInsights(items.map((item) => item.token))}
|
||||||
|
as="grid"
|
||||||
|
className="grid gap-4 sm:grid-cols-2"
|
||||||
|
>
|
||||||
|
{(item, handle) => {
|
||||||
|
const index = insightTokens.indexOf(item.token);
|
||||||
|
const isDefault = item.token.startsWith('default:');
|
||||||
|
return (
|
||||||
|
<div className="rounded-lg border border-neutral-200 p-3 dark:border-neutral-700">
|
||||||
|
<div className="mb-2 flex items-center justify-between gap-2">
|
||||||
|
<span className="flex items-center gap-1 text-sm font-medium text-neutral-700 dark:text-neutral-300">
|
||||||
|
{handle}
|
||||||
|
Foto {index + 1}
|
||||||
|
</span>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={() => setInsights(insightTokens.filter((_, i) => i !== index))}
|
||||||
|
className="text-xs text-red-600 hover:underline"
|
||||||
|
>
|
||||||
|
Entfernen
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div className="flex items-start gap-3">
|
||||||
|
<Preview src={insightSrc(item.token)} custom={!isDefault} className="h-20 w-20" />
|
||||||
|
<div className="min-w-0 flex-1">
|
||||||
|
<ImageUploadField value={isDefault ? '' : item.token} onChange={(path) => replaceInsight(index, path)} label="Tauschen" aspect={1} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
</SortableList>
|
||||||
|
{insightTokens.length === 0 && (
|
||||||
|
<p className="text-sm text-neutral-500 dark:text-neutral-400">Keine Fotos - die Rubrik zeigt dann nur Überschrift und Text.</p>
|
||||||
|
)}
|
||||||
|
{insightTokens.length < INSIGHTS_MAX && (
|
||||||
|
<div className="mt-4 rounded-lg border border-dashed border-neutral-300 p-3 dark:border-neutral-700">
|
||||||
|
<ImageUploadField
|
||||||
|
value=""
|
||||||
|
onChange={(path) => path && setInsights([...insightTokens, path])}
|
||||||
|
label="Foto hinzufügen"
|
||||||
|
aspect={1}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section className={card}>
|
||||||
|
<h2 className="mb-1 font-semibold text-neutral-900 dark:text-white">Kontaktseite und Launch-Countdown</h2>
|
||||||
|
<p className="mb-4 text-sm text-neutral-500 dark:text-neutral-400">
|
||||||
|
Großflächige Hintergrundbilder. Text und Formular liegen darüber, ruhige und eher dunkle Motive wirken am besten.
|
||||||
|
</p>
|
||||||
|
<div className="space-y-4">
|
||||||
|
{['contact_bg_light', 'contact_bg_dark', 'countdown_bg'].map((key) => (
|
||||||
|
<SlotField key={key} slotKey={key} value={images[key]} onChange={(p) => setSlot(key, p)} />
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section className={card}>
|
||||||
|
<h2 className="mb-1 font-semibold text-neutral-900 dark:text-white">Hintergründe der Paketkacheln</h2>
|
||||||
|
<p className="mb-4 text-sm text-neutral-500 dark:text-neutral-400">
|
||||||
|
Das Motiv hinter jeder Preisstufe auf den Fahrzeugseiten (günstigstes Paket = Stufe 1). Eigene Bilder gelten in
|
||||||
|
jedem Farbschema, ohne eigenes Bild bleibt das Straßenmotiv bzw. der Farbverlauf des Schemas.
|
||||||
|
</p>
|
||||||
|
<div className="grid gap-4 sm:grid-cols-2">
|
||||||
|
{PACKAGE_TIER_DEFAULTS.map((src, i) => (
|
||||||
|
<div key={i} className="flex items-start gap-3">
|
||||||
|
<Preview src={tierList[i] || src} custom={!!tierList[i]} className="h-24 w-14" />
|
||||||
|
<div className="min-w-0 flex-1">
|
||||||
|
<ImageUploadField
|
||||||
|
value={tierList[i] || ''}
|
||||||
|
onChange={(path) => setTier(i, path)}
|
||||||
|
label={`Stufe ${i + 1}: ${PACKAGE_TIERS[i]}`}
|
||||||
|
aspect={210 / 480}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -170,3 +170,46 @@ export function useLiveValue(entity, id, field, value, lang) {
|
||||||
const live = useLiveEdit();
|
const live = useLiveEdit();
|
||||||
return live.getValue(entity, id, field, lang || language, value);
|
return live.getValue(entity, id, field, lang || language, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Austauschbares Bild (constants/siteImages.js) - im Modus erscheint darueber ein Knopf
|
||||||
|
* "Bild tauschen", der in der Bearbeiten-Leiste Hochladen/Zuschneiden oeffnet.
|
||||||
|
* id = Schluessel wie in SiteImages.php ("craft", "insights.2"), value = eigener Upload-Pfad
|
||||||
|
* (leer = Standardbild).
|
||||||
|
*/
|
||||||
|
export function EditableImage({ id, value, label = 'Bild', aspect, buttonLabel = 'Bild tauschen', as: Tag = 'div', className = '', children, ...rest }) {
|
||||||
|
const live = useLiveEdit();
|
||||||
|
|
||||||
|
if (!live.canEdit('site_images')) {
|
||||||
|
// Ohne Inhalt (reiner Tausch-Knopf, z. B. fuer ein Hintergrundbild) ausserhalb des Modus nichts.
|
||||||
|
if (!children) return null;
|
||||||
|
return (
|
||||||
|
<Tag className={className} {...rest}>
|
||||||
|
{children}
|
||||||
|
</Tag>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const open = (e) => {
|
||||||
|
swallow(e);
|
||||||
|
live.openEditor({ kind: 'image', entity: 'site_images', id, field: 'path', lang: 'de', label, aspect, original: value || '' });
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Tag {...rest} className={`${className}${/\babsolute\b/.test(className) ? '' : ' relative'}${live.hasPending('site_images', id, 'path', 'de') ? ' live-editable-changed' : ''}`}>
|
||||||
|
{children}
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={open}
|
||||||
|
className="absolute left-2 top-2 z-10 inline-flex items-center gap-1.5 rounded-full bg-black/75 px-3 py-1.5 text-xs font-semibold text-white shadow-lg ring-1 ring-white/30 backdrop-blur hover:bg-black/90"
|
||||||
|
>
|
||||||
|
<svg className="h-3.5 w-3.5" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" aria-hidden="true">
|
||||||
|
<rect x="3" y="3" width="18" height="18" rx="2" />
|
||||||
|
<circle cx="9" cy="9" r="2" />
|
||||||
|
<path d="m21 15-3.1-3.1a2 2 0 0 0-2.8 0L6 21" />
|
||||||
|
</svg>
|
||||||
|
{buttonLabel}
|
||||||
|
</button>
|
||||||
|
</Tag>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import { dictionaries } from '../../i18n/index.js';
|
||||||
|
|
||||||
// Der Rich-Text-Editor (Tiptap) ist gross und wird nur im Bearbeiten-Modus gebraucht.
|
// Der Rich-Text-Editor (Tiptap) ist gross und wird nur im Bearbeiten-Modus gebraucht.
|
||||||
const RichTextEditor = lazy(() => import('../RichTextEditor.jsx'));
|
const RichTextEditor = lazy(() => import('../RichTextEditor.jsx'));
|
||||||
|
const ImageUploadField = lazy(() => import('../ImageUploadField.jsx'));
|
||||||
|
|
||||||
const LANGUAGE_NAMES = { de: 'Deutsch', en: 'Englisch' };
|
const LANGUAGE_NAMES = { de: 'Deutsch', en: 'Englisch' };
|
||||||
// Texte, die auf jeder Seite vorkommen - in der Liste "Feste Texte" ans Ende.
|
// Texte, die auf jeder Seite vorkommen - in der Liste "Feste Texte" ans Ende.
|
||||||
|
|
@ -20,7 +21,7 @@ function lookup(dict, key) {
|
||||||
/** Editor fuer Rich-Text und mehrzeilige Felder - Aenderungen erscheinen sofort auf der Seite. */
|
/** Editor fuer Rich-Text und mehrzeilige Felder - Aenderungen erscheinen sofort auf der Seite. */
|
||||||
function FieldEditor({ editor }) {
|
function FieldEditor({ editor }) {
|
||||||
const live = useLiveEdit();
|
const live = useLiveEdit();
|
||||||
const { entity, id, field, lang, kind, label, hint, original } = editor;
|
const { entity, id, field, lang, kind, label, hint, original, aspect } = editor;
|
||||||
// Stand beim Oeffnen, damit "Abbrechen" genau dorthin zurueckkehrt.
|
// Stand beim Oeffnen, damit "Abbrechen" genau dorthin zurueckkehrt.
|
||||||
const [initial] = useState(() => ({ value: original, wasPending: live.hasPending(entity, id, field, lang) }));
|
const [initial] = useState(() => ({ value: original, wasPending: live.hasPending(entity, id, field, lang) }));
|
||||||
const [value, setValue] = useState(original);
|
const [value, setValue] = useState(original);
|
||||||
|
|
@ -39,14 +40,21 @@ function FieldEditor({ editor }) {
|
||||||
<div className="pointer-events-auto w-full rounded-xl border border-neutral-200 bg-white p-4 text-neutral-900 shadow-2xl dark:border-neutral-700 dark:bg-neutral-900 dark:text-neutral-100 sm:w-[min(92vw,520px)]">
|
<div className="pointer-events-auto w-full rounded-xl border border-neutral-200 bg-white p-4 text-neutral-900 shadow-2xl dark:border-neutral-700 dark:bg-neutral-900 dark:text-neutral-100 sm:w-[min(92vw,520px)]">
|
||||||
<div className="mb-2 flex items-center justify-between gap-3">
|
<div className="mb-2 flex items-center justify-between gap-3">
|
||||||
<p className="text-sm font-semibold">
|
<p className="text-sm font-semibold">
|
||||||
{label} <span className="font-normal text-neutral-500">({LANGUAGE_NAMES[lang]})</span>
|
{label} {kind !== 'image' && <span className="font-normal text-neutral-500">({LANGUAGE_NAMES[lang]})</span>}
|
||||||
</p>
|
</p>
|
||||||
<button type="button" onClick={cancel} aria-label="Abbrechen" className="rounded p-1 text-neutral-500 hover:bg-neutral-100 dark:hover:bg-neutral-800">
|
<button type="button" onClick={cancel} aria-label="Abbrechen" className="rounded p-1 text-neutral-500 hover:bg-neutral-100 dark:hover:bg-neutral-800">
|
||||||
<X className="h-4 w-4" />
|
<X className="h-4 w-4" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{hint && <p className="mb-2 text-xs text-neutral-500 dark:text-neutral-400">{hint}</p>}
|
{hint && <p className="mb-2 text-xs text-neutral-500 dark:text-neutral-400">{hint}</p>}
|
||||||
{kind === 'html' ? (
|
{kind === 'image' ? (
|
||||||
|
<Suspense fallback={<p className="p-3 text-sm text-neutral-500">Lädt…</p>}>
|
||||||
|
<ImageUploadField value={value} onChange={(path) => change(path || '')} label="Eigenes Bild" aspect={aspect} />
|
||||||
|
<p className="mt-2 text-xs text-neutral-500 dark:text-neutral-400">
|
||||||
|
Ohne eigenes Bild (× am Vorschaubild) erscheint wieder das Standardbild.
|
||||||
|
</p>
|
||||||
|
</Suspense>
|
||||||
|
) : kind === 'html' ? (
|
||||||
<div className="max-h-[45vh] overflow-y-auto rounded-md border border-neutral-300 dark:border-neutral-700">
|
<div className="max-h-[45vh] overflow-y-auto rounded-md border border-neutral-300 dark:border-neutral-700">
|
||||||
<Suspense fallback={<p className="p-3 text-sm text-neutral-500">Editor lädt…</p>}>
|
<Suspense fallback={<p className="p-3 text-sm text-neutral-500">Editor lädt…</p>}>
|
||||||
<RichTextEditor value={value} onChange={change} />
|
<RichTextEditor value={value} onChange={change} />
|
||||||
|
|
|
||||||
59
hifi-src/src/constants/siteImages.js
Normal file
59
hifi-src/src/constants/siteImages.js
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
// Austauschbare Bilder der Website (Einstellungen > Bilder bzw. Live-Bearbeiten) mit den
|
||||||
|
// eingebauten Standardbildern. Die Schluessel muessen zu hifi/api/src/Support/SiteImages.php
|
||||||
|
// passen. Gespeichert wird nur, was vom Standard abweicht (app_settings.site_images).
|
||||||
|
import gallerySubs from '../assets/photos/gallery-subs.webp';
|
||||||
|
import galleryAmp from '../assets/photos/gallery-amp-purple.webp';
|
||||||
|
import gallerySpeaker from '../assets/photos/gallery-speaker.webp';
|
||||||
|
import galleryDash from '../assets/photos/gallery-dash.webp';
|
||||||
|
import galleryTrunk from '../assets/photos/hero-trunk.webp';
|
||||||
|
import galleryRear from '../assets/photos/gallery-rear.webp';
|
||||||
|
import heroHighlight from '../assets/leistungen/hero-highlight.webp';
|
||||||
|
import contactBgLight from '../assets/contact/bg-light.webp';
|
||||||
|
import contactBgDark from '../assets/contact/bg-dark.webp';
|
||||||
|
import roadBase from '../assets/roads/base.webp';
|
||||||
|
import roadClear from '../assets/roads/clear.webp';
|
||||||
|
import roadDrive from '../assets/roads/drive.webp';
|
||||||
|
import roadPrime from '../assets/roads/prime.webp';
|
||||||
|
import roadEliteR from '../assets/roads/elite_r.webp';
|
||||||
|
import roadApex from '../assets/roads/apex.webp';
|
||||||
|
import roadStatement from '../assets/roads/statement.webp';
|
||||||
|
import roadLimitless from '../assets/roads/limitless.webp';
|
||||||
|
|
||||||
|
// Einzelbilder: Standardbild, Beschriftung im Admin und Seitenverhaeltnis fuers Zuschneiden
|
||||||
|
// (fehlt = frei).
|
||||||
|
export const SITE_IMAGE_SLOTS = {
|
||||||
|
og_image: { src: '/og-image.jpg', label: 'Link-Vorschaubild', aspect: 1200 / 630 },
|
||||||
|
favicon: { src: '/favicon.png', label: 'Browser-Symbol (Favicon)', aspect: 1 },
|
||||||
|
craft: { src: gallerySubs, label: 'Startseite: Bild bei „Präzisionsarbeit“', aspect: 3 / 2 },
|
||||||
|
advice: { src: galleryAmp, label: 'Startseite: Bild bei „Von der ersten Idee …“', aspect: 3 / 2 },
|
||||||
|
youtube_poster: { src: galleryDash, label: 'Startseite: Standbild des Videos', aspect: 16 / 9 },
|
||||||
|
more: { src: heroHighlight, label: 'Startseite: Bild bei „Mehr als nur Car-Hifi“', aspect: 16 / 9 },
|
||||||
|
contact_bg_light: { src: contactBgLight, label: 'Kontaktseite: Hintergrund hell' },
|
||||||
|
contact_bg_dark: { src: contactBgDark, label: 'Kontaktseite: Hintergrund dunkel' },
|
||||||
|
countdown_bg: { src: contactBgDark, label: 'Launch-Countdown: Hintergrund' },
|
||||||
|
};
|
||||||
|
|
||||||
|
// "Einblicke in unsere Umbauten" - in der gespeicherten Liste steht "default:N" fuer das
|
||||||
|
// N-te Foto hier; ohne gespeicherte Liste gelten alle sechs.
|
||||||
|
export const INSIGHTS_DEFAULTS = [
|
||||||
|
{ src: gallerySubs, width: 900, height: 600 },
|
||||||
|
{ src: galleryAmp, width: 900, height: 600 },
|
||||||
|
{ src: gallerySpeaker, width: 900, height: 1200 },
|
||||||
|
{ src: galleryDash, width: 900, height: 814 },
|
||||||
|
{ src: galleryRear, width: 900, height: 1200 },
|
||||||
|
{ src: galleryTrunk, width: 1920, height: 1280 },
|
||||||
|
];
|
||||||
|
export const INSIGHTS_MAX = 24;
|
||||||
|
export const defaultInsightTokens = () => INSIGHTS_DEFAULTS.map((_, i) => `default:${i}`);
|
||||||
|
|
||||||
|
// Hintergrundmotive der 8 Paketstufen (Kacheln auf der Modellseite), feste Positionen.
|
||||||
|
export const PACKAGE_TIER_DEFAULTS = [
|
||||||
|
roadBase, roadClear, roadDrive, roadPrime, roadEliteR, roadApex, roadStatement, roadLimitless,
|
||||||
|
];
|
||||||
|
|
||||||
|
/** Wandelt einen Listeneintrag ("default:N" oder Upload-Pfad) in eine Bild-URL um. */
|
||||||
|
export function insightSrc(token) {
|
||||||
|
const match = /^default:(\d+)$/.exec(token || '');
|
||||||
|
if (match) return INSIGHTS_DEFAULTS[Number(match[1])]?.src || null;
|
||||||
|
return token || null;
|
||||||
|
}
|
||||||
|
|
@ -18,6 +18,7 @@ export const ENTITY_PERMISSIONS = {
|
||||||
faqs: 'content.manage',
|
faqs: 'content.manage',
|
||||||
partners: 'content.manage',
|
partners: 'content.manage',
|
||||||
text: 'content.manage',
|
text: 'content.manage',
|
||||||
|
site_images: 'content.manage',
|
||||||
services: 'services.manage',
|
services: 'services.manage',
|
||||||
packages: 'packages.manage',
|
packages: 'packages.manage',
|
||||||
brands: 'brands.manage',
|
brands: 'brands.manage',
|
||||||
|
|
|
||||||
50
hifi-src/src/hooks/useSiteImages.js
Normal file
50
hifi-src/src/hooks/useSiteImages.js
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
import { useSiteSettings } from '../context/SiteSettingsContext.jsx';
|
||||||
|
import { useLiveEdit } from '../context/LiveEditContext.jsx';
|
||||||
|
import {
|
||||||
|
SITE_IMAGE_SLOTS,
|
||||||
|
INSIGHTS_DEFAULTS,
|
||||||
|
PACKAGE_TIER_DEFAULTS,
|
||||||
|
defaultInsightTokens,
|
||||||
|
insightSrc,
|
||||||
|
} from '../constants/siteImages.js';
|
||||||
|
|
||||||
|
// Liest die austauschbaren Bilder (siehe constants/siteImages.js) inkl. noch nicht
|
||||||
|
// gespeicherter Aenderungen aus dem Live-Bearbeiten-Modus. Eintrag im Live-Modus:
|
||||||
|
// entity "site_images", id = Schluessel ("craft") bzw. "liste.index" ("insights.2"),
|
||||||
|
// field "path", Wert = Upload-Pfad oder leer (= Standardbild).
|
||||||
|
export default function useSiteImages(settingsOverride) {
|
||||||
|
const context = useSiteSettings();
|
||||||
|
const live = useLiveEdit();
|
||||||
|
const stored = (settingsOverride || context).site_images || {};
|
||||||
|
const value = (id, original) => live.getValue('site_images', id, 'path', 'de', original || '') || '';
|
||||||
|
|
||||||
|
/** Aktuelles Bild eines Einzelplatzes: { src, custom } - custom = eigener Upload-Pfad. */
|
||||||
|
const slot = (key) => {
|
||||||
|
const custom = value(key, stored[key]);
|
||||||
|
return { src: custom || SITE_IMAGE_SLOTS[key].src, custom };
|
||||||
|
};
|
||||||
|
|
||||||
|
/** "Einblicke"-Fotos: [{ id, src, width?, height?, custom }] */
|
||||||
|
const insights = () => {
|
||||||
|
const list = Array.isArray(stored.insights) ? stored.insights : defaultInsightTokens();
|
||||||
|
return list
|
||||||
|
.map((token, i) => {
|
||||||
|
let current = value(`insights.${i}`, token);
|
||||||
|
// Leer = wieder das eingebaute Foto an dieser Stelle (wie im Backend).
|
||||||
|
if (!current) current = i < INSIGHTS_DEFAULTS.length ? `default:${i}` : '';
|
||||||
|
const builtIn = /^default:(\d+)$/.exec(current);
|
||||||
|
const dims = builtIn ? INSIGHTS_DEFAULTS[Number(builtIn[1])] : {};
|
||||||
|
return { id: `insights.${i}`, src: insightSrc(current), width: dims.width, height: dims.height, custom: builtIn ? '' : current };
|
||||||
|
})
|
||||||
|
.filter((item) => item.src);
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Hintergrundbild einer Paketstufe (0-7). */
|
||||||
|
const packageTier = (index) => {
|
||||||
|
const list = Array.isArray(stored.package_tiers) ? stored.package_tiers : [];
|
||||||
|
const custom = value(`package_tiers.${index}`, list[index]);
|
||||||
|
return { src: custom || PACKAGE_TIER_DEFAULTS[index], custom };
|
||||||
|
};
|
||||||
|
|
||||||
|
return { slot, insights, packageTier };
|
||||||
|
}
|
||||||
|
|
@ -84,12 +84,12 @@ html {
|
||||||
Verlauf, Auto-Foto, Wellenlinien bzw. Grunge/Splatter/Kreisbogen komplett) -
|
Verlauf, Auto-Foto, Wellenlinien bzw. Grunge/Splatter/Kreisbogen komplett) -
|
||||||
keine eigenen Ebenen, Filter oder Verlaeufe mehr (README "Hintergruende"). */
|
keine eigenen Ebenen, Filter oder Verlaeufe mehr (README "Hintergruende"). */
|
||||||
.kontakt-sektion {
|
.kontakt-sektion {
|
||||||
background-image: url('./assets/contact/bg-light.webp');
|
background-image: var(--kontakt-bg-light, url('./assets/contact/bg-light.webp'));
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
}
|
}
|
||||||
.dark .kontakt-sektion {
|
.dark .kontakt-sektion {
|
||||||
background-image: url('./assets/contact/bg-dark.webp');
|
background-image: var(--kontakt-bg-dark, url('./assets/contact/bg-dark.webp'));
|
||||||
}
|
}
|
||||||
|
|
||||||
.kf-page input::placeholder,
|
.kf-page input::placeholder,
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,9 @@ import { Outlet, useLocation } from 'react-router-dom';
|
||||||
// Die einzelnen Einstellungs-Seiten stehen direkt in der Seitenleiste (Firma & Aussehen bzw.
|
// Die einzelnen Einstellungs-Seiten stehen direkt in der Seitenleiste (Firma & Aussehen bzw.
|
||||||
// System) - hier nur noch Titel und eine kurze Erklaerung je Seite statt einer Tab-Leiste.
|
// System) - hier nur noch Titel und eine kurze Erklaerung je Seite statt einer Tab-Leiste.
|
||||||
const PAGES = {
|
const PAGES = {
|
||||||
company: ['Firmendaten', 'Telefon, Adresse, Öffnungszeiten, Logo und der Hinweis unter den Paketpreisen.'],
|
company: ['Firmendaten', 'Telefon, Adresse, Öffnungszeiten und der Hinweis unter den Paketpreisen.'],
|
||||||
design: ['Aussehen', 'Titelbild, Schriften und das Aussehen der Kacheln auf der Website.'],
|
design: ['Aussehen', 'Schriften und das Aussehen der Kacheln auf der Website.'],
|
||||||
|
images: ['Bilder', 'Alle fest eingebauten Bilder der Website austauschen: Logo, Titelbild, Link-Vorschau, Startseiten-Fotos, Hintergründe und Paketkacheln. Ohne eigenes Bild gilt jeweils das Standardbild.'],
|
||||||
legal: ['Rechtstexte', 'Impressum, Datenschutzerklärung und AGB.'],
|
legal: ['Rechtstexte', 'Impressum, Datenschutzerklärung und AGB.'],
|
||||||
maintenance: ['Wartungsmodus', 'Die ganze Website oder einzelne Bereiche vorübergehend für Besucher sperren.'],
|
maintenance: ['Wartungsmodus', 'Die ganze Website oder einzelne Bereiche vorübergehend für Besucher sperren.'],
|
||||||
countdown: ['Launch-Countdown', 'Vor dem Start nur einen Countdown zeigen, der neugierig macht. Danach öffnet sich die Website von selbst.'],
|
countdown: ['Launch-Countdown', 'Vor dem Start nur einen Countdown zeigen, der neugierig macht. Danach öffnet sich die Website von selbst.'],
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import { dragAnchorStyle } from '../../../utils/dragAnchorPosition.js';
|
||||||
import { useCustomFonts, useCustomFontsRefresh, useFontOptionsWithCustom } from '../../../context/CustomFontsContext.jsx';
|
import { useCustomFonts, useCustomFontsRefresh, useFontOptionsWithCustom } from '../../../context/CustomFontsContext.jsx';
|
||||||
import { useToast, useUnsavedChanges } from '../../../context/AdminUiContext.jsx';
|
import { useToast, useUnsavedChanges } from '../../../context/AdminUiContext.jsx';
|
||||||
import SaveBar from '../../../components/admin/SaveBar.jsx';
|
import SaveBar from '../../../components/admin/SaveBar.jsx';
|
||||||
|
import SiteImagesEditor from '../../../components/admin/SiteImagesEditor.jsx';
|
||||||
|
|
||||||
const DAYS = [
|
const DAYS = [
|
||||||
{ key: 'mon', label: 'Montag' },
|
{ key: 'mon', label: 'Montag' },
|
||||||
|
|
@ -46,6 +47,7 @@ const emptyForm = {
|
||||||
page_loader_enabled: true,
|
page_loader_enabled: true,
|
||||||
price_note: '',
|
price_note: '',
|
||||||
price_note_en: '',
|
price_note_en: '',
|
||||||
|
site_images: {},
|
||||||
};
|
};
|
||||||
|
|
||||||
const PACKAGE_CARD_THEMES = [
|
const PACKAGE_CARD_THEMES = [
|
||||||
|
|
@ -60,8 +62,8 @@ const PACKAGE_CARD_LAYOUTS = [
|
||||||
{ value: 'coverflow', label: '3D-Coverflow', description: 'Kacheln drehen sich beim Wischen räumlich – die mittlere steht im Fokus.' },
|
{ value: 'coverflow', label: '3D-Coverflow', description: 'Kacheln drehen sich beim Wischen räumlich – die mittlere steht im Fokus.' },
|
||||||
];
|
];
|
||||||
|
|
||||||
// Eine Komponente fuer drei Seiten (siehe App.jsx): "company" = Firmendaten, "design" =
|
// Eine Komponente fuer vier Seiten (siehe App.jsx): "company" = Firmendaten, "design" =
|
||||||
// Aussehen, "google" = Google-Dienste. Gespeichert wird immer der komplette Datensatz, da
|
// Aussehen, "images" = Bilder, "google" = Google-Dienste. Gespeichert wird immer der komplette Datensatz, da
|
||||||
// /site-settings alle Felder auf einmal erwartet - jede Seite zeigt nur ihren Teil davon.
|
// /site-settings alle Felder auf einmal erwartet - jede Seite zeigt nur ihren Teil davon.
|
||||||
export default function WebsiteSettings({ section = 'company' }) {
|
export default function WebsiteSettings({ section = 'company' }) {
|
||||||
const show = (key) => key === section;
|
const show = (key) => key === section;
|
||||||
|
|
@ -197,6 +199,7 @@ export default function WebsiteSettings({ section = 'company' }) {
|
||||||
page_loader_enabled: res.page_loader_enabled === undefined ? true : !!res.page_loader_enabled,
|
page_loader_enabled: res.page_loader_enabled === undefined ? true : !!res.page_loader_enabled,
|
||||||
price_note: res.price_note || '',
|
price_note: res.price_note || '',
|
||||||
price_note_en: res.price_note_en || '',
|
price_note_en: res.price_note_en || '',
|
||||||
|
site_images: res.site_images && !Array.isArray(res.site_images) ? res.site_images : {},
|
||||||
};
|
};
|
||||||
setForm(loaded);
|
setForm(loaded);
|
||||||
setSavedForm(loaded);
|
setSavedForm(loaded);
|
||||||
|
|
@ -319,7 +322,12 @@ export default function WebsiteSettings({ section = 'company' }) {
|
||||||
setError('');
|
setError('');
|
||||||
setSaved(false);
|
setSaved(false);
|
||||||
try {
|
try {
|
||||||
if (formDirty) await api.post('/site-settings', form);
|
// Die Bilder nur von der Bilder-Seite mitschicken - sonst koennte ein aelteres Formular
|
||||||
|
// inzwischen im Live-Bearbeiten-Modus getauschte Bilder zuruecksetzen.
|
||||||
|
if (formDirty) {
|
||||||
|
const { site_images: siteImages, ...rest } = form;
|
||||||
|
await api.post('/site-settings', section === 'images' ? form : rest);
|
||||||
|
}
|
||||||
if (section === 'google' && gaDirty) await handleGaDashboardSave();
|
if (section === 'google' && gaDirty) await handleGaDashboardSave();
|
||||||
if (section === 'google' && reviewsDirty) await handleReviewsSave();
|
if (section === 'google' && reviewsDirty) await handleReviewsSave();
|
||||||
setSavedForm(form);
|
setSavedForm(form);
|
||||||
|
|
@ -340,7 +348,7 @@ export default function WebsiteSettings({ section = 'company' }) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<form id="website-settings-form" onSubmit={handleSave} className="max-w-2xl space-y-6">
|
<form id="website-settings-form" onSubmit={handleSave} className="max-w-2xl space-y-6">
|
||||||
{show('design') && (
|
{show('images') && (
|
||||||
<section className="rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900">
|
<section className="rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900">
|
||||||
<h2 className="mb-1 font-semibold text-neutral-900 dark:text-white">Großes Titelbild der Startseite</h2>
|
<h2 className="mb-1 font-semibold text-neutral-900 dark:text-white">Großes Titelbild der Startseite</h2>
|
||||||
<p className="mb-4 text-sm text-neutral-500 dark:text-neutral-400">
|
<p className="mb-4 text-sm text-neutral-500 dark:text-neutral-400">
|
||||||
|
|
@ -355,7 +363,7 @@ export default function WebsiteSettings({ section = 'company' }) {
|
||||||
</section>
|
</section>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{show('company') && (
|
{show('images') && (
|
||||||
<section className="rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900">
|
<section className="rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900">
|
||||||
<h2 className="mb-1 font-semibold text-neutral-900 dark:text-white">Firmenlogo</h2>
|
<h2 className="mb-1 font-semibold text-neutral-900 dark:text-white">Firmenlogo</h2>
|
||||||
<p className="mb-4 text-sm text-neutral-500 dark:text-neutral-400">
|
<p className="mb-4 text-sm text-neutral-500 dark:text-neutral-400">
|
||||||
|
|
@ -377,6 +385,10 @@ export default function WebsiteSettings({ section = 'company' }) {
|
||||||
</section>
|
</section>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{show('images') && (
|
||||||
|
<SiteImagesEditor value={form.site_images} onChange={(images) => update('site_images', images)} />
|
||||||
|
)}
|
||||||
|
|
||||||
{show('design') && (
|
{show('design') && (
|
||||||
<section className="rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900">
|
<section className="rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900">
|
||||||
<h2 className="mb-1 font-semibold text-neutral-900 dark:text-white">Schriftart</h2>
|
<h2 className="mb-1 font-semibold text-neutral-900 dark:text-white">Schriftart</h2>
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,10 @@ import localized from '../../utils/localized.js';
|
||||||
import { trackEvent } from '../../utils/analytics.js';
|
import { trackEvent } from '../../utils/analytics.js';
|
||||||
import { waHref } from '../../utils/contactLinks.js';
|
import { waHref } from '../../utils/contactLinks.js';
|
||||||
import { User, Mail, Phone, Car, Package, Send, MapPin, ExternalLink } from 'lucide-react';
|
import { User, Mail, Phone, Car, Package, Send, MapPin, ExternalLink } from 'lucide-react';
|
||||||
// Die Sektions-Hintergruende (bg-light.png / bg-dark.png) kommen als fertig
|
// Die Sektions-Hintergruende (bg-light / bg-dark) kommen als fertig gebackene Einzelbilder
|
||||||
// gebackene Einzelbilder ueber die CSS-Klasse .kontakt-sektion (index.css).
|
// ueber die CSS-Klasse .kontakt-sektion (index.css); im Admin getauschte Bilder setzen dort
|
||||||
|
// die CSS-Variablen --kontakt-bg-light/-dark.
|
||||||
|
import useSiteImages from '../../hooks/useSiteImages.js';
|
||||||
|
|
||||||
const digitsOnly = (value) => (value || '').replace(/[^\d+]/g, '');
|
const digitsOnly = (value) => (value || '').replace(/[^\d+]/g, '');
|
||||||
|
|
||||||
|
|
@ -102,6 +104,13 @@ export default function ContactPage() {
|
||||||
price_note_en: priceNoteEn,
|
price_note_en: priceNoteEn,
|
||||||
} = useSiteSettings();
|
} = useSiteSettings();
|
||||||
const { t, language } = useLanguage();
|
const { t, language } = useLanguage();
|
||||||
|
const siteImages = useSiteImages();
|
||||||
|
const bgLight = siteImages.slot('contact_bg_light').custom;
|
||||||
|
const bgDark = siteImages.slot('contact_bg_dark').custom;
|
||||||
|
const contactBackgrounds = {
|
||||||
|
...(bgLight && { '--kontakt-bg-light': `url("${bgLight}")` }),
|
||||||
|
...(bgDark && { '--kontakt-bg-dark': `url("${bgDark}")` }),
|
||||||
|
};
|
||||||
const { consent } = useCookieConsent();
|
const { consent } = useCookieConsent();
|
||||||
const shopAddress = [addressStreet, [addressZip, addressCity].filter(Boolean).join(' ')]
|
const shopAddress = [addressStreet, [addressZip, addressCity].filter(Boolean).join(' ')]
|
||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
|
|
@ -230,7 +239,7 @@ export default function ContactPage() {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="kf-page kontakt-sektion relative w-full overflow-hidden px-4 pb-10 sm:px-10"
|
className="kf-page kontakt-sektion relative w-full overflow-hidden px-4 pb-10 sm:px-10"
|
||||||
style={{ color: 'var(--kf-text2)', fontFamily: "'Barlow', sans-serif" }}
|
style={{ color: 'var(--kf-text2)', fontFamily: "'Barlow', sans-serif", ...contactBackgrounds }}
|
||||||
>
|
>
|
||||||
<div className="relative z-10 mx-auto max-w-[1280px] pt-10 sm:pt-14">
|
<div className="relative z-10 mx-auto max-w-[1280px] pt-10 sm:pt-14">
|
||||||
{/* Hero */}
|
{/* Hero */}
|
||||||
|
|
|
||||||
|
|
@ -13,15 +13,10 @@ import { useTextStyle } from '../../context/TextStylesContext.jsx';
|
||||||
import { useLanguage } from '../../context/LanguageContext.jsx';
|
import { useLanguage } from '../../context/LanguageContext.jsx';
|
||||||
import { dragAnchorStyle } from '../../utils/dragAnchorPosition.js';
|
import { dragAnchorStyle } from '../../utils/dragAnchorPosition.js';
|
||||||
import { useLiveEdit } from '../../context/LiveEditContext.jsx';
|
import { useLiveEdit } from '../../context/LiveEditContext.jsx';
|
||||||
import { EditableArea, EditableHtml, EditableT, EditableText } from '../../components/live/Editable.jsx';
|
import { EditableArea, EditableHtml, EditableImage, EditableT, EditableText } from '../../components/live/Editable.jsx';
|
||||||
import defaultHeroImage from '../../assets/photos/gallery-dash2.webp';
|
import defaultHeroImage from '../../assets/photos/gallery-dash2.webp';
|
||||||
import galleryAmp from '../../assets/photos/gallery-amp-purple.webp';
|
import useSiteImages from '../../hooks/useSiteImages.js';
|
||||||
import gallerySpeaker from '../../assets/photos/gallery-speaker.webp';
|
import { SITE_IMAGE_SLOTS } from '../../constants/siteImages.js';
|
||||||
import gallerySubs from '../../assets/photos/gallery-subs.webp';
|
|
||||||
import galleryDash from '../../assets/photos/gallery-dash.webp';
|
|
||||||
import galleryTrunk from '../../assets/photos/hero-trunk.webp';
|
|
||||||
import galleryRear from '../../assets/photos/gallery-rear.webp';
|
|
||||||
import heroHighlight from '../../assets/leistungen/hero-highlight.webp';
|
|
||||||
import youtubeVideo from '../../assets/videos/youtube-hintergrund.mp4';
|
import youtubeVideo from '../../assets/videos/youtube-hintergrund.mp4';
|
||||||
// Kurze 480p-Schleife (< 1 MB) fuer Handys statt der vollen 8,9-MB-Fassung.
|
// Kurze 480p-Schleife (< 1 MB) fuer Handys statt der vollen 8,9-MB-Fassung.
|
||||||
import youtubeVideoMobile from '../../assets/videos/youtube-hintergrund-mobil.mp4';
|
import youtubeVideoMobile from '../../assets/videos/youtube-hintergrund-mobil.mp4';
|
||||||
|
|
@ -83,19 +78,6 @@ function SectionButton({ slug, label, url, className, style }) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Native Pixelmasse der Bilder unten - nur fuer die width/height-Attribute auf <img>,
|
|
||||||
// damit der Browser vor dem Laden Platz reserviert (verhindert Layout-Sprung). Die
|
|
||||||
// tatsaechliche Anzeigegroesse wird weiterhin komplett per CSS (aspect-square etc.)
|
|
||||||
// bestimmt, diese Werte muessen also nicht exakt zum gerenderten Seitenverhaeltnis passen.
|
|
||||||
const galleryImages = [
|
|
||||||
{ src: gallerySubs, width: 900, height: 600 },
|
|
||||||
{ src: galleryAmp, width: 900, height: 600 },
|
|
||||||
{ src: gallerySpeaker, width: 900, height: 1200 },
|
|
||||||
{ src: galleryDash, width: 900, height: 814 },
|
|
||||||
{ src: galleryRear, width: 900, height: 1200 },
|
|
||||||
{ src: galleryTrunk, width: 1920, height: 1280 },
|
|
||||||
];
|
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
const { hero_image_path: heroImagePath } = useSiteSettings();
|
const { hero_image_path: heroImagePath } = useSiteSettings();
|
||||||
const heroImage = heroImagePath || defaultHeroImage;
|
const heroImage = heroImagePath || defaultHeroImage;
|
||||||
|
|
@ -106,8 +88,16 @@ export default function Home() {
|
||||||
const showVehicles = !isHidden('page.vehicles');
|
const showVehicles = !isHidden('page.vehicles');
|
||||||
|
|
||||||
const stats = t('home.stats');
|
const stats = t('home.stats');
|
||||||
|
// Austauschbare Bilder (Einstellungen > Bilder bzw. "Bild tauschen" im Live-Bearbeiten).
|
||||||
|
const siteImages = useSiteImages();
|
||||||
|
const craftImage = siteImages.slot('craft');
|
||||||
|
const adviceImage = siteImages.slot('advice');
|
||||||
|
const posterImage = siteImages.slot('youtube_poster');
|
||||||
|
const moreImage = siteImages.slot('more');
|
||||||
const galleryAlts = t('home.galleryAlts');
|
const galleryAlts = t('home.galleryAlts');
|
||||||
const gallery = galleryImages.map((img, i) => ({ ...img, alt: galleryAlts[i] }));
|
// width/height nur bei den eingebauten Fotos (native Pixelmasse, damit der Browser vor dem
|
||||||
|
// Laden Platz reserviert) - die Anzeigegroesse bestimmt ohnehin CSS (aspect-square).
|
||||||
|
const gallery = siteImages.insights().map((img, i) => ({ ...img, alt: galleryAlts[i] || galleryAlts[0] || '' }));
|
||||||
const [faqs, setFaqs] = useState([]);
|
const [faqs, setFaqs] = useState([]);
|
||||||
const [homeSections, setHomeSections] = useState({});
|
const [homeSections, setHomeSections] = useState({});
|
||||||
// Faellt /home-sections aus, greifen die Standardtexte - sonst bliebe z. B. die <h1> leer.
|
// Faellt /home-sections aus, greifen die Standardtexte - sonst bliebe z. B. die <h1> leer.
|
||||||
|
|
@ -390,10 +380,12 @@ export default function Home() {
|
||||||
muted
|
muted
|
||||||
playsInline
|
playsInline
|
||||||
preload="none"
|
preload="none"
|
||||||
poster={galleryDash}
|
poster={posterImage.src}
|
||||||
className="absolute inset-0 h-full w-full object-cover"
|
className="absolute inset-0 h-full w-full object-cover"
|
||||||
/>
|
/>
|
||||||
<div className="absolute inset-0 bg-black/55" />
|
<div className="absolute inset-0 bg-black/55" />
|
||||||
|
{/* Nur im Live-Bearbeiten-Modus sichtbar: Knopf zum Tauschen des Video-Standbilds. */}
|
||||||
|
<EditableImage id="youtube_poster" value={posterImage.custom} label={SITE_IMAGE_SLOTS.youtube_poster.label} aspect={SITE_IMAGE_SLOTS.youtube_poster.aspect} buttonLabel="Video-Standbild tauschen" className="absolute left-0 top-0 h-12 w-64" />
|
||||||
|
|
||||||
<div
|
<div
|
||||||
className="absolute w-full max-w-3xl px-4 text-center sm:px-6"
|
className="absolute w-full max-w-3xl px-4 text-center sm:px-6"
|
||||||
|
|
@ -425,14 +417,16 @@ export default function Home() {
|
||||||
<div className="mx-auto max-w-6xl space-y-16 overflow-hidden px-4 sm:px-6">
|
<div className="mx-auto max-w-6xl space-y-16 overflow-hidden px-4 sm:px-6">
|
||||||
<div className="grid items-center gap-8 md:grid-cols-2">
|
<div className="grid items-center gap-8 md:grid-cols-2">
|
||||||
<Reveal direction="left" shine className="rounded-xl shadow-lg">
|
<Reveal direction="left" shine className="rounded-xl shadow-lg">
|
||||||
|
<EditableImage id="craft" value={craftImage.custom} label={SITE_IMAGE_SLOTS.craft.label} aspect={SITE_IMAGE_SLOTS.craft.aspect}>
|
||||||
<img
|
<img
|
||||||
src={gallerySubs}
|
src={craftImage.src}
|
||||||
alt={t('home.craftImageAlt')}
|
alt={t('home.craftImageAlt')}
|
||||||
width={900}
|
width={900}
|
||||||
height={600}
|
height={600}
|
||||||
className="w-full rounded-xl object-cover"
|
className="w-full rounded-xl object-cover"
|
||||||
style={{ maxHeight: 380 }}
|
style={{ maxHeight: 380 }}
|
||||||
/>
|
/>
|
||||||
|
</EditableImage>
|
||||||
</Reveal>
|
</Reveal>
|
||||||
<Reveal direction="right" index={1} className={ALIGN_TEXT[section('craft').align]} style={{ fontFamily: section('craft').fontFamily }}>
|
<Reveal direction="right" index={1} className={ALIGN_TEXT[section('craft').align]} style={{ fontFamily: section('craft').fontFamily }}>
|
||||||
{(section('craft').eyebrow || editing) && (
|
{(section('craft').eyebrow || editing) && (
|
||||||
|
|
@ -452,14 +446,16 @@ export default function Home() {
|
||||||
<EditableHtml entity="home_sections" id="advice" field="body_html" value={section('advice').bodyHtml} label="Text" className="legal-content text-neutral-600 dark:text-neutral-300" />
|
<EditableHtml entity="home_sections" id="advice" field="body_html" value={section('advice').bodyHtml} label="Text" className="legal-content text-neutral-600 dark:text-neutral-300" />
|
||||||
</Reveal>
|
</Reveal>
|
||||||
<Reveal direction="right" index={1} shine className="order-1 md:order-2 rounded-xl shadow-lg">
|
<Reveal direction="right" index={1} shine className="order-1 md:order-2 rounded-xl shadow-lg">
|
||||||
|
<EditableImage id="advice" value={adviceImage.custom} label={SITE_IMAGE_SLOTS.advice.label} aspect={SITE_IMAGE_SLOTS.advice.aspect}>
|
||||||
<img
|
<img
|
||||||
src={galleryAmp}
|
src={adviceImage.src}
|
||||||
alt={t('home.adviceImageAlt')}
|
alt={t('home.adviceImageAlt')}
|
||||||
width={900}
|
width={900}
|
||||||
height={600}
|
height={600}
|
||||||
className="w-full rounded-xl object-cover"
|
className="w-full rounded-xl object-cover"
|
||||||
style={{ maxHeight: 380 }}
|
style={{ maxHeight: 380 }}
|
||||||
/>
|
/>
|
||||||
|
</EditableImage>
|
||||||
</Reveal>
|
</Reveal>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -477,7 +473,8 @@ export default function Home() {
|
||||||
</Reveal>
|
</Reveal>
|
||||||
<div className="grid grid-cols-2 gap-3 sm:grid-cols-3">
|
<div className="grid grid-cols-2 gap-3 sm:grid-cols-3">
|
||||||
{gallery.map((img, i) => (
|
{gallery.map((img, i) => (
|
||||||
<Reveal key={img.src} index={i % 3} shine className="aspect-square overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800">
|
<Reveal key={img.id} index={i % 3} shine className="aspect-square overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800">
|
||||||
|
<EditableImage id={img.id} value={img.custom} label={`Einblicke: Foto ${i + 1}`} aspect={1} className="h-full w-full">
|
||||||
<img
|
<img
|
||||||
src={img.src}
|
src={img.src}
|
||||||
alt={img.alt}
|
alt={img.alt}
|
||||||
|
|
@ -486,6 +483,7 @@ export default function Home() {
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
className="h-full w-full object-cover transition duration-300 hover:scale-105"
|
className="h-full w-full object-cover transition duration-300 hover:scale-105"
|
||||||
/>
|
/>
|
||||||
|
</EditableImage>
|
||||||
</Reveal>
|
</Reveal>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -523,14 +521,16 @@ export default function Home() {
|
||||||
<section className="mx-auto max-w-6xl overflow-hidden px-4 py-16 sm:px-6">
|
<section className="mx-auto max-w-6xl overflow-hidden px-4 py-16 sm:px-6">
|
||||||
<div className="grid items-center gap-10 md:grid-cols-2">
|
<div className="grid items-center gap-10 md:grid-cols-2">
|
||||||
<Reveal direction="left" shine className="overflow-hidden rounded-xl shadow-lg">
|
<Reveal direction="left" shine className="overflow-hidden rounded-xl shadow-lg">
|
||||||
|
<EditableImage id="more" value={moreImage.custom} label={SITE_IMAGE_SLOTS.more.label} aspect={SITE_IMAGE_SLOTS.more.aspect} className="h-full w-full">
|
||||||
<img
|
<img
|
||||||
src={heroHighlight}
|
src={moreImage.src}
|
||||||
alt={t('home.moreImageAlt')}
|
alt={t('home.moreImageAlt')}
|
||||||
width={1600}
|
width={1600}
|
||||||
height={905}
|
height={905}
|
||||||
className="h-full w-full object-cover"
|
className="h-full w-full object-cover"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
/>
|
/>
|
||||||
|
</EditableImage>
|
||||||
</Reveal>
|
</Reveal>
|
||||||
<Reveal
|
<Reveal
|
||||||
direction="right"
|
direction="right"
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,7 @@ import { telHref, waHref } from '../../utils/contactLinks.js';
|
||||||
import { trackEvent } from '../../utils/analytics.js';
|
import { trackEvent } from '../../utils/analytics.js';
|
||||||
import { useLiveEdit } from '../../context/LiveEditContext.jsx';
|
import { useLiveEdit } from '../../context/LiveEditContext.jsx';
|
||||||
import { EditableArea, EditableText } from '../../components/live/Editable.jsx';
|
import { EditableArea, EditableText } from '../../components/live/Editable.jsx';
|
||||||
|
import useSiteImages from '../../hooks/useSiteImages.js';
|
||||||
|
|
||||||
const hslToRgb = (h, s, l) => {
|
const hslToRgb = (h, s, l) => {
|
||||||
s /= 100;
|
s /= 100;
|
||||||
|
|
@ -429,7 +430,12 @@ export default function ModelPage() {
|
||||||
price_note_en: priceNoteEn,
|
price_note_en: priceNoteEn,
|
||||||
} = useSiteSettings();
|
} = useSiteSettings();
|
||||||
const priceNote = (language === 'en' && priceNoteEn) || priceNoteDe;
|
const priceNote = (language === 'en' && priceNoteEn) || priceNoteDe;
|
||||||
const TIERS = PACKAGE_THEMES[packageCardTheme] || PACKAGE_THEMES.graphite;
|
// Eigene Kachelbilder je Stufe (Einstellungen > Bilder) gelten in jedem Farbschema.
|
||||||
|
const siteImages = useSiteImages();
|
||||||
|
const TIERS = (PACKAGE_THEMES[packageCardTheme] || PACKAGE_THEMES.graphite).map((tier, i) => {
|
||||||
|
const { custom } = siteImages.packageTier(i);
|
||||||
|
return custom ? { ...tier, img: custom } : tier;
|
||||||
|
});
|
||||||
const layout = ['grid', 'strip', 'coverflow'].includes(packageCardLayout) ? packageCardLayout : 'strip';
|
const layout = ['grid', 'strip', 'coverflow'].includes(packageCardLayout) ? packageCardLayout : 'strip';
|
||||||
const wheelHintInterval = Math.max(2, Number(wheelHintIntervalSetting) || 8) * 1000;
|
const wheelHintInterval = Math.max(2, Number(wheelHintIntervalSetting) || 8) * 1000;
|
||||||
const scrollerRef = useRef(null);
|
const scrollerRef = useRef(null);
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,12 @@ RewriteRule ^api/(.*)$ api/public/index.php [QSA,L]
|
||||||
# Dynamische sitemap.xml (DB-generiert)
|
# Dynamische sitemap.xml (DB-generiert)
|
||||||
RewriteRule ^sitemap\.xml$ api/public/sitemap.php [L]
|
RewriteRule ^sitemap\.xml$ api/public/sitemap.php [L]
|
||||||
|
|
||||||
# Alles andere: SPA-Fallback auf index.html (React Router übernimmt das Routing)
|
# Startseite und SPA-Fallback ueber page.php: liefert die index.html aus und setzt dabei das im
|
||||||
|
# Admin hinterlegte Link-Vorschaubild (og:image) und Favicon ein - WhatsApp & Co. lesen nur das
|
||||||
|
# HTML vom Server. Faellt die Datenbank aus, kommt die index.html unveraendert.
|
||||||
|
RewriteRule ^(index\.html)?$ api/public/page.php [QSA,L]
|
||||||
|
|
||||||
|
# Alles andere: SPA-Fallback (React Router übernimmt das Routing)
|
||||||
RewriteCond %{REQUEST_FILENAME} !-f
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
RewriteCond %{REQUEST_FILENAME} !-d
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
RewriteRule ^ index.html [QSA,L]
|
RewriteRule ^ api/public/page.php [QSA,L]
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,7 @@ CREATE TABLE app_settings (
|
||||||
countdown_title_en VARCHAR(150) NULL,
|
countdown_title_en VARCHAR(150) NULL,
|
||||||
countdown_message VARCHAR(500) NULL,
|
countdown_message VARCHAR(500) NULL,
|
||||||
countdown_message_en VARCHAR(500) NULL,
|
countdown_message_en VARCHAR(500) NULL,
|
||||||
|
site_images TEXT NULL,
|
||||||
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||||
) ENGINE=InnoDB;
|
) ENGINE=InnoDB;
|
||||||
|
|
||||||
|
|
|
||||||
84
hifi/api/public/page.php
Normal file
84
hifi/api/public/page.php
Normal file
|
|
@ -0,0 +1,84 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Liefert die index.html der React-App aus (SPA-Fallback, siehe hifi/.htaccess) und setzt
|
||||||
|
* dabei die im Admin hinterlegten Bilder ein, die schon im HTML stehen muessen: das
|
||||||
|
* Link-Vorschaubild (og:image fuer WhatsApp, Facebook & Co. - deren Vorschau fuehrt kein
|
||||||
|
* JavaScript aus) und das Favicon. Ohne eigenes Bild oder wenn die Datenbank nicht
|
||||||
|
* erreichbar ist, geht die index.html unveraendert raus - die Seite bleibt also immer
|
||||||
|
* erreichbar.
|
||||||
|
*/
|
||||||
|
|
||||||
|
require __DIR__ . '/../vendor/autoload.php';
|
||||||
|
|
||||||
|
use App\Support\SiteImages;
|
||||||
|
|
||||||
|
$html = @file_get_contents(__DIR__ . '/../../index.html');
|
||||||
|
if ($html === false) {
|
||||||
|
http_response_code(500);
|
||||||
|
exit('index.html fehlt - bitte "npm run build" ausfuehren.');
|
||||||
|
}
|
||||||
|
|
||||||
|
header('Content-Type: text/html; charset=utf-8');
|
||||||
|
header('Cache-Control: no-cache');
|
||||||
|
|
||||||
|
/** Gespeicherte Bilder lesen - eigene Verbindung, da Database::connection() bei Fehlern JSON ausgibt. */
|
||||||
|
function hifi_site_images(): array
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$config = require __DIR__ . '/../config/config.php';
|
||||||
|
$db = $config['db'];
|
||||||
|
if (empty($db['host']) || empty($db['name'])) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
$pdo = new PDO(
|
||||||
|
"mysql:host={$db['host']};dbname={$db['name']};charset={$db['charset']}",
|
||||||
|
$db['user'],
|
||||||
|
$db['pass'],
|
||||||
|
[PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_TIMEOUT => 3]
|
||||||
|
);
|
||||||
|
$raw = $pdo->query('SELECT site_images FROM app_settings WHERE id = 1')->fetchColumn();
|
||||||
|
return SiteImages::decode($raw);
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Absolute URL auf diesem Server (Vorschau-Dienste brauchen eine volle Adresse). */
|
||||||
|
function hifi_absolute_url(string $path): string
|
||||||
|
{
|
||||||
|
$https = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')
|
||||||
|
|| strtolower($_SERVER['HTTP_X_FORWARDED_PROTO'] ?? '') === 'https';
|
||||||
|
$host = (string) ($_SERVER['HTTP_HOST'] ?? '');
|
||||||
|
if (!preg_match('/^[A-Za-z0-9.\-]+(:\d+)?$/', $host)) {
|
||||||
|
$config = require __DIR__ . '/../config/config.php';
|
||||||
|
return rtrim($config['app']['site_url'], '/') . $path;
|
||||||
|
}
|
||||||
|
return ($https ? 'https://' : 'http://') . $host . $path;
|
||||||
|
}
|
||||||
|
|
||||||
|
$images = hifi_site_images();
|
||||||
|
|
||||||
|
if (!empty($images['og_image'])) {
|
||||||
|
$url = htmlspecialchars(hifi_absolute_url($images['og_image']), ENT_QUOTES);
|
||||||
|
// Alle Verweise auf das eingebaute Vorschaubild (og:image, twitter:image, JSON-LD).
|
||||||
|
$html = preg_replace('#https?://[^"\s]*/og-image\.jpg#', $url, $html);
|
||||||
|
$size = @getimagesize(__DIR__ . '/../uploads/' . basename($images['og_image']));
|
||||||
|
if ($size) {
|
||||||
|
$html = preg_replace('#(<meta property="og:image:width" content=")\d+#', '${1}' . (int) $size[0], $html);
|
||||||
|
$html = preg_replace('#(<meta property="og:image:height" content=")\d+#', '${1}' . (int) $size[1], $html);
|
||||||
|
} else {
|
||||||
|
$html = preg_replace('#\s*<meta property="og:image:(width|height)" content="\d+" />#', '', $html);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($images['favicon'])) {
|
||||||
|
$type = str_ends_with($images['favicon'], '.png') ? 'image/png' : (str_ends_with($images['favicon'], '.webp') ? 'image/webp' : 'image/jpeg');
|
||||||
|
$html = preg_replace(
|
||||||
|
'#<link rel="icon" type="image/png" href="[^"]*" />#',
|
||||||
|
'<link rel="icon" type="' . $type . '" href="' . htmlspecialchars($images['favicon'], ENT_QUOTES) . '" />',
|
||||||
|
$html
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
echo $html;
|
||||||
|
|
@ -5,6 +5,7 @@ namespace App\Controllers;
|
||||||
use App\Config\Database;
|
use App\Config\Database;
|
||||||
use App\Middleware\AuthMiddleware;
|
use App\Middleware\AuthMiddleware;
|
||||||
use App\Support\Http;
|
use App\Support\Http;
|
||||||
|
use App\Support\SiteImages;
|
||||||
use App\Support\Translations;
|
use App\Support\Translations;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -101,6 +102,10 @@ class LiveEditController
|
||||||
private const TEXT_KEY_PATTERN = '/^[A-Za-z0-9_]+(\.[A-Za-z0-9_]+){1,5}$/';
|
private const TEXT_KEY_PATTERN = '/^[A-Za-z0-9_]+(\.[A-Za-z0-9_]+){1,5}$/';
|
||||||
private const TEXT_MAX_LENGTH = 2000;
|
private const TEXT_MAX_LENGTH = 2000;
|
||||||
|
|
||||||
|
// Austauschbare Bilder (Support/SiteImages): id = Schluessel ("craft", "insights.2"),
|
||||||
|
// value = Upload-Pfad oder leer fuer das eingebaute Standardbild.
|
||||||
|
private const IMAGE_PERMISSION = 'content.manage';
|
||||||
|
|
||||||
/** Oeffentlich (ueber /site-settings): alle Ueberschreibungen als ['de' => [key => text], 'en' => [...]]. */
|
/** Oeffentlich (ueber /site-settings): alle Ueberschreibungen als ['de' => [key => text], 'en' => [...]]. */
|
||||||
public static function textOverrides(): array
|
public static function textOverrides(): array
|
||||||
{
|
{
|
||||||
|
|
@ -149,9 +154,18 @@ class LiveEditController
|
||||||
$db = Database::connection();
|
$db = Database::connection();
|
||||||
$db->beginTransaction();
|
$db->beginTransaction();
|
||||||
try {
|
try {
|
||||||
|
$images = null;
|
||||||
foreach ($validated as $change) {
|
foreach ($validated as $change) {
|
||||||
|
if ($change['entity'] === 'site_images') {
|
||||||
|
// Bilder gesammelt in einem Rutsch speichern (und erst dann Uploads aufraeumen).
|
||||||
|
$images = SiteImages::set($images ?? SiteImages::load(), $change['slot'], $change['index'], $change['value']);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
self::apply($db, $change);
|
self::apply($db, $change);
|
||||||
}
|
}
|
||||||
|
if ($images !== null) {
|
||||||
|
SiteImages::save($db, $images);
|
||||||
|
}
|
||||||
$db->commit();
|
$db->commit();
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
$db->rollBack();
|
$db->rollBack();
|
||||||
|
|
@ -187,6 +201,18 @@ class LiveEditController
|
||||||
return ['entity' => 'text', 'id' => $key, 'lang' => $lang, 'value' => trim($value)];
|
return ['entity' => 'text', 'id' => $key, 'lang' => $lang, 'value' => trim($value)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($entity === 'site_images') {
|
||||||
|
if (!$can(self::IMAGE_PERMISSION)) {
|
||||||
|
Http::error('Keine Berechtigung, Bilder der Website zu tauschen.', 403);
|
||||||
|
}
|
||||||
|
$parsed = SiteImages::parseKey((string) ($change['id'] ?? ''));
|
||||||
|
$value = trim($value);
|
||||||
|
if ($parsed === null || ($value !== '' && SiteImages::paths([$value]) === [])) {
|
||||||
|
Http::error("Änderung $position: ungültiges Bild.", 422);
|
||||||
|
}
|
||||||
|
return ['entity' => 'site_images', 'slot' => $parsed[0], 'index' => $parsed[1], 'value' => $value];
|
||||||
|
}
|
||||||
|
|
||||||
$config = self::ENTITIES[$entity] ?? null;
|
$config = self::ENTITIES[$entity] ?? null;
|
||||||
if ($config === null) {
|
if ($config === null) {
|
||||||
Http::error("Änderung $position: dieser Bereich kann nicht live bearbeitet werden.", 422);
|
Http::error("Änderung $position: dieser Bereich kann nicht live bearbeitet werden.", 422);
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ namespace App\Controllers;
|
||||||
|
|
||||||
use App\Config\Database;
|
use App\Config\Database;
|
||||||
use App\Support\Http;
|
use App\Support\Http;
|
||||||
|
use App\Support\SiteImages;
|
||||||
use App\Support\Slug;
|
use App\Support\Slug;
|
||||||
use App\Support\Uploads;
|
use App\Support\Uploads;
|
||||||
use PDO;
|
use PDO;
|
||||||
|
|
@ -49,7 +50,7 @@ class SettingsController
|
||||||
'gallery_card_text_x', 'gallery_card_text_y', 'site_font', 'page_loader_enabled', 'hidden_areas',
|
'gallery_card_text_x', 'gallery_card_text_y', 'site_font', 'page_loader_enabled', 'hidden_areas',
|
||||||
'price_note', 'price_note_en',
|
'price_note', 'price_note_en',
|
||||||
'countdown_enabled', 'countdown_launch_at', 'countdown_title', 'countdown_title_en',
|
'countdown_enabled', 'countdown_launch_at', 'countdown_title', 'countdown_title_en',
|
||||||
'countdown_message', 'countdown_message_en',
|
'countdown_message', 'countdown_message_en', 'site_images',
|
||||||
'mail_host', 'mail_port', 'mail_username', 'mail_encryption',
|
'mail_host', 'mail_port', 'mail_username', 'mail_encryption',
|
||||||
'mail_from_email', 'mail_from_name', 'mail_notify_email',
|
'mail_from_email', 'mail_from_name', 'mail_notify_email',
|
||||||
'mail_customer_subject', 'mail_customer_body', 'mail_owner_subject', 'mail_owner_body',
|
'mail_customer_subject', 'mail_customer_body', 'mail_owner_subject', 'mail_owner_body',
|
||||||
|
|
@ -108,6 +109,21 @@ class SettingsController
|
||||||
'app_settings' => ['hero_image_path', 'logo_path', 'logo_dark_path'],
|
'app_settings' => ['hero_image_path', 'logo_path', 'logo_dark_path'],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/** Bild-Pfade einer Zeile - inkl. der als JSON gespeicherten app_settings.site_images. */
|
||||||
|
private static function imagePathsOf(string $table, array $row, array $columns): array
|
||||||
|
{
|
||||||
|
$paths = [];
|
||||||
|
foreach ($columns as $column) {
|
||||||
|
if (!empty($row[$column])) {
|
||||||
|
$paths[] = $row[$column];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($table === 'app_settings' && !empty($row['site_images'])) {
|
||||||
|
$paths = array_merge($paths, SiteImages::paths(SiteImages::decode($row['site_images'])));
|
||||||
|
}
|
||||||
|
return $paths;
|
||||||
|
}
|
||||||
|
|
||||||
// Kein const, da abhängig von der Umgebung (base_path unterscheidet sich
|
// Kein const, da abhängig von der Umgebung (base_path unterscheidet sich
|
||||||
// zwischen lokalem /hifi und der Root-Domain auf IONOS).
|
// zwischen lokalem /hifi und der Root-Domain auf IONOS).
|
||||||
private static function uploadsUrlPrefix(): string
|
private static function uploadsUrlPrefix(): string
|
||||||
|
|
@ -137,8 +153,8 @@ class SettingsController
|
||||||
$images = [];
|
$images = [];
|
||||||
foreach (self::IMAGE_COLUMNS as $table => $columns) {
|
foreach (self::IMAGE_COLUMNS as $table => $columns) {
|
||||||
foreach (($data[$table] ?? []) as $row) {
|
foreach (($data[$table] ?? []) as $row) {
|
||||||
foreach ($columns as $column) {
|
foreach (self::imagePathsOf($table, $row, $columns) as $path) {
|
||||||
self::collectImage($row[$column] ?? null, $images);
|
self::collectImage($path, $images);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -271,10 +287,8 @@ class SettingsController
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
foreach (($data[$table] ?? []) as $row) {
|
foreach (($data[$table] ?? []) as $row) {
|
||||||
foreach ($columns as $column) {
|
foreach (self::imagePathsOf($table, $row, $columns) as $path) {
|
||||||
if (!empty($row[$column])) {
|
$wantedPaths[$path] = true;
|
||||||
$wantedPaths[$row[$column]] = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ namespace App\Controllers;
|
||||||
use App\Config\Database;
|
use App\Config\Database;
|
||||||
use App\Support\Fonts;
|
use App\Support\Fonts;
|
||||||
use App\Support\Http;
|
use App\Support\Http;
|
||||||
|
use App\Support\SiteImages;
|
||||||
use App\Support\Uploads;
|
use App\Support\Uploads;
|
||||||
|
|
||||||
class SiteSettingsController
|
class SiteSettingsController
|
||||||
|
|
@ -97,6 +98,8 @@ class SiteSettingsController
|
||||||
$decodedHours = is_string($row['business_hours'] ?? null) ? json_decode($row['business_hours'], true) : null;
|
$decodedHours = is_string($row['business_hours'] ?? null) ? json_decode($row['business_hours'], true) : null;
|
||||||
$result['business_hours'] = is_array($decodedHours) ? $decodedHours : self::DEFAULT_BUSINESS_HOURS;
|
$result['business_hours'] = is_array($decodedHours) ? $decodedHours : self::DEFAULT_BUSINESS_HOURS;
|
||||||
$result['hidden_areas'] = self::decodeHiddenAreas($row['hidden_areas'] ?? null);
|
$result['hidden_areas'] = self::decodeHiddenAreas($row['hidden_areas'] ?? null);
|
||||||
|
// Austauschbare Bilder (Einstellungen > Bilder) - leeres Objekt = ueberall Standardbilder.
|
||||||
|
$result['site_images'] = (object) SiteImages::load();
|
||||||
// Navbar/Footer zeigen "Downloads" nur, wenn dort auch etwas zu finden ist.
|
// Navbar/Footer zeigen "Downloads" nur, wenn dort auch etwas zu finden ist.
|
||||||
$result['has_downloads'] = DownloadController::hasVisible();
|
$result['has_downloads'] = DownloadController::hasVisible();
|
||||||
// Im Live-Bearbeiten-Modus geaenderte feste Texte - kommen hier mit, damit sie ohne
|
// Im Live-Bearbeiten-Modus geaenderte feste Texte - kommen hier mit, damit sie ohne
|
||||||
|
|
@ -260,6 +263,15 @@ class SiteSettingsController
|
||||||
// Spalten fehlen noch (Datenbank nicht nachgeruestet) - Rest ist gespeichert
|
// Spalten fehlen noch (Datenbank nicht nachgeruestet) - Rest ist gespeichert
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Nur wenn mitgeschickt - aeltere/andere Formulare lassen die Bilder unangetastet.
|
||||||
|
if (is_array($body['site_images'] ?? null)) {
|
||||||
|
try {
|
||||||
|
SiteImages::save($db, $body['site_images']);
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
// Spalte fehlt noch (Datenbank nicht nachgeruestet) - Rest ist gespeichert
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Uploads::deleteIfOrphaned($old['hero_image_path'] ?? null, $newHeroImagePath);
|
Uploads::deleteIfOrphaned($old['hero_image_path'] ?? null, $newHeroImagePath);
|
||||||
Uploads::deleteIfOrphaned($old['logo_path'] ?? null, $newLogoPath);
|
Uploads::deleteIfOrphaned($old['logo_path'] ?? null, $newLogoPath);
|
||||||
Uploads::deleteIfOrphaned($old['logo_dark_path'] ?? null, $newLogoDarkPath);
|
Uploads::deleteIfOrphaned($old['logo_dark_path'] ?? null, $newLogoDarkPath);
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,7 @@ class Schema
|
||||||
countdown_title_en VARCHAR(150) NULL,
|
countdown_title_en VARCHAR(150) NULL,
|
||||||
countdown_message VARCHAR(500) NULL,
|
countdown_message VARCHAR(500) NULL,
|
||||||
countdown_message_en VARCHAR(500) NULL,
|
countdown_message_en VARCHAR(500) NULL,
|
||||||
|
site_images TEXT NULL,
|
||||||
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||||
) ENGINE=InnoDB",
|
) ENGINE=InnoDB",
|
||||||
|
|
||||||
|
|
@ -470,6 +471,7 @@ class Schema
|
||||||
'countdown_title_en' => 'VARCHAR(150) NULL',
|
'countdown_title_en' => 'VARCHAR(150) NULL',
|
||||||
'countdown_message' => 'VARCHAR(500) NULL',
|
'countdown_message' => 'VARCHAR(500) NULL',
|
||||||
'countdown_message_en' => 'VARCHAR(500) NULL',
|
'countdown_message_en' => 'VARCHAR(500) NULL',
|
||||||
|
'site_images' => 'TEXT NULL',
|
||||||
'updated_at' => 'DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
|
'updated_at' => 'DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
|
||||||
],
|
],
|
||||||
'legal_pages' => [
|
'legal_pages' => [
|
||||||
|
|
|
||||||
166
hifi/api/src/Support/SiteImages.php
Normal file
166
hifi/api/src/Support/SiteImages.php
Normal file
|
|
@ -0,0 +1,166 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Support;
|
||||||
|
|
||||||
|
use App\Config\Database;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Austauschbare Bilder der Website, die bisher fest im Frontend-Build steckten (Link-Vorschau,
|
||||||
|
* Startseiten-Fotos, "Einblicke in unsere Umbauten", Kontakt-/Countdown-Hintergrund,
|
||||||
|
* Paketkacheln, Favicon). Alles zusammen als JSON in app_settings.site_images, damit nicht fuer
|
||||||
|
* jedes Bild eine eigene Spalte noetig ist. Leer/fehlend = das eingebaute Standardbild.
|
||||||
|
*
|
||||||
|
* Gepflegt unter Einstellungen > Bilder (/site-settings) und im Live-Bearbeiten-Modus
|
||||||
|
* (LiveEditController, entity "site_images", id = Schluessel bzw. "liste.index").
|
||||||
|
*/
|
||||||
|
class SiteImages
|
||||||
|
{
|
||||||
|
// Einzelbilder - die Schluessel muessen zu hifi-src/src/constants/siteImages.js passen.
|
||||||
|
public const SLOTS = [
|
||||||
|
'og_image', 'favicon', 'craft', 'advice', 'youtube_poster', 'more',
|
||||||
|
'contact_bg_light', 'contact_bg_dark', 'countdown_bg',
|
||||||
|
];
|
||||||
|
|
||||||
|
// Bilderlisten mit Hoechstzahl. package_tiers hat feste Positionen (Stufe 1-8), leere
|
||||||
|
// Eintraege bleiben dort als null stehen; insights ist eine frei lange Liste, in der
|
||||||
|
// "default:N" fuer das N-te eingebaute Foto steht (so lassen sich die Standardfotos
|
||||||
|
// einzeln behalten, entfernen oder umsortieren). Ohne gespeicherte Liste gelten alle.
|
||||||
|
public const LISTS = ['insights' => 24, 'package_tiers' => 8];
|
||||||
|
public const INSIGHTS_DEFAULT_COUNT = 6;
|
||||||
|
|
||||||
|
/** Gespeichertes JSON auf bekannte Schluessel und gueltige Upload-Pfade filtern. */
|
||||||
|
public static function decode($raw): array
|
||||||
|
{
|
||||||
|
$decoded = is_string($raw) ? json_decode($raw, true) : (is_array($raw) ? $raw : null);
|
||||||
|
$decoded = is_array($decoded) ? $decoded : [];
|
||||||
|
$result = [];
|
||||||
|
foreach (self::SLOTS as $slot) {
|
||||||
|
$path = self::cleanPath($decoded[$slot] ?? null);
|
||||||
|
if ($path !== null) {
|
||||||
|
$result[$slot] = $path;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach (self::LISTS as $list => $max) {
|
||||||
|
$items = is_array($decoded[$list] ?? null) ? array_slice(array_values($decoded[$list]), 0, $max) : [];
|
||||||
|
if ($list === 'insights') {
|
||||||
|
$items = array_values(array_filter(array_map([self::class, 'cleanInsight'], $items)));
|
||||||
|
// Auch eine leere Liste speichern - dann sind alle Fotos bewusst entfernt.
|
||||||
|
if (array_key_exists($list, $decoded) && is_array($decoded[$list])) {
|
||||||
|
$result[$list] = $items;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$items = array_map([self::class, 'cleanPath'], $items);
|
||||||
|
if (array_filter($items)) {
|
||||||
|
$result[$list] = $items;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Alle in den Bildern verwendeten Upload-Pfade (fuer Export und Aufraeumen). */
|
||||||
|
public static function paths(array $images): array
|
||||||
|
{
|
||||||
|
$paths = [];
|
||||||
|
foreach ($images as $value) {
|
||||||
|
foreach ((array) $value as $path) {
|
||||||
|
if (is_string($path) && self::cleanPath($path) !== null) {
|
||||||
|
$paths[] = $path;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $paths;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function load(): array
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$raw = Database::connection()->query('SELECT site_images FROM app_settings WHERE id = 1')->fetchColumn();
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
return []; // Spalte fehlt noch - es gelten die eingebauten Bilder
|
||||||
|
}
|
||||||
|
return self::decode($raw);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Speichert die komplette Bilderliste und loescht dabei nicht mehr verwendete Uploads. */
|
||||||
|
public static function save(\PDO $db, array $images): array
|
||||||
|
{
|
||||||
|
$old = self::load();
|
||||||
|
$images = self::decode($images);
|
||||||
|
$db->exec('INSERT IGNORE INTO app_settings (id) VALUES (1)');
|
||||||
|
$db->prepare('UPDATE app_settings SET site_images = ? WHERE id = 1')
|
||||||
|
->execute([$images ? json_encode($images, JSON_UNESCAPED_SLASHES) : null]);
|
||||||
|
|
||||||
|
$stillUsed = self::paths($images);
|
||||||
|
foreach (self::paths($old) as $path) {
|
||||||
|
if (!in_array($path, $stillUsed, true)) {
|
||||||
|
Uploads::deleteIfOrphaned($path, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $images;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prueft einen Schluessel aus dem Live-Bearbeiten-Modus: "craft" oder "insights.3".
|
||||||
|
* Liefert [schluessel, index|null] oder null, wenn er unbekannt ist.
|
||||||
|
*/
|
||||||
|
public static function parseKey(string $key): ?array
|
||||||
|
{
|
||||||
|
if (in_array($key, self::SLOTS, true)) {
|
||||||
|
return [$key, null];
|
||||||
|
}
|
||||||
|
if (preg_match('/^([a-z_]+)\.(\d{1,2})$/', $key, $m) && isset(self::LISTS[$m[1]]) && (int) $m[2] < self::LISTS[$m[1]]) {
|
||||||
|
return [$m[1], (int) $m[2]];
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Setzt ein einzelnes Bild (Live-Bearbeiten); leerer Pfad = Standardbild. */
|
||||||
|
public static function set(array $images, string $slot, ?int $index, string $path): array
|
||||||
|
{
|
||||||
|
$path = self::cleanPath($path);
|
||||||
|
if ($index === null) {
|
||||||
|
$images[$slot] = $path;
|
||||||
|
return $images;
|
||||||
|
}
|
||||||
|
$list = $images[$slot] ?? ($slot === 'insights' ? self::defaultInsights() : []);
|
||||||
|
if ($slot === 'insights' && $path === null) {
|
||||||
|
// Leeren heisst bei den Einblicken: wieder das eingebaute Foto an dieser Stelle.
|
||||||
|
$path = $index < self::INSIGHTS_DEFAULT_COUNT ? "default:$index" : null;
|
||||||
|
}
|
||||||
|
// Die eingebauten Standardbilder fuellen die Luecken (null) - so kann ein einzelnes
|
||||||
|
// Bild in der Mitte getauscht werden, ohne dass die anderen verrutschen.
|
||||||
|
while (count($list) <= $index) {
|
||||||
|
$list[] = null;
|
||||||
|
}
|
||||||
|
$list[$index] = $path;
|
||||||
|
$images[$slot] = $list;
|
||||||
|
return $images;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function defaultInsights(): array
|
||||||
|
{
|
||||||
|
return array_map(fn($i) => "default:$i", range(0, self::INSIGHTS_DEFAULT_COUNT - 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function cleanInsight($value): ?string
|
||||||
|
{
|
||||||
|
if (is_string($value) && preg_match('/^default:(\d+)$/', $value, $m) && (int) $m[1] < self::INSIGHTS_DEFAULT_COUNT) {
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
return self::cleanPath($value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Nur Bilder aus dem eigenen Upload-Ordner - keine fremden URLs, kein Path-Traversal. */
|
||||||
|
private static function cleanPath($path): ?string
|
||||||
|
{
|
||||||
|
if (!is_string($path)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
$path = trim($path);
|
||||||
|
if (!preg_match('#^(/[A-Za-z0-9_\-/]*)?/api/uploads/[A-Za-z0-9_\-]+\.(jpg|jpeg|png|webp)$#', $path)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return $path;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
import{j as e}from"./index-t1kn-QYw.js";import{L as i}from"./LegalPageView-BXNg63z_.js";function n(){return e.jsx(i,{slug:"agb",fallbackTitle:"AGB",description:"Allgemeine Geschäftsbedingungen von HifiPlanet Amorbach."})}export{n as default};
|
|
||||||
1
hifi/assets/AGB-p4GGX-d-.js
Normal file
1
hifi/assets/AGB-p4GGX-d-.js
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
import{j as e}from"./index-D9iDlr3Q.js";import{L as i}from"./LegalPageView-BeA-agEE.js";function n(){return e.jsx(i,{slug:"agb",fallbackTitle:"AGB",description:"Allgemeine Geschäftsbedingungen von HifiPlanet Amorbach."})}export{n as default};
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
hifi/assets/Brands-D2JWVWu0.js
Normal file
1
hifi/assets/Brands-D2JWVWu0.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
||||||
import{r as g,j as e,c as p,L as k}from"./index-t1kn-QYw.js";const h=[{title:"Google",tests:[{key:"google_analytics",label:"Google Analytics (Zahlen im Admin)",settings:"/admin/settings/google"},{key:"google_tracking",label:"Google Analytics (Zählen auf der Website)",settings:"/admin/settings/google"},{key:"google_reviews",label:"Google-Bewertungen",settings:"/admin/settings/google"}]},{title:"Weitere Verbindungen",tests:[{key:"mail",label:"Mail-Server",settings:"/admin/settings/email"},{key:"database",label:"Datenbank",settings:"/admin/settings/database"},{key:"update_server",label:"Update-Server",settings:"/admin/settings/update"},{key:"audio4cars",label:"Audio4Cars-Preise",settings:"/admin/packages"}]}],b=h.flatMap(n=>n.tests.map(a=>a.key)),x={ok:{label:"Funktioniert",dot:"bg-green-500",text:"text-green-700 dark:text-green-400"},warning:{label:"Eingeschränkt",dot:"bg-amber-500",text:"text-amber-700 dark:text-amber-400"},error:{label:"Fehler",dot:"bg-red-500",text:"text-red-700 dark:text-red-400"},not_configured:{label:"Nicht eingerichtet",dot:"bg-neutral-400",text:"text-neutral-500 dark:text-neutral-400"}};function N(){const[n,a]=g.useState({}),[r,d]=g.useState({}),l=async t=>{d(s=>({...s,[t]:!0}));try{const s=await p.post("/settings/connection-test",{key:t});a(c=>({...c,[t]:s}))}catch(s){a(c=>({...c,[t]:{status:"error",message:s.message,details:[]}}))}finally{d(s=>({...s,[t]:!1}))}},o=()=>Promise.all(b.map(l)),i=Object.values(r).some(Boolean),m=b.filter(t=>n[t]),u=m.reduce((t,s)=>({...t,[n[s].status]:(t[n[s].status]||0)+1}),{});return e.jsxs("div",{className:"max-w-3xl space-y-6",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("button",{type:"button",onClick:o,disabled:i,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:i?"Teste…":"Alle testen"}),m.length>0&&!i&&e.jsx("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:["ok","warning","error","not_configured"].filter(t=>u[t]).map(t=>`${u[t]} × ${x[t].label.toLowerCase()}`).join(" · ")})]}),h.map(t=>e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"border-b border-neutral-200 px-6 py-3 font-semibold text-neutral-900 dark:border-neutral-800 dark:text-white",children:t.title}),e.jsx("ul",{className:"divide-y divide-neutral-200 dark:divide-neutral-800",children:t.tests.map(s=>e.jsx(j,{test:s,result:n[s.key],running:!!r[s.key],onRun:()=>l(s.key)},s.key))})]},t.title)),e.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Die Tests ändern nichts und verschicken keine Mails. Der Test der Google-Bewertungen zählt bei Google als ein Abruf."})]})}function j({test:n,result:a,running:r,onRun:d}){var o;const l=a?x[a.status]||x.error:null;return e.jsx("li",{className:"px-6 py-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("span",{className:`mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full ${r?"animate-pulse bg-brand-500":l?l.dot:"bg-neutral-200 dark:bg-neutral-700"}`}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2",children:[e.jsx("span",{className:"font-medium text-neutral-900 dark:text-white",children:n.label}),r?e.jsx("span",{className:"text-xs text-neutral-500",children:"wird getestet…"}):l&&e.jsxs("span",{className:`text-xs font-semibold ${l.text}`,children:[l.label,a.duration_ms!=null&&e.jsxs("span",{className:"font-normal text-neutral-400",children:[" · ",(a.duration_ms/1e3).toFixed(1)," s"]})]})]}),a&&!r&&e.jsxs("div",{className:"mt-1 space-y-1 text-sm",children:[e.jsx("p",{className:"whitespace-pre-line break-words text-neutral-700 dark:text-neutral-300",children:a.message}),a.hint&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:a.hint}),((o=a.details)==null?void 0:o.length)>0&&e.jsx("dl",{className:"mt-2 grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 text-xs",children:a.details.map(i=>e.jsxs("div",{className:"contents",children:[e.jsx("dt",{className:"text-neutral-500 dark:text-neutral-400",children:i.label}),e.jsx("dd",{className:"break-all text-neutral-700 dark:text-neutral-300",children:i.value})]},i.label))})]})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[a&&a.status!=="ok"&&e.jsx(k,{to:n.settings,className:"text-sm text-neutral-500 underline hover:text-neutral-800 dark:hover:text-neutral-200",children:"Einstellungen"}),e.jsx("button",{type:"button",onClick:d,disabled:r,className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm font-medium hover:bg-neutral-50 disabled:opacity-50 dark:border-neutral-700 dark:hover:bg-neutral-800",children:"Testen"})]})]})})}export{N as default};
|
import{r as g,j as e,c as p,L as k}from"./index-D9iDlr3Q.js";const h=[{title:"Google",tests:[{key:"google_analytics",label:"Google Analytics (Zahlen im Admin)",settings:"/admin/settings/google"},{key:"google_tracking",label:"Google Analytics (Zählen auf der Website)",settings:"/admin/settings/google"},{key:"google_reviews",label:"Google-Bewertungen",settings:"/admin/settings/google"}]},{title:"Weitere Verbindungen",tests:[{key:"mail",label:"Mail-Server",settings:"/admin/settings/email"},{key:"database",label:"Datenbank",settings:"/admin/settings/database"},{key:"update_server",label:"Update-Server",settings:"/admin/settings/update"},{key:"audio4cars",label:"Audio4Cars-Preise",settings:"/admin/packages"}]}],b=h.flatMap(n=>n.tests.map(a=>a.key)),x={ok:{label:"Funktioniert",dot:"bg-green-500",text:"text-green-700 dark:text-green-400"},warning:{label:"Eingeschränkt",dot:"bg-amber-500",text:"text-amber-700 dark:text-amber-400"},error:{label:"Fehler",dot:"bg-red-500",text:"text-red-700 dark:text-red-400"},not_configured:{label:"Nicht eingerichtet",dot:"bg-neutral-400",text:"text-neutral-500 dark:text-neutral-400"}};function N(){const[n,a]=g.useState({}),[r,d]=g.useState({}),l=async t=>{d(s=>({...s,[t]:!0}));try{const s=await p.post("/settings/connection-test",{key:t});a(c=>({...c,[t]:s}))}catch(s){a(c=>({...c,[t]:{status:"error",message:s.message,details:[]}}))}finally{d(s=>({...s,[t]:!1}))}},o=()=>Promise.all(b.map(l)),i=Object.values(r).some(Boolean),m=b.filter(t=>n[t]),u=m.reduce((t,s)=>({...t,[n[s].status]:(t[n[s].status]||0)+1}),{});return e.jsxs("div",{className:"max-w-3xl space-y-6",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("button",{type:"button",onClick:o,disabled:i,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:i?"Teste…":"Alle testen"}),m.length>0&&!i&&e.jsx("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:["ok","warning","error","not_configured"].filter(t=>u[t]).map(t=>`${u[t]} × ${x[t].label.toLowerCase()}`).join(" · ")})]}),h.map(t=>e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"border-b border-neutral-200 px-6 py-3 font-semibold text-neutral-900 dark:border-neutral-800 dark:text-white",children:t.title}),e.jsx("ul",{className:"divide-y divide-neutral-200 dark:divide-neutral-800",children:t.tests.map(s=>e.jsx(j,{test:s,result:n[s.key],running:!!r[s.key],onRun:()=>l(s.key)},s.key))})]},t.title)),e.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Die Tests ändern nichts und verschicken keine Mails. Der Test der Google-Bewertungen zählt bei Google als ein Abruf."})]})}function j({test:n,result:a,running:r,onRun:d}){var o;const l=a?x[a.status]||x.error:null;return e.jsx("li",{className:"px-6 py-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("span",{className:`mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full ${r?"animate-pulse bg-brand-500":l?l.dot:"bg-neutral-200 dark:bg-neutral-700"}`}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2",children:[e.jsx("span",{className:"font-medium text-neutral-900 dark:text-white",children:n.label}),r?e.jsx("span",{className:"text-xs text-neutral-500",children:"wird getestet…"}):l&&e.jsxs("span",{className:`text-xs font-semibold ${l.text}`,children:[l.label,a.duration_ms!=null&&e.jsxs("span",{className:"font-normal text-neutral-400",children:[" · ",(a.duration_ms/1e3).toFixed(1)," s"]})]})]}),a&&!r&&e.jsxs("div",{className:"mt-1 space-y-1 text-sm",children:[e.jsx("p",{className:"whitespace-pre-line break-words text-neutral-700 dark:text-neutral-300",children:a.message}),a.hint&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:a.hint}),((o=a.details)==null?void 0:o.length)>0&&e.jsx("dl",{className:"mt-2 grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 text-xs",children:a.details.map(i=>e.jsxs("div",{className:"contents",children:[e.jsx("dt",{className:"text-neutral-500 dark:text-neutral-400",children:i.label}),e.jsx("dd",{className:"break-all text-neutral-700 dark:text-neutral-300",children:i.value})]},i.label))})]})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[a&&a.status!=="ok"&&e.jsx(k,{to:n.settings,className:"text-sm text-neutral-500 underline hover:text-neutral-800 dark:hover:text-neutral-200",children:"Einstellungen"}),e.jsx("button",{type:"button",onClick:d,disabled:r,className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm font-medium hover:bg-neutral-50 disabled:opacity-50 dark:border-neutral-700 dark:hover:bg-neutral-800",children:"Testen"})]})]})})}export{N as default};
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
||||||
import{j as t}from"./index-t1kn-QYw.js";import{L as e}from"./LegalPageView-BXNg63z_.js";function n(){return t.jsx(e,{slug:"datenschutz",fallbackTitle:"Datenschutzerklärung",description:"Datenschutzerklärung von HifiPlanet Amorbach gemäß Art. 13 DSGVO."})}export{n as default};
|
import{j as t}from"./index-D9iDlr3Q.js";import{L as e}from"./LegalPageView-BeA-agEE.js";function n(){return t.jsx(e,{slug:"datenschutz",fallbackTitle:"Datenschutzerklärung",description:"Datenschutzerklärung von HifiPlanet Amorbach gemäß Art. 13 DSGVO."})}export{n as default};
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
||||||
import{r,u as y,b as v,j as e,e as S,R as D,c as I}from"./index-t1kn-QYw.js";import{f as _,a as E,b as F,i as L}from"./downloads-B9pqFegV.js";import{L as C,F as p,a as R,b as T,c as U,M,D as A}from"./music-BTxi8SUh.js";const K={audio:M,video:U,pdf:p,image:T,archive:R,document:p},n="hifi-downloads-password",z=()=>{try{return localStorage.getItem(n)||""}catch{return""}},f=t=>{try{t?localStorage.setItem(n,t):localStorage.removeItem(n)}catch{}},g=t=>I.get("/downloads",t?{headers:{"X-Download-Password":encodeURIComponent(t)}}:void 0);function W(){const[t,i]=r.useState(null),[c,x]=r.useState(!1),[o,b]=r.useState(""),[j,m]=r.useState(!1),[u,h]=r.useState(!1),[d,w]=r.useState(null),{t:s,language:k}=y();r.useEffect(()=>{const a=z();g(a).then(l=>{l.locked?(a&&f(""),x(!0)):i(l.items)}).catch(l=>w(l))},[]);const N=async a=>{a.preventDefault(),h(!0),m(!1);try{const l=await g(o);l.locked?m(!0):(f(o),x(!1),i(l.items))}catch(l){w(l.message)}finally{h(!1)}};return v({title:s("downloadsPage.metaTitle"),description:s("downloadsPage.metaDescription"),path:"/downloads"}),e.jsxs("div",{className:"mx-auto max-w-4xl px-4 py-12 sm:px-6",children:[e.jsx("h1",{className:"mb-2 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:s("downloadsPage.title")}),e.jsx("p",{className:"mb-10 max-w-2xl text-neutral-600 dark:text-neutral-300",children:s("downloadsPage.intro")}),d&&e.jsx("p",{className:"text-red-600",children:typeof d=="string"?d:S(d,s)}),!d&&!c&&t===null&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("downloadsPage.loading")}),(t==null?void 0:t.length)===0&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("downloadsPage.empty")}),c&&e.jsxs("form",{onSubmit:N,className:"max-w-md rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[e.jsx(C,{className:"h-5 w-5 text-brand-500","aria-hidden":"true"}),e.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:s("downloadsPage.lockedTitle")})]}),e.jsx("p",{className:"mb-4 text-sm text-neutral-600 dark:text-neutral-300",children:s("downloadsPage.lockedText")}),e.jsx("label",{htmlFor:"downloads-password",className:"sr-only",children:s("downloadsPage.passwordLabel")}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[e.jsx("input",{id:"downloads-password",type:"password",required:!0,autoComplete:"off",value:o,onChange:a=>b(a.target.value),placeholder:s("downloadsPage.passwordLabel"),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm text-neutral-900 dark:border-neutral-700 dark:bg-neutral-950 dark:text-white"}),e.jsx("button",{type:"submit",disabled:u,className:"shrink-0 rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:s(u?"downloadsPage.unlocking":"downloadsPage.unlock")})]}),j&&e.jsx("p",{className:"mt-2 text-sm text-red-600",role:"alert",children:s("downloadsPage.wrongPassword")})]}),e.jsx("div",{className:"space-y-4",children:t==null?void 0:t.map((a,l)=>{const P=K[_(a.file_name)];return e.jsx(D,{index:l%4,className:"rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start",children:[e.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-brand-500/10 text-brand-600 dark:text-brand-400",children:e.jsx(P,{className:"h-6 w-6","aria-hidden":"true"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:a.title}),a.description&&e.jsx("p",{className:"mt-1 whitespace-pre-line text-sm text-neutral-600 dark:text-neutral-300",children:a.description}),e.jsxs("p",{className:"mt-1 text-xs text-neutral-400",children:[E(a.file_name).toUpperCase()," · ",F(a.file_size,k==="de"?"de-DE":"en-US")]}),L(a.file_name)&&e.jsx("audio",{controls:!0,preload:"none",src:a.file_path,className:"mt-3 w-full"})]}),e.jsxs("a",{href:a.file_path,download:a.file_name,className:"inline-flex shrink-0 items-center justify-center gap-2 rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:[e.jsx(A,{className:"h-4 w-4","aria-hidden":"true"}),s("downloadsPage.download")]})]})},a.id)})})]})}export{W as default};
|
import{r,u as y,b as v,j as e,e as S,R as D,c as I}from"./index-D9iDlr3Q.js";import{f as _,a as E,b as F,i as L}from"./downloads-B9pqFegV.js";import{L as C,F as p,a as R,b as T,c as U,M,D as A}from"./music-CMTvNtNQ.js";const K={audio:M,video:U,pdf:p,image:T,archive:R,document:p},n="hifi-downloads-password",z=()=>{try{return localStorage.getItem(n)||""}catch{return""}},f=t=>{try{t?localStorage.setItem(n,t):localStorage.removeItem(n)}catch{}},g=t=>I.get("/downloads",t?{headers:{"X-Download-Password":encodeURIComponent(t)}}:void 0);function W(){const[t,i]=r.useState(null),[c,x]=r.useState(!1),[o,b]=r.useState(""),[j,m]=r.useState(!1),[u,h]=r.useState(!1),[d,w]=r.useState(null),{t:s,language:k}=y();r.useEffect(()=>{const a=z();g(a).then(l=>{l.locked?(a&&f(""),x(!0)):i(l.items)}).catch(l=>w(l))},[]);const N=async a=>{a.preventDefault(),h(!0),m(!1);try{const l=await g(o);l.locked?m(!0):(f(o),x(!1),i(l.items))}catch(l){w(l.message)}finally{h(!1)}};return v({title:s("downloadsPage.metaTitle"),description:s("downloadsPage.metaDescription"),path:"/downloads"}),e.jsxs("div",{className:"mx-auto max-w-4xl px-4 py-12 sm:px-6",children:[e.jsx("h1",{className:"mb-2 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:s("downloadsPage.title")}),e.jsx("p",{className:"mb-10 max-w-2xl text-neutral-600 dark:text-neutral-300",children:s("downloadsPage.intro")}),d&&e.jsx("p",{className:"text-red-600",children:typeof d=="string"?d:S(d,s)}),!d&&!c&&t===null&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("downloadsPage.loading")}),(t==null?void 0:t.length)===0&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("downloadsPage.empty")}),c&&e.jsxs("form",{onSubmit:N,className:"max-w-md rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[e.jsx(C,{className:"h-5 w-5 text-brand-500","aria-hidden":"true"}),e.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:s("downloadsPage.lockedTitle")})]}),e.jsx("p",{className:"mb-4 text-sm text-neutral-600 dark:text-neutral-300",children:s("downloadsPage.lockedText")}),e.jsx("label",{htmlFor:"downloads-password",className:"sr-only",children:s("downloadsPage.passwordLabel")}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[e.jsx("input",{id:"downloads-password",type:"password",required:!0,autoComplete:"off",value:o,onChange:a=>b(a.target.value),placeholder:s("downloadsPage.passwordLabel"),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm text-neutral-900 dark:border-neutral-700 dark:bg-neutral-950 dark:text-white"}),e.jsx("button",{type:"submit",disabled:u,className:"shrink-0 rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:s(u?"downloadsPage.unlocking":"downloadsPage.unlock")})]}),j&&e.jsx("p",{className:"mt-2 text-sm text-red-600",role:"alert",children:s("downloadsPage.wrongPassword")})]}),e.jsx("div",{className:"space-y-4",children:t==null?void 0:t.map((a,l)=>{const P=K[_(a.file_name)];return e.jsx(D,{index:l%4,className:"rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start",children:[e.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-brand-500/10 text-brand-600 dark:text-brand-400",children:e.jsx(P,{className:"h-6 w-6","aria-hidden":"true"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:a.title}),a.description&&e.jsx("p",{className:"mt-1 whitespace-pre-line text-sm text-neutral-600 dark:text-neutral-300",children:a.description}),e.jsxs("p",{className:"mt-1 text-xs text-neutral-400",children:[E(a.file_name).toUpperCase()," · ",F(a.file_size,k==="de"?"de-DE":"en-US")]}),L(a.file_name)&&e.jsx("audio",{controls:!0,preload:"none",src:a.file_path,className:"mt-3 w-full"})]}),e.jsxs("a",{href:a.file_path,download:a.file_name,className:"inline-flex shrink-0 items-center justify-center gap-2 rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:[e.jsx(A,{className:"h-4 w-4","aria-hidden":"true"}),s("downloadsPage.download")]})]})},a.id)})})]})}export{W as default};
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
||||||
import{g as c,r as n,u as g,a as m,c as u,b as p,j as a,N as h,e as f,L as b,d as y,f as v}from"./index-t1kn-QYw.js";function N(){const{brandSlug:r}=c(),[t,i]=n.useState(null),[l,d]=n.useState(null),{t:s}=g(),{gallery_card_text_x:o,gallery_card_text_y:x}=m();return n.useEffect(()=>{u.get(`/gallery-brands/${r}/projects`).then(i).catch(e=>d(e))},[r]),p({title:t?s("galleryBrandPage.metaTitle")(t.brand.name):s("galleryBrandPage.metaTitleFallback"),description:t?s("galleryBrandPage.metaDescription")(t.brand.name):void 0,path:`/galerie/${r}`}),l?l.status===404?a.jsx(h,{}):a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:f(l,s)}):t?a.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[a.jsxs("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:[t.brand.name," – ",s("galleryBrandPage.titleSuffix")]}),t.projects.length===0&&a.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("galleryBrandPage.empty")}),a.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:t.projects.map(e=>a.jsxs(b,{to:`/galerie/${r}/${e.slug}`,className:"group relative block aspect-[4/3] overflow-hidden rounded-xl bg-neutral-900 shadow-sm transition hover:shadow-lg",children:[e.cover_image_path?a.jsx("img",{src:e.cover_image_path,alt:e.name,className:"h-full w-full object-cover transition duration-300 group-hover:scale-105"}):a.jsx("div",{className:"flex h-full w-full items-center justify-center bg-neutral-200 dark:bg-neutral-800"}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent transition group-hover:from-black/95"}),a.jsx(y,{entity:"gallery_projects",id:e.id,field:"name",lang:"de",value:e.name,className:"absolute whitespace-nowrap p-4 text-lg font-extrabold text-white",style:v(o,x,{x:0,y:100})})]},e.id))})]}):a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:s("galleryBrandPage.loading")})}export{N as default};
|
import{g as c,r as n,u as g,a as m,c as u,b as p,j as a,N as h,e as f,L as b,d as y,f as v}from"./index-D9iDlr3Q.js";function N(){const{brandSlug:r}=c(),[t,i]=n.useState(null),[l,d]=n.useState(null),{t:s}=g(),{gallery_card_text_x:o,gallery_card_text_y:x}=m();return n.useEffect(()=>{u.get(`/gallery-brands/${r}/projects`).then(i).catch(e=>d(e))},[r]),p({title:t?s("galleryBrandPage.metaTitle")(t.brand.name):s("galleryBrandPage.metaTitleFallback"),description:t?s("galleryBrandPage.metaDescription")(t.brand.name):void 0,path:`/galerie/${r}`}),l?l.status===404?a.jsx(h,{}):a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:f(l,s)}):t?a.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[a.jsxs("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:[t.brand.name," – ",s("galleryBrandPage.titleSuffix")]}),t.projects.length===0&&a.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("galleryBrandPage.empty")}),a.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:t.projects.map(e=>a.jsxs(b,{to:`/galerie/${r}/${e.slug}`,className:"group relative block aspect-[4/3] overflow-hidden rounded-xl bg-neutral-900 shadow-sm transition hover:shadow-lg",children:[e.cover_image_path?a.jsx("img",{src:e.cover_image_path,alt:e.name,className:"h-full w-full object-cover transition duration-300 group-hover:scale-105"}):a.jsx("div",{className:"flex h-full w-full items-center justify-center bg-neutral-200 dark:bg-neutral-800"}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent transition group-hover:from-black/95"}),a.jsx(y,{entity:"gallery_projects",id:e.id,field:"name",lang:"de",value:e.name,className:"absolute whitespace-nowrap p-4 text-lg font-extrabold text-white",style:v(o,x,{x:0,y:100})})]},e.id))})]}):a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:s("galleryBrandPage.loading")})}export{N as default};
|
||||||
1
hifi/assets/GalleryBrands-5XhoUGMQ.js
Normal file
1
hifi/assets/GalleryBrands-5XhoUGMQ.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
||||||
import{r,u as d,a as g,b as u,c as m,j as e,E as i,e as p,L as v,d as h,f as y}from"./index-t1kn-QYw.js";function w(){const[a,o]=r.useState(null),[l,n]=r.useState(null),{t:s}=d(),{gallery_card_text_x:c,gallery_card_text_y:x}=g();return u({title:s("galleryOverview.metaTitle"),description:s("galleryOverview.metaDescription"),path:"/galerie"}),r.useEffect(()=>{m.get("/gallery-brands").then(o).catch(t=>n(t))},[]),e.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[e.jsx(i,{k:"galleryOverview.title",as:"h1",className:"mb-2 block text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl"}),e.jsx(i,{k:"galleryOverview.intro",as:"p",className:"mb-8 block text-neutral-600 dark:text-neutral-300"}),l&&e.jsx("p",{className:"text-red-600",children:typeof l=="string"?l:p(l,s)}),!a&&!l&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("galleryOverview.loading")}),a&&a.length===0&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("galleryOverview.empty")}),e.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:a==null?void 0:a.map(t=>e.jsxs(v,{to:`/galerie/${t.slug}`,className:"group relative block aspect-[4/3] overflow-hidden rounded-xl bg-neutral-900 shadow-sm transition hover:shadow-lg",children:[t.cover_image_path?e.jsx("img",{src:t.cover_image_path,alt:t.name,className:"h-full w-full object-cover transition duration-300 group-hover:scale-105"}):e.jsx("div",{className:"flex h-full w-full items-center justify-center bg-neutral-200 dark:bg-neutral-800"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent transition group-hover:from-black/95"}),e.jsx(h,{entity:"gallery_brands",id:t.id,field:"name",lang:"de",value:t.name,className:"absolute whitespace-nowrap p-4 text-lg font-extrabold text-white",style:y(c,x,{x:0,y:100})})]},t.id))})]})}export{w as default};
|
import{r,u as d,a as g,b as u,c as m,j as e,E as i,e as p,L as v,d as h,f as y}from"./index-D9iDlr3Q.js";function w(){const[a,o]=r.useState(null),[l,n]=r.useState(null),{t:s}=d(),{gallery_card_text_x:c,gallery_card_text_y:x}=g();return u({title:s("galleryOverview.metaTitle"),description:s("galleryOverview.metaDescription"),path:"/galerie"}),r.useEffect(()=>{m.get("/gallery-brands").then(o).catch(t=>n(t))},[]),e.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[e.jsx(i,{k:"galleryOverview.title",as:"h1",className:"mb-2 block text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl"}),e.jsx(i,{k:"galleryOverview.intro",as:"p",className:"mb-8 block text-neutral-600 dark:text-neutral-300"}),l&&e.jsx("p",{className:"text-red-600",children:typeof l=="string"?l:p(l,s)}),!a&&!l&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("galleryOverview.loading")}),a&&a.length===0&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("galleryOverview.empty")}),e.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:a==null?void 0:a.map(t=>e.jsxs(v,{to:`/galerie/${t.slug}`,className:"group relative block aspect-[4/3] overflow-hidden rounded-xl bg-neutral-900 shadow-sm transition hover:shadow-lg",children:[t.cover_image_path?e.jsx("img",{src:t.cover_image_path,alt:t.name,className:"h-full w-full object-cover transition duration-300 group-hover:scale-105"}):e.jsx("div",{className:"flex h-full w-full items-center justify-center bg-neutral-200 dark:bg-neutral-800"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent transition group-hover:from-black/95"}),e.jsx(h,{entity:"gallery_brands",id:t.id,field:"name",lang:"de",value:t.name,className:"absolute whitespace-nowrap p-4 text-lg font-extrabold text-white",style:y(c,x,{x:0,y:100})})]},t.id))})]})}export{w as default};
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
import{g as z,r as l,q as B,c as d,j as t,L as C}from"./index-t1kn-QYw.js";import{S as M,s as D}from"./SortableList-B4XEFHmY.js";import{V as G}from"./ViewOnSite-LdKdiGtN.js";import{r as L,M as A,f as I}from"./resizeImage-C6PvAwh0.js";import"./sortable.esm-dNCeQGtw.js";import"./grip-vertical-BnqeYamB.js";function J(){const{projectId:m}=z(),[u,h]=l.useState([]),[c,v]=l.useState(null),[f,j]=l.useState(""),[b,w]=l.useState(!1),[$,y]=l.useState(""),p=l.useRef(null),s=B(),x=()=>d.get(`/gallery-projects/${m}/photos`).then(h);l.useEffect(()=>{x(),d.get("/gallery-projects").then(e=>v(e.find(r=>String(r.id)===String(m))||null)).catch(()=>{})},[m]);const F=async e=>{const r=Array.from(e.target.files||[]);if(r.length===0)return;j(""),w(!0);let a=u.reduce((o,i)=>Math.max(o,Number(i.sort_order)||0),0),n=0;const g=[];for(let o=0;o<r.length;o++){y(`Foto ${o+1} von ${r.length} wird hochgeladen…`);try{const i=await L(r[o]);if(i.size>A)throw new Error(`zu groß (${I(i.size)}, max. 5 MB)`);const k=new FormData;k.append("file",i);const E=await d.post("/uploads",k);a+=10,await d.post("/gallery-photos",{gallery_project_id:Number(m),image_path:E.path,sort_order:a}),n++}catch(i){g.push(`${r[o].name}: ${i.message}`)}}w(!1),y(""),p.current&&(p.current.value=""),x(),g.length===0?s.success(n===1?"1 Foto hochgeladen.":`${n} Fotos hochgeladen.`):(j(`Nicht hochgeladen:
|
import{g as z,r as l,q as B,c as d,j as t,L as C}from"./index-D9iDlr3Q.js";import{S as M,s as D}from"./SortableList-BNAd326o.js";import{V as G}from"./ViewOnSite-40My-_yC.js";import{r as L,M as A,f as I}from"./resizeImage-C6PvAwh0.js";import"./sortable.esm-0Y27tIYS.js";import"./grip-vertical-DF1UTnGm.js";function J(){const{projectId:m}=z(),[u,h]=l.useState([]),[c,v]=l.useState(null),[f,j]=l.useState(""),[b,w]=l.useState(!1),[$,y]=l.useState(""),p=l.useRef(null),s=B(),x=()=>d.get(`/gallery-projects/${m}/photos`).then(h);l.useEffect(()=>{x(),d.get("/gallery-projects").then(e=>v(e.find(r=>String(r.id)===String(m))||null)).catch(()=>{})},[m]);const F=async e=>{const r=Array.from(e.target.files||[]);if(r.length===0)return;j(""),w(!0);let a=u.reduce((o,i)=>Math.max(o,Number(i.sort_order)||0),0),n=0;const g=[];for(let o=0;o<r.length;o++){y(`Foto ${o+1} von ${r.length} wird hochgeladen…`);try{const i=await L(r[o]);if(i.size>A)throw new Error(`zu groß (${I(i.size)}, max. 5 MB)`);const k=new FormData;k.append("file",i);const E=await d.post("/uploads",k);a+=10,await d.post("/gallery-photos",{gallery_project_id:Number(m),image_path:E.path,sort_order:a}),n++}catch(i){g.push(`${r[o].name}: ${i.message}`)}}w(!1),y(""),p.current&&(p.current.value=""),x(),g.length===0?s.success(n===1?"1 Foto hochgeladen.":`${n} Fotos hochgeladen.`):(j(`Nicht hochgeladen:
|
||||||
${g.join(`
|
${g.join(`
|
||||||
`)}`),s.error(`${n} hochgeladen, ${g.length} fehlgeschlagen.`))},P=(e,r)=>{h(a=>a.map(n=>n.id===e.id?{...n,caption:r}:n))},N=l.useRef(null),S=async e=>{if((e.caption||"")!==N.current)try{await d.put(`/gallery-photos/${e.id}`,{caption:e.caption,sort_order:e.sort_order}),s.success("Bildunterschrift gespeichert.")}catch(r){s.error(`Speichern fehlgeschlagen: ${r.message}`)}},_=async e=>{if(confirm("Foto wirklich entfernen?"))try{await d.delete(`/gallery-photos/${e}`),s.success("Foto entfernt."),x()}catch(r){s.error(`Entfernen fehlgeschlagen: ${r.message}`)}},R=async e=>{const r=u;h(e);try{h(await D("gallery-photos",e)),s.success("Reihenfolge gespeichert.")}catch(a){h(r),s.error(`Reihenfolge konnte nicht gespeichert werden: ${a.message}`)}};return t.jsxs("div",{children:[t.jsx("p",{className:"mb-2 text-sm",children:t.jsx(C,{to:"/admin/gallery-projects",className:"text-brand-600 hover:underline",children:"← Zurück zu den Projekten"})}),t.jsxs("div",{className:"mb-4 flex items-center justify-between gap-3",children:[t.jsxs("h1",{className:"text-xl font-bold text-neutral-900 dark:text-white",children:["Fotos im Projekt",c?`: ${c.brand_name} ${c.name}`:""]}),c&&t.jsx(G,{to:`/galerie/${c.brand_slug}/${c.slug}`})]}),t.jsxs("div",{className:"mb-6 rounded-xl border border-neutral-200 bg-white p-4 dark:border-neutral-800 dark:bg-neutral-900",children:[t.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Fotos hinzufügen (Mehrfachauswahl möglich)"}),t.jsx("input",{ref:p,type:"file",multiple:!0,accept:"image/png,image/jpeg,image/webp",onChange:F,disabled:b,className:"text-sm"}),t.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"JPG, PNG oder WebP, große Fotos werden automatisch verkleinert."}),b&&t.jsx("p",{className:"mt-2 text-sm text-neutral-500","aria-live":"polite",children:$})]}),f&&t.jsx("p",{className:"mb-4 whitespace-pre-line text-sm text-red-600",children:f}),u.length>1&&t.jsx("p",{className:"mb-3 text-xs text-neutral-500 dark:text-neutral-400",children:"Reihenfolge am Griff per Ziehen ändern."}),t.jsx(M,{items:u,onReorder:R,as:"grid",className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:(e,r)=>t.jsxs("div",{className:"overflow-hidden rounded-xl border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900",children:[t.jsx("img",{src:e.image_path,alt:e.caption||"",className:"aspect-square w-full object-cover",loading:"lazy"}),t.jsxs("div",{className:"space-y-2 p-3",children:[t.jsx("input",{value:e.caption||"",onChange:a=>P(e,a.target.value),onFocus:()=>{N.current=e.caption||""},onBlur:()=>S(e),placeholder:"Bildunterschrift (optional)",className:"w-full rounded-md border border-neutral-300 bg-white px-2 py-1 text-xs dark:border-neutral-700 dark:bg-neutral-900"}),t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r,t.jsx("button",{onClick:()=>_(e.id),className:"text-xs text-red-600 hover:underline",children:"Entfernen"})]})]})]})}),u.length===0&&t.jsx("p",{className:"py-6 text-center text-neutral-400",children:"Noch keine Fotos in diesem Projekt."})]})}export{J as default};
|
`)}`),s.error(`${n} hochgeladen, ${g.length} fehlgeschlagen.`))},P=(e,r)=>{h(a=>a.map(n=>n.id===e.id?{...n,caption:r}:n))},N=l.useRef(null),S=async e=>{if((e.caption||"")!==N.current)try{await d.put(`/gallery-photos/${e.id}`,{caption:e.caption,sort_order:e.sort_order}),s.success("Bildunterschrift gespeichert.")}catch(r){s.error(`Speichern fehlgeschlagen: ${r.message}`)}},_=async e=>{if(confirm("Foto wirklich entfernen?"))try{await d.delete(`/gallery-photos/${e}`),s.success("Foto entfernt."),x()}catch(r){s.error(`Entfernen fehlgeschlagen: ${r.message}`)}},R=async e=>{const r=u;h(e);try{h(await D("gallery-photos",e)),s.success("Reihenfolge gespeichert.")}catch(a){h(r),s.error(`Reihenfolge konnte nicht gespeichert werden: ${a.message}`)}};return t.jsxs("div",{children:[t.jsx("p",{className:"mb-2 text-sm",children:t.jsx(C,{to:"/admin/gallery-projects",className:"text-brand-600 hover:underline",children:"← Zurück zu den Projekten"})}),t.jsxs("div",{className:"mb-4 flex items-center justify-between gap-3",children:[t.jsxs("h1",{className:"text-xl font-bold text-neutral-900 dark:text-white",children:["Fotos im Projekt",c?`: ${c.brand_name} ${c.name}`:""]}),c&&t.jsx(G,{to:`/galerie/${c.brand_slug}/${c.slug}`})]}),t.jsxs("div",{className:"mb-6 rounded-xl border border-neutral-200 bg-white p-4 dark:border-neutral-800 dark:bg-neutral-900",children:[t.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Fotos hinzufügen (Mehrfachauswahl möglich)"}),t.jsx("input",{ref:p,type:"file",multiple:!0,accept:"image/png,image/jpeg,image/webp",onChange:F,disabled:b,className:"text-sm"}),t.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"JPG, PNG oder WebP, große Fotos werden automatisch verkleinert."}),b&&t.jsx("p",{className:"mt-2 text-sm text-neutral-500","aria-live":"polite",children:$})]}),f&&t.jsx("p",{className:"mb-4 whitespace-pre-line text-sm text-red-600",children:f}),u.length>1&&t.jsx("p",{className:"mb-3 text-xs text-neutral-500 dark:text-neutral-400",children:"Reihenfolge am Griff per Ziehen ändern."}),t.jsx(M,{items:u,onReorder:R,as:"grid",className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:(e,r)=>t.jsxs("div",{className:"overflow-hidden rounded-xl border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900",children:[t.jsx("img",{src:e.image_path,alt:e.caption||"",className:"aspect-square w-full object-cover",loading:"lazy"}),t.jsxs("div",{className:"space-y-2 p-3",children:[t.jsx("input",{value:e.caption||"",onChange:a=>P(e,a.target.value),onFocus:()=>{N.current=e.caption||""},onBlur:()=>S(e),placeholder:"Bildunterschrift (optional)",className:"w-full rounded-md border border-neutral-300 bg-white px-2 py-1 text-xs dark:border-neutral-700 dark:bg-neutral-900"}),t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r,t.jsx("button",{onClick:()=>_(e.id),className:"text-xs text-red-600 hover:underline",children:"Entfernen"})]})]})]})}),u.length===0&&t.jsx("p",{className:"py-6 text-center text-neutral-400",children:"Noch keine Fotos in diesem Projekt."})]})}export{J as default};
|
||||||
|
|
@ -1 +1 @@
|
||||||
import{u as g,r as x,h as j,j as e,g as b,c as w,b as f,N as k,e as y,d as v,R as P,E as h,L as N}from"./index-t1kn-QYw.js";function L({photos:o,index:s,onClose:t,onNavigate:n}){const{t:i}=g();if(x.useEffect(()=>{if(s==null)return;const a=r=>{r.key==="Escape"&&t(),r.key==="ArrowRight"&&n(1),r.key==="ArrowLeft"&&n(-1)};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[s,t,n]),s==null)return null;const d=o[s],c=a=>a.stopPropagation();return j.createPortal(e.jsxs("div",{className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/90 p-4",onClick:t,children:[e.jsx("button",{onClick:a=>{c(a),t()},"aria-label":i("lightbox.close"),className:"absolute right-4 top-4 rounded-full p-2 text-white/80 hover:bg-white/10 hover:text-white",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-7 w-7",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 6l12 12M18 6 6 18"})})}),o.length>1&&e.jsx("button",{onClick:a=>{c(a),n(-1)},"aria-label":i("lightbox.previous"),className:"absolute left-2 top-1/2 -translate-y-1/2 rounded-full p-2 text-white/80 hover:bg-white/10 hover:text-white sm:left-4",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-8 w-8",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m15 18-6-6 6-6"})})}),e.jsx("img",{src:d.image_path,alt:d.caption||"",onClick:c,className:"max-h-[85vh] max-w-full rounded-lg object-contain"}),o.length>1&&e.jsx("button",{onClick:a=>{c(a),n(1)},"aria-label":i("lightbox.next"),className:"absolute right-2 top-1/2 -translate-y-1/2 rounded-full p-2 text-white/80 hover:bg-white/10 hover:text-white sm:right-4",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-8 w-8",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9 18 6-6-6-6"})})}),d.caption&&e.jsx("p",{onClick:c,className:"absolute bottom-4 left-1/2 -translate-x-1/2 rounded-full bg-black/60 px-4 py-1.5 text-sm text-white",children:d.caption})]}),document.body)}function C(){const{brandSlug:o,projectSlug:s}=b(),[t,n]=x.useState(null),[i,d]=x.useState(null),[c,a]=x.useState(null),{t:r}=g();x.useEffect(()=>{w.get(`/gallery-brands/${o}/${s}/photos`).then(n).catch(l=>d(l))},[o,s]),f({title:t?`${t.project.name} – ${t.project.brand_name}`:r("galleryProjectPage.metaTitleFallback"),description:t?r("galleryProjectPage.metaDescription")(t.project.name):void 0,path:`/galerie/${o}/${s}`});const p=l=>{a(u=>{const m=t.photos.length;return(u+l+m)%m})};return i?i.status===404?e.jsx(k,{}):e.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:y(i,r)}):t?e.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[e.jsx(v,{entity:"gallery_projects",id:t.project.id,field:"name",lang:"de",value:t.project.name,as:"h1",className:"mb-8 block text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl"}),t.photos.length===0&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:r("galleryProjectPage.empty")}),e.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:t.photos.map((l,u)=>e.jsx(P,{index:u%6,shine:!0,className:"aspect-square overflow-hidden rounded-xl",children:e.jsx("button",{onClick:()=>a(u),className:"block h-full w-full","aria-label":l.caption||r("galleryProjectPage.enlargeImage"),children:e.jsx("img",{src:l.image_path,alt:l.caption||"",loading:"lazy",decoding:"async",className:"h-full w-full object-cover transition duration-300 hover:scale-105"})})},l.id))}),e.jsxs("div",{className:"mt-12 flex flex-col items-start gap-4 rounded-2xl border border-neutral-200 bg-white p-6 shadow-sm dark:border-neutral-800 dark:bg-neutral-900 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsx(h,{k:"galleryProjectPage.ctaTitle",as:"h2",className:"block text-lg font-bold text-neutral-900 dark:text-white"}),e.jsx(h,{k:"galleryProjectPage.ctaText",as:"p",className:"mt-1 block text-sm text-neutral-600 dark:text-neutral-300"})]}),e.jsx(N,{to:`/kontakt?${new URLSearchParams({topic:r("galleryProjectPage.ctaTopic")(t.project.name)}).toString()}`,className:"shrink-0 rounded-md bg-brand-500 px-5 py-3 text-sm font-semibold text-white shadow-sm hover:bg-brand-600",children:e.jsx(h,{k:"galleryProjectPage.ctaButton"})})]}),e.jsx(L,{photos:t.photos,index:c,onClose:()=>a(null),onNavigate:p})]}):e.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:r("galleryProjectPage.loading")})}export{C as default};
|
import{u as g,r as x,h as j,j as e,g as b,c as w,b as f,N as k,e as y,d as v,R as P,E as h,L as N}from"./index-D9iDlr3Q.js";function L({photos:o,index:s,onClose:t,onNavigate:n}){const{t:i}=g();if(x.useEffect(()=>{if(s==null)return;const a=r=>{r.key==="Escape"&&t(),r.key==="ArrowRight"&&n(1),r.key==="ArrowLeft"&&n(-1)};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[s,t,n]),s==null)return null;const d=o[s],c=a=>a.stopPropagation();return j.createPortal(e.jsxs("div",{className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/90 p-4",onClick:t,children:[e.jsx("button",{onClick:a=>{c(a),t()},"aria-label":i("lightbox.close"),className:"absolute right-4 top-4 rounded-full p-2 text-white/80 hover:bg-white/10 hover:text-white",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-7 w-7",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 6l12 12M18 6 6 18"})})}),o.length>1&&e.jsx("button",{onClick:a=>{c(a),n(-1)},"aria-label":i("lightbox.previous"),className:"absolute left-2 top-1/2 -translate-y-1/2 rounded-full p-2 text-white/80 hover:bg-white/10 hover:text-white sm:left-4",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-8 w-8",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m15 18-6-6 6-6"})})}),e.jsx("img",{src:d.image_path,alt:d.caption||"",onClick:c,className:"max-h-[85vh] max-w-full rounded-lg object-contain"}),o.length>1&&e.jsx("button",{onClick:a=>{c(a),n(1)},"aria-label":i("lightbox.next"),className:"absolute right-2 top-1/2 -translate-y-1/2 rounded-full p-2 text-white/80 hover:bg-white/10 hover:text-white sm:right-4",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-8 w-8",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9 18 6-6-6-6"})})}),d.caption&&e.jsx("p",{onClick:c,className:"absolute bottom-4 left-1/2 -translate-x-1/2 rounded-full bg-black/60 px-4 py-1.5 text-sm text-white",children:d.caption})]}),document.body)}function C(){const{brandSlug:o,projectSlug:s}=b(),[t,n]=x.useState(null),[i,d]=x.useState(null),[c,a]=x.useState(null),{t:r}=g();x.useEffect(()=>{w.get(`/gallery-brands/${o}/${s}/photos`).then(n).catch(l=>d(l))},[o,s]),f({title:t?`${t.project.name} – ${t.project.brand_name}`:r("galleryProjectPage.metaTitleFallback"),description:t?r("galleryProjectPage.metaDescription")(t.project.name):void 0,path:`/galerie/${o}/${s}`});const p=l=>{a(u=>{const m=t.photos.length;return(u+l+m)%m})};return i?i.status===404?e.jsx(k,{}):e.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:y(i,r)}):t?e.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[e.jsx(v,{entity:"gallery_projects",id:t.project.id,field:"name",lang:"de",value:t.project.name,as:"h1",className:"mb-8 block text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl"}),t.photos.length===0&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:r("galleryProjectPage.empty")}),e.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:t.photos.map((l,u)=>e.jsx(P,{index:u%6,shine:!0,className:"aspect-square overflow-hidden rounded-xl",children:e.jsx("button",{onClick:()=>a(u),className:"block h-full w-full","aria-label":l.caption||r("galleryProjectPage.enlargeImage"),children:e.jsx("img",{src:l.image_path,alt:l.caption||"",loading:"lazy",decoding:"async",className:"h-full w-full object-cover transition duration-300 hover:scale-105"})})},l.id))}),e.jsxs("div",{className:"mt-12 flex flex-col items-start gap-4 rounded-2xl border border-neutral-200 bg-white p-6 shadow-sm dark:border-neutral-800 dark:bg-neutral-900 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsx(h,{k:"galleryProjectPage.ctaTitle",as:"h2",className:"block text-lg font-bold text-neutral-900 dark:text-white"}),e.jsx(h,{k:"galleryProjectPage.ctaText",as:"p",className:"mt-1 block text-sm text-neutral-600 dark:text-neutral-300"})]}),e.jsx(N,{to:`/kontakt?${new URLSearchParams({topic:r("galleryProjectPage.ctaTopic")(t.project.name)}).toString()}`,className:"shrink-0 rounded-md bg-brand-500 px-5 py-3 text-sm font-semibold text-white shadow-sm hover:bg-brand-600",children:e.jsx(h,{k:"galleryProjectPage.ctaButton"})})]}),e.jsx(L,{photos:t.photos,index:c,onClose:()=>a(null),onNavigate:p})]}):e.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:r("galleryProjectPage.loading")})}export{C as default};
|
||||||
1
hifi/assets/GalleryProjects-C77PGHIf.js
Normal file
1
hifi/assets/GalleryProjects-C77PGHIf.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
||||||
import{r,c as u,j as e}from"./index-t1kn-QYw.js";function h({compact:m=!1}){const[n,i]=r.useState(!1),[s,l]=r.useState(null),[d,o]=r.useState(""),[t,c]=r.useState(null);r.useEffect(()=>{u.get("/settings/compress-status").then(a=>c(a.gd_available)).catch(()=>c(!1))},[]);const b=async()=>{i(!0),o(""),l(null);try{l(await u.post("/settings/compress-uploads",{}))}catch(a){o(a.message)}finally{i(!1)}};return e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsxs("div",{className:"mb-1 flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:"Bilder optimieren"}),t!==null&&e.jsx("span",{className:`rounded-full px-3 py-1 text-xs font-semibold ${t?"bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-300":"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300"}`,children:t?"Aktiv":"Nicht verfügbar"})]}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:m?"Verkleinert alle bereits hochgeladenen Fotos, damit die Seite schneller lädt. Neue Bilder werden automatisch verkleinert.":"Neu hochgeladene Bilder werden automatisch verkleinert und komprimiert. Dieser Button holt das für alle bereits vorhandenen Bilder nach – nützlich, wenn die Seite durch zu hoch aufgelöste Fotos spürbar langsam lädt."}),t===!1&&e.jsx("p",{className:"mb-4 rounded-md bg-amber-50 p-3 text-sm text-amber-800 dark:bg-amber-900/20 dark:text-amber-300",children:'Diese Funktion braucht die PHP-Erweiterung "gd", die auf diesem Server aktuell nicht aktiv ist. Bei den meisten Hostern (auch All-Inkl) ist sie Teil jeder PHP-Version – bitte beim Hoster-Support nachfragen bzw. prüfen, ob in den Hosting-Einstellungen eine andere PHP-Version ausgewählt werden muss.'}),e.jsx("button",{type:"button",onClick:b,disabled:n||t===!1,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:n?"Optimiert… bitte warten":"Bestehende Bilder optimieren"}),d&&e.jsx("p",{className:"mt-3 text-sm text-red-600",children:d}),s&&e.jsxs("p",{className:"mt-3 text-sm text-green-600 dark:text-green-400",children:[s.processed," Bild(er) verkleinert: ",(s.before_bytes/1024/1024).toFixed(1)," MB"," → ",(s.after_bytes/1024/1024).toFixed(1)," MB."]})]})}export{h as I};
|
import{r,c as u,j as e}from"./index-D9iDlr3Q.js";function h({compact:m=!1}){const[n,i]=r.useState(!1),[s,l]=r.useState(null),[d,o]=r.useState(""),[t,c]=r.useState(null);r.useEffect(()=>{u.get("/settings/compress-status").then(a=>c(a.gd_available)).catch(()=>c(!1))},[]);const b=async()=>{i(!0),o(""),l(null);try{l(await u.post("/settings/compress-uploads",{}))}catch(a){o(a.message)}finally{i(!1)}};return e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsxs("div",{className:"mb-1 flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:"Bilder optimieren"}),t!==null&&e.jsx("span",{className:`rounded-full px-3 py-1 text-xs font-semibold ${t?"bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-300":"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300"}`,children:t?"Aktiv":"Nicht verfügbar"})]}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:m?"Verkleinert alle bereits hochgeladenen Fotos, damit die Seite schneller lädt. Neue Bilder werden automatisch verkleinert.":"Neu hochgeladene Bilder werden automatisch verkleinert und komprimiert. Dieser Button holt das für alle bereits vorhandenen Bilder nach – nützlich, wenn die Seite durch zu hoch aufgelöste Fotos spürbar langsam lädt."}),t===!1&&e.jsx("p",{className:"mb-4 rounded-md bg-amber-50 p-3 text-sm text-amber-800 dark:bg-amber-900/20 dark:text-amber-300",children:'Diese Funktion braucht die PHP-Erweiterung "gd", die auf diesem Server aktuell nicht aktiv ist. Bei den meisten Hostern (auch All-Inkl) ist sie Teil jeder PHP-Version – bitte beim Hoster-Support nachfragen bzw. prüfen, ob in den Hosting-Einstellungen eine andere PHP-Version ausgewählt werden muss.'}),e.jsx("button",{type:"button",onClick:b,disabled:n||t===!1,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:n?"Optimiert… bitte warten":"Bestehende Bilder optimieren"}),d&&e.jsx("p",{className:"mt-3 text-sm text-red-600",children:d}),s&&e.jsxs("p",{className:"mt-3 text-sm text-green-600 dark:text-green-400",children:[s.processed," Bild(er) verkleinert: ",(s.before_bytes/1024/1024).toFixed(1)," MB"," → ",(s.after_bytes/1024/1024).toFixed(1)," MB."]})]})}export{h as I};
|
||||||
File diff suppressed because one or more lines are too long
1
hifi/assets/Impressum-C9DaUhxS.js
Normal file
1
hifi/assets/Impressum-C9DaUhxS.js
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
import{j as s}from"./index-D9iDlr3Q.js";import{L as e}from"./LegalPageView-BeA-agEE.js";function i(){return s.jsx(e,{slug:"impressum",fallbackTitle:"Impressum",description:"Impressum von HifiPlanet Amorbach gemäß § 5 DDG."})}export{i as default};
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
import{j as s}from"./index-t1kn-QYw.js";import{L as e}from"./LegalPageView-BXNg63z_.js";function i(){return s.jsx(e,{slug:"impressum",fallbackTitle:"Impressum",description:"Impressum von HifiPlanet Amorbach gemäß § 5 DDG."})}export{i as default};
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
import{r as l,c as n,b as r,j as a,d,i as m}from"./index-t1kn-QYw.js";function c({slug:e,fallbackTitle:s,description:i}){const[t,x]=l.useState(null);return l.useEffect(()=>{n.get(`/legal-pages/${e}`).then(x).catch(()=>{})},[e]),r({title:(t==null?void 0:t.title)||s,description:i,path:`/${e}`}),t?a.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-12 sm:px-6",children:[a.jsx(d,{entity:"legal_pages",id:e,field:"title",lang:"de",value:t.title,as:"h1",className:"mb-8 block text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl"}),a.jsx(m,{entity:"legal_pages",id:e,field:"body_html",lang:"de",value:t.body_html,label:t.title,className:"legal-content text-sm text-neutral-600 dark:text-neutral-300"})]}):null}export{c as L};
|
import{r as l,c as n,b as r,j as a,d,i as m}from"./index-D9iDlr3Q.js";function c({slug:e,fallbackTitle:s,description:i}){const[t,x]=l.useState(null);return l.useEffect(()=>{n.get(`/legal-pages/${e}`).then(x).catch(()=>{})},[e]),r({title:(t==null?void 0:t.title)||s,description:i,path:`/${e}`}),t?a.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-12 sm:px-6",children:[a.jsx(d,{entity:"legal_pages",id:e,field:"title",lang:"de",value:t.title,as:"h1",className:"mb-8 block text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl"}),a.jsx(m,{entity:"legal_pages",id:e,field:"body_html",lang:"de",value:t.body_html,label:t.title,className:"legal-content text-sm text-neutral-600 dark:text-neutral-300"})]}):null}export{c as L};
|
||||||
|
|
@ -1 +1 @@
|
||||||
import{r as s,c as b,j as e}from"./index-t1kn-QYw.js";import v from"./RichTextEditor-Cnqrut22.js";const j=[{slug:"impressum",label:"Impressum"},{slug:"datenschutz",label:"Datenschutzerklärung"},{slug:"agb",label:"AGB"}];function k(){const[d,u]=s.useState(null),[r,h]=s.useState("impressum"),[c,i]=s.useState(!1),[o,n]=s.useState(""),[g,l]=s.useState(!1);if(s.useEffect(()=>{b.get("/legal-pages").then(u)},[]),!d)return e.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"});const a=d[r],m=(t,f)=>{u(x=>({...x,[r]:{...x[r],[t]:f}})),l(!1)},p=async()=>{i(!0),n(""),l(!1);try{await b.put(`/legal-pages/${r}`,{title:a.title,body_html:a.body_html}),l(!0)}catch(t){n(t.message)}finally{i(!1)}};return e.jsx("div",{className:"max-w-3xl space-y-6",children:e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Rechtstexte"}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Impressum, Datenschutzerklärung und AGB direkt hier pflegen, statt einen Deploy für jede Textänderung zu brauchen. Bitte bei Rechtstexten im Zweifel rechtlich beraten lassen, bevor du größere Änderungen veröffentlichst."}),e.jsx("div",{className:"mb-4 flex flex-wrap gap-2",children:j.map(t=>e.jsx("button",{type:"button",onClick:()=>{h(t.slug),l(!1),n("")},className:`rounded-md px-3 py-1.5 text-sm font-medium transition ${r===t.slug?"bg-brand-500 text-white":"border border-neutral-300 text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:t.label},t.slug))}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Überschrift"}),e.jsx("input",{value:a.title,onChange:t=>m("title",t.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),e.jsx(v,{label:"Inhalt",value:a.body_html,onChange:t=>m("body_html",t)})]}),a.updated_at&&e.jsxs("p",{className:"mt-3 text-xs text-neutral-400",children:["Zuletzt geändert: ",new Date(a.updated_at.replace(" ","T")).toLocaleString("de-DE")]}),o&&e.jsx("p",{className:"mt-3 text-sm text-red-600",children:o}),g&&e.jsx("p",{className:"mt-3 text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),e.jsx("button",{type:"button",onClick:p,disabled:c,className:"mt-4 rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:c?"Speichere…":"Speichern"})]})})}export{k as default};
|
import{r as s,c as b,j as e}from"./index-D9iDlr3Q.js";import v from"./RichTextEditor-pQa5b7yr.js";const j=[{slug:"impressum",label:"Impressum"},{slug:"datenschutz",label:"Datenschutzerklärung"},{slug:"agb",label:"AGB"}];function k(){const[d,u]=s.useState(null),[r,h]=s.useState("impressum"),[c,i]=s.useState(!1),[o,n]=s.useState(""),[g,l]=s.useState(!1);if(s.useEffect(()=>{b.get("/legal-pages").then(u)},[]),!d)return e.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"});const a=d[r],m=(t,f)=>{u(x=>({...x,[r]:{...x[r],[t]:f}})),l(!1)},p=async()=>{i(!0),n(""),l(!1);try{await b.put(`/legal-pages/${r}`,{title:a.title,body_html:a.body_html}),l(!0)}catch(t){n(t.message)}finally{i(!1)}};return e.jsx("div",{className:"max-w-3xl space-y-6",children:e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Rechtstexte"}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Impressum, Datenschutzerklärung und AGB direkt hier pflegen, statt einen Deploy für jede Textänderung zu brauchen. Bitte bei Rechtstexten im Zweifel rechtlich beraten lassen, bevor du größere Änderungen veröffentlichst."}),e.jsx("div",{className:"mb-4 flex flex-wrap gap-2",children:j.map(t=>e.jsx("button",{type:"button",onClick:()=>{h(t.slug),l(!1),n("")},className:`rounded-md px-3 py-1.5 text-sm font-medium transition ${r===t.slug?"bg-brand-500 text-white":"border border-neutral-300 text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:t.label},t.slug))}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Überschrift"}),e.jsx("input",{value:a.title,onChange:t=>m("title",t.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),e.jsx(v,{label:"Inhalt",value:a.body_html,onChange:t=>m("body_html",t)})]}),a.updated_at&&e.jsxs("p",{className:"mt-3 text-xs text-neutral-400",children:["Zuletzt geändert: ",new Date(a.updated_at.replace(" ","T")).toLocaleString("de-DE")]}),o&&e.jsx("p",{className:"mt-3 text-sm text-red-600",children:o}),g&&e.jsx("p",{className:"mt-3 text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),e.jsx("button",{type:"button",onClick:p,disabled:c,className:"mt-4 rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:c?"Speichere…":"Speichern"})]})})}export{k as default};
|
||||||
|
|
@ -1 +1 @@
|
||||||
import{k as N,m as v,r,j as e,n as y,l as C,o as S}from"./index-t1kn-QYw.js";function P(){const{user:x,login:h,verifyTwoFactor:g}=N(),o=v(),[f,u]=r.useState("credentials"),[i,p]=r.useState(""),[c,w]=r.useState(""),[m,b]=r.useState(""),[s,a]=r.useState(""),[n,l]=r.useState(!1);if(x)return e.jsx(y,{to:"/admin",replace:!0});const k=async t=>{t.preventDefault(),l(!0),a("");try{(await h(i,c)).requires2fa?u("code"):o("/admin")}catch(d){a(d.message)}finally{l(!1)}},j=async t=>{t.preventDefault(),l(!0),a("");try{await g(m),o("/admin")}catch(d){a(d.message)}finally{l(!1)}};return e.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-neutral-50 px-4 dark:bg-neutral-950",children:[e.jsx("img",{src:C,alt:"HifiPlanet",className:"h-16 w-auto dark:hidden sm:h-20"}),e.jsx("img",{src:S,alt:"HifiPlanet",className:"hidden h-16 w-auto dark:block sm:h-20"}),f==="credentials"?e.jsxs("form",{onSubmit:k,className:"w-full max-w-sm rounded-xl border border-neutral-200 bg-white p-8 shadow-sm dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h1",{className:"mb-6 text-xl font-bold text-neutral-900 dark:text-white",children:"Admin-Login"}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzername"}),e.jsx("input",{value:i,onChange:t=>p(t.target.value),required:!0,autoFocus:!0,className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm focus:border-brand-500 focus:outline-none dark:border-neutral-700 dark:bg-neutral-900"})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Passwort"}),e.jsx("input",{type:"password",value:c,onChange:t=>w(t.target.value),required:!0,className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm focus:border-brand-500 focus:outline-none dark:border-neutral-700 dark:bg-neutral-900"})]}),s&&e.jsx("p",{className:"mb-4 text-sm text-red-600",children:s}),e.jsx("button",{type:"submit",disabled:n,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:n?"Anmelden…":"Anmelden"})]}):e.jsxs("form",{onSubmit:j,className:"w-full max-w-sm rounded-xl border border-neutral-200 bg-white p-8 shadow-sm dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Bestätigungscode"}),e.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Öffne die Google Authenticator App und gib den 6-stelligen Code ein. Alternativ kannst du auch einen deiner Wiederherstellungscodes verwenden."}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Code"}),e.jsx("input",{value:m,onChange:t=>b(t.target.value),required:!0,autoFocus:!0,inputMode:"numeric",placeholder:"123456",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-center text-lg tracking-widest focus:border-brand-500 focus:outline-none dark:border-neutral-700 dark:bg-neutral-900"})]}),s&&e.jsx("p",{className:"mb-4 text-sm text-red-600",children:s}),e.jsx("button",{type:"submit",disabled:n,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:n?"Prüfe…":"Bestätigen"}),e.jsx("button",{type:"button",onClick:()=>{u("credentials"),b(""),a("")},className:"mt-3 w-full text-sm text-neutral-500 hover:underline dark:text-neutral-400",children:"Zurück zum Login"})]})]})}export{P as default};
|
import{k as N,m as v,r,j as e,n as y,l as C,o as S}from"./index-D9iDlr3Q.js";function P(){const{user:x,login:h,verifyTwoFactor:g}=N(),o=v(),[f,u]=r.useState("credentials"),[i,p]=r.useState(""),[c,w]=r.useState(""),[m,b]=r.useState(""),[s,a]=r.useState(""),[n,l]=r.useState(!1);if(x)return e.jsx(y,{to:"/admin",replace:!0});const k=async t=>{t.preventDefault(),l(!0),a("");try{(await h(i,c)).requires2fa?u("code"):o("/admin")}catch(d){a(d.message)}finally{l(!1)}},j=async t=>{t.preventDefault(),l(!0),a("");try{await g(m),o("/admin")}catch(d){a(d.message)}finally{l(!1)}};return e.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-neutral-50 px-4 dark:bg-neutral-950",children:[e.jsx("img",{src:C,alt:"HifiPlanet",className:"h-16 w-auto dark:hidden sm:h-20"}),e.jsx("img",{src:S,alt:"HifiPlanet",className:"hidden h-16 w-auto dark:block sm:h-20"}),f==="credentials"?e.jsxs("form",{onSubmit:k,className:"w-full max-w-sm rounded-xl border border-neutral-200 bg-white p-8 shadow-sm dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h1",{className:"mb-6 text-xl font-bold text-neutral-900 dark:text-white",children:"Admin-Login"}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzername"}),e.jsx("input",{value:i,onChange:t=>p(t.target.value),required:!0,autoFocus:!0,className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm focus:border-brand-500 focus:outline-none dark:border-neutral-700 dark:bg-neutral-900"})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Passwort"}),e.jsx("input",{type:"password",value:c,onChange:t=>w(t.target.value),required:!0,className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm focus:border-brand-500 focus:outline-none dark:border-neutral-700 dark:bg-neutral-900"})]}),s&&e.jsx("p",{className:"mb-4 text-sm text-red-600",children:s}),e.jsx("button",{type:"submit",disabled:n,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:n?"Anmelden…":"Anmelden"})]}):e.jsxs("form",{onSubmit:j,className:"w-full max-w-sm rounded-xl border border-neutral-200 bg-white p-8 shadow-sm dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Bestätigungscode"}),e.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Öffne die Google Authenticator App und gib den 6-stelligen Code ein. Alternativ kannst du auch einen deiner Wiederherstellungscodes verwenden."}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Code"}),e.jsx("input",{value:m,onChange:t=>b(t.target.value),required:!0,autoFocus:!0,inputMode:"numeric",placeholder:"123456",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-center text-lg tracking-widest focus:border-brand-500 focus:outline-none dark:border-neutral-700 dark:bg-neutral-900"})]}),s&&e.jsx("p",{className:"mb-4 text-sm text-red-600",children:s}),e.jsx("button",{type:"submit",disabled:n,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:n?"Prüfe…":"Bestätigen"}),e.jsx("button",{type:"button",onClick:()=>{u("credentials"),b(""),a("")},className:"mt-3 w-full text-sm text-neutral-500 hover:underline dark:text-neutral-400",children:"Zurück zum Login"})]})]})}export{P as default};
|
||||||
|
|
@ -1 +1 @@
|
||||||
import{r as s,c as o,j as a}from"./index-t1kn-QYw.js";const v={global:{enabled:!1,message:""},services:{enabled:!1,message:""},vehicles:{enabled:!1,message:""}};function N(){const[l,n]=s.useState(v),[g,h]=s.useState(!0),[i,d]=s.useState(!1),[x,r]=s.useState(!1),[c,u]=s.useState("");s.useEffect(()=>{o.get("/maintenance").then(e=>{n({global:{enabled:e.global.enabled,message:e.global.message||""},services:{enabled:e.services.enabled,message:e.services.message||""},vehicles:{enabled:e.vehicles.enabled,message:e.vehicles.message||""}})}).finally(()=>h(!1))},[]);const m=(e,t,k)=>{n(b=>({...b,[e]:{...b[e],[t]:k}})),r(!1)},p=async e=>{e.preventDefault(),d(!0),u(""),r(!1);try{const t=await o.post("/maintenance",l);n({global:{enabled:t.global.enabled,message:t.global.message||""},services:{enabled:t.services.enabled,message:t.services.message||""},vehicles:{enabled:t.vehicles.enabled,message:t.vehicles.message||""}}),r(!0)}catch(t){u(t.message)}finally{d(!1)}},f=[{key:"global",title:"Gesamte Seite",hint:"Besucher sehen nur noch eine Wartungsmeldung – egal welche Seite sie aufrufen. Das Admin-Panel bleibt für dich erreichbar."},{key:"services",title:"Nur Leistungen",hint:"Nur die Leistungen-Seite zeigt eine Wartungsmeldung, der Rest der Website funktioniert normal."},{key:"vehicles",title:"Nur Fahrzeugkatalog",hint:"Nur die Fahrzeugauswahl (Marke → Modell → Pakete) zeigt eine Wartungsmeldung, der Rest der Website funktioniert normal."}];return g?a.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):a.jsxs("form",{onSubmit:p,className:"max-w-2xl space-y-6",children:[a.jsx("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:'Ist "Gesamte Seite" aktiv, gewinnt das immer – die beiden anderen Schalter spielen dann keine Rolle mehr.'}),f.map(e=>a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsxs("div",{className:"mb-1 flex items-center justify-between gap-3",children:[a.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:e.title}),a.jsxs("label",{className:"relative inline-flex cursor-pointer items-center",children:[a.jsx("input",{type:"checkbox",checked:l[e.key].enabled,onChange:t=>m(e.key,"enabled",t.target.checked),className:"peer sr-only"}),a.jsx("div",{className:"h-6 w-11 rounded-full bg-neutral-200 transition peer-checked:bg-brand-500 dark:bg-neutral-700"}),a.jsx("div",{className:"absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition peer-checked:translate-x-5"})]})]}),a.jsx("p",{className:"mb-3 text-sm text-neutral-500 dark:text-neutral-400",children:e.hint}),a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Eigene Nachricht (optional)"}),a.jsx("textarea",{rows:2,value:l[e.key].message,onChange:t=>m(e.key,"message",t.target.value),placeholder:"z. B. Wir aktualisieren gerade unser Angebot. Schau bald wieder vorbei!",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]},e.key)),c&&a.jsx("p",{className:"text-sm text-red-600",children:c}),x&&a.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),a.jsx("button",{type:"submit",disabled:i,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:i?"Speichere…":"Speichern"})]})}export{N as default};
|
import{r as s,c as o,j as a}from"./index-D9iDlr3Q.js";const v={global:{enabled:!1,message:""},services:{enabled:!1,message:""},vehicles:{enabled:!1,message:""}};function N(){const[l,n]=s.useState(v),[g,h]=s.useState(!0),[i,d]=s.useState(!1),[x,r]=s.useState(!1),[c,u]=s.useState("");s.useEffect(()=>{o.get("/maintenance").then(e=>{n({global:{enabled:e.global.enabled,message:e.global.message||""},services:{enabled:e.services.enabled,message:e.services.message||""},vehicles:{enabled:e.vehicles.enabled,message:e.vehicles.message||""}})}).finally(()=>h(!1))},[]);const m=(e,t,k)=>{n(b=>({...b,[e]:{...b[e],[t]:k}})),r(!1)},p=async e=>{e.preventDefault(),d(!0),u(""),r(!1);try{const t=await o.post("/maintenance",l);n({global:{enabled:t.global.enabled,message:t.global.message||""},services:{enabled:t.services.enabled,message:t.services.message||""},vehicles:{enabled:t.vehicles.enabled,message:t.vehicles.message||""}}),r(!0)}catch(t){u(t.message)}finally{d(!1)}},f=[{key:"global",title:"Gesamte Seite",hint:"Besucher sehen nur noch eine Wartungsmeldung – egal welche Seite sie aufrufen. Das Admin-Panel bleibt für dich erreichbar."},{key:"services",title:"Nur Leistungen",hint:"Nur die Leistungen-Seite zeigt eine Wartungsmeldung, der Rest der Website funktioniert normal."},{key:"vehicles",title:"Nur Fahrzeugkatalog",hint:"Nur die Fahrzeugauswahl (Marke → Modell → Pakete) zeigt eine Wartungsmeldung, der Rest der Website funktioniert normal."}];return g?a.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):a.jsxs("form",{onSubmit:p,className:"max-w-2xl space-y-6",children:[a.jsx("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:'Ist "Gesamte Seite" aktiv, gewinnt das immer – die beiden anderen Schalter spielen dann keine Rolle mehr.'}),f.map(e=>a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsxs("div",{className:"mb-1 flex items-center justify-between gap-3",children:[a.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:e.title}),a.jsxs("label",{className:"relative inline-flex cursor-pointer items-center",children:[a.jsx("input",{type:"checkbox",checked:l[e.key].enabled,onChange:t=>m(e.key,"enabled",t.target.checked),className:"peer sr-only"}),a.jsx("div",{className:"h-6 w-11 rounded-full bg-neutral-200 transition peer-checked:bg-brand-500 dark:bg-neutral-700"}),a.jsx("div",{className:"absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition peer-checked:translate-x-5"})]})]}),a.jsx("p",{className:"mb-3 text-sm text-neutral-500 dark:text-neutral-400",children:e.hint}),a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Eigene Nachricht (optional)"}),a.jsx("textarea",{rows:2,value:l[e.key].message,onChange:t=>m(e.key,"message",t.target.value),placeholder:"z. B. Wir aktualisieren gerade unser Angebot. Schau bald wieder vorbei!",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]},e.key)),c&&a.jsx("p",{className:"text-sm text-red-600",children:c}),x&&a.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),a.jsx("button",{type:"submit",disabled:i,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:i?"Speichere…":"Speichern"})]})}export{N as default};
|
||||||
1
hifi/assets/Models-CtIpD8R1.js
Normal file
1
hifi/assets/Models-CtIpD8R1.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
hifi/assets/Partners-CP7drUeL.js
Normal file
1
hifi/assets/Partners-CP7drUeL.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
||||||
import{r as n,j as e,c as i}from"./index-t1kn-QYw.js";const h={name:"",description:"",permissions:[]};function w(){const[c,b]=n.useState([]),[o,g]=n.useState([]),[r,a]=n.useState(h),[l,u]=n.useState(null),[m,x]=n.useState(""),d=()=>{i.get("/permission-groups").then(b),i.get("/permissions/catalog").then(g)};n.useEffect(d,[]);const j=t=>{u(t.id),a({name:t.name,description:t.description||"",permissions:t.permissions})},p=()=>{u(null),a(h)},N=t=>{a(s=>({...s,permissions:s.permissions.includes(t)?s.permissions.filter(y=>y!==t):[...s.permissions,t]}))},k=async t=>{t.preventDefault(),x("");try{l?await i.put(`/permission-groups/${l}`,r):await i.post("/permission-groups",r),p(),d()}catch(s){x(s.message)}},f=async t=>{confirm("Diese Berechtigungsgruppe wirklich löschen? Benutzer behalten ihre sonstigen Rechte.")&&(await i.delete(`/permission-groups/${t}`),d())};return e.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[e.jsxs("div",{className:"lg:col-span-2",children:[e.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Berechtigungsgruppen"}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:'Fasse mehrere Berechtigungen zu einer Gruppe zusammen (z. B. „Werkstatt"), die du dann bequem einem oder mehreren Benutzern zuweisen kannst.'}),e.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:e.jsxs("table",{className:"w-full text-left text-sm",children:[e.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-2",children:"Name"}),e.jsx("th",{className:"px-4 py-2",children:"Berechtigungen"}),e.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),e.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[c.map(t=>e.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[e.jsxs("td",{className:"px-4 py-2",children:[e.jsx("p",{className:"font-medium text-neutral-800 dark:text-neutral-100",children:t.name}),t.description&&e.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:t.description})]}),e.jsxs("td",{className:"px-4 py-2 text-neutral-500 dark:text-neutral-400",children:[t.permissions.length," von ",o.length]}),e.jsxs("td",{className:"px-4 py-2 text-right",children:[e.jsx("button",{onClick:()=>j(t),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),e.jsx("button",{onClick:()=>f(t.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},t.id)),c.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:3,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Berechtigungsgruppen angelegt."})})]})]})})]}),e.jsxs("form",{onSubmit:k,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:l?"Gruppe bearbeiten":"Neue Gruppe"}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),e.jsx("input",{required:!0,value:r.name,onChange:t=>a({...r,name:t.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Beschreibung"}),e.jsx("textarea",{rows:2,value:r.description,onChange:t=>a({...r,description:t.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Berechtigungen"}),e.jsx("div",{className:"space-y-1.5 rounded-md border border-neutral-200 p-3 dark:border-neutral-700",children:o.map(t=>e.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[e.jsx("input",{type:"checkbox",checked:r.permissions.includes(t.key),onChange:()=>N(t.key),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),t.label]},t.key))})]}),m&&e.jsx("p",{className:"text-sm text-red-600",children:m}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:l?"Speichern":"Anlegen"}),l&&e.jsx("button",{type:"button",onClick:p,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}export{w as default};
|
import{r as n,j as e,c as i}from"./index-D9iDlr3Q.js";const h={name:"",description:"",permissions:[]};function w(){const[c,b]=n.useState([]),[o,g]=n.useState([]),[r,a]=n.useState(h),[l,u]=n.useState(null),[m,x]=n.useState(""),d=()=>{i.get("/permission-groups").then(b),i.get("/permissions/catalog").then(g)};n.useEffect(d,[]);const j=t=>{u(t.id),a({name:t.name,description:t.description||"",permissions:t.permissions})},p=()=>{u(null),a(h)},N=t=>{a(s=>({...s,permissions:s.permissions.includes(t)?s.permissions.filter(y=>y!==t):[...s.permissions,t]}))},k=async t=>{t.preventDefault(),x("");try{l?await i.put(`/permission-groups/${l}`,r):await i.post("/permission-groups",r),p(),d()}catch(s){x(s.message)}},f=async t=>{confirm("Diese Berechtigungsgruppe wirklich löschen? Benutzer behalten ihre sonstigen Rechte.")&&(await i.delete(`/permission-groups/${t}`),d())};return e.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[e.jsxs("div",{className:"lg:col-span-2",children:[e.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Berechtigungsgruppen"}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:'Fasse mehrere Berechtigungen zu einer Gruppe zusammen (z. B. „Werkstatt"), die du dann bequem einem oder mehreren Benutzern zuweisen kannst.'}),e.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:e.jsxs("table",{className:"w-full text-left text-sm",children:[e.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-2",children:"Name"}),e.jsx("th",{className:"px-4 py-2",children:"Berechtigungen"}),e.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),e.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[c.map(t=>e.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[e.jsxs("td",{className:"px-4 py-2",children:[e.jsx("p",{className:"font-medium text-neutral-800 dark:text-neutral-100",children:t.name}),t.description&&e.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:t.description})]}),e.jsxs("td",{className:"px-4 py-2 text-neutral-500 dark:text-neutral-400",children:[t.permissions.length," von ",o.length]}),e.jsxs("td",{className:"px-4 py-2 text-right",children:[e.jsx("button",{onClick:()=>j(t),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),e.jsx("button",{onClick:()=>f(t.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},t.id)),c.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:3,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Berechtigungsgruppen angelegt."})})]})]})})]}),e.jsxs("form",{onSubmit:k,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:l?"Gruppe bearbeiten":"Neue Gruppe"}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),e.jsx("input",{required:!0,value:r.name,onChange:t=>a({...r,name:t.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Beschreibung"}),e.jsx("textarea",{rows:2,value:r.description,onChange:t=>a({...r,description:t.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Berechtigungen"}),e.jsx("div",{className:"space-y-1.5 rounded-md border border-neutral-200 p-3 dark:border-neutral-700",children:o.map(t=>e.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[e.jsx("input",{type:"checkbox",checked:r.permissions.includes(t.key),onChange:()=>N(t.key),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),t.label]},t.key))})]}),m&&e.jsx("p",{className:"text-sm text-red-600",children:m}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:l?"Speichern":"Anlegen"}),l&&e.jsx("button",{type:"button",onClick:p,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}export{w as default};
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
||||||
import{r as q,B as xt,j as R,an as Gu,F as Yu}from"./index-t1kn-QYw.js";var Hl={exports:{}},jl={};/**
|
import{r as q,T as xt,j as R,as as Gu,B as Yu}from"./index-D9iDlr3Q.js";var Hl={exports:{}},jl={};/**
|
||||||
* @license React
|
* @license React
|
||||||
* use-sync-external-store-shim.production.js
|
* use-sync-external-store-shim.production.js
|
||||||
*
|
*
|
||||||
|
|
@ -1 +1 @@
|
||||||
import{j as e}from"./index-t1kn-QYw.js";function m({dirty:t,busy:i,savedAt:a,onSave:n,label:s="Speichern",form:r}){return e.jsx("div",{className:"sticky bottom-0 z-20 -mx-4 mt-6 border-t border-neutral-200 bg-white/95 px-4 py-3 backdrop-blur dark:border-neutral-800 dark:bg-neutral-950/95 sm:-mx-6 sm:px-6",children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("p",{className:`text-sm ${t?"font-medium text-amber-600 dark:text-amber-400":"text-neutral-500 dark:text-neutral-400"}`,children:t?"● Ungespeicherte Änderungen":a?`✓ Gespeichert um ${a.toLocaleTimeString("de-DE",{hour:"2-digit",minute:"2-digit"})} Uhr`:"Alles gespeichert"}),e.jsx("button",{type:r?"submit":"button",form:r,onClick:r?void 0:n,disabled:i||!t,className:"rounded-md bg-brand-500 px-5 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:i?"Speichere…":s})]})})}export{m as S};
|
import{j as e}from"./index-D9iDlr3Q.js";function m({dirty:t,busy:i,savedAt:a,onSave:n,label:s="Speichern",form:r}){return e.jsx("div",{className:"sticky bottom-0 z-20 -mx-4 mt-6 border-t border-neutral-200 bg-white/95 px-4 py-3 backdrop-blur dark:border-neutral-800 dark:bg-neutral-950/95 sm:-mx-6 sm:px-6",children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("p",{className:`text-sm ${t?"font-medium text-amber-600 dark:text-amber-400":"text-neutral-500 dark:text-neutral-400"}`,children:t?"● Ungespeicherte Änderungen":a?`✓ Gespeichert um ${a.toLocaleTimeString("de-DE",{hour:"2-digit",minute:"2-digit"})} Uhr`:"Alles gespeichert"}),e.jsx("button",{type:r?"submit":"button",form:r,onClick:r?void 0:n,disabled:i||!t,className:"rounded-md bg-brand-500 px-5 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:i?"Speichere…":s})]})})}export{m as S};
|
||||||
1
hifi/assets/Services-BLqYdrQn.js
Normal file
1
hifi/assets/Services-BLqYdrQn.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
hifi/assets/SettingsLayout-YPeUBW8w.js
Normal file
1
hifi/assets/SettingsLayout-YPeUBW8w.js
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
import{F as a,j as e,r as i,O as d}from"./index-D9iDlr3Q.js";const u={company:["Firmendaten","Telefon, Adresse, Öffnungszeiten und der Hinweis unter den Paketpreisen."],design:["Aussehen","Schriften und das Aussehen der Kacheln auf der Website."],images:["Bilder","Alle fest eingebauten Bilder der Website austauschen: Logo, Titelbild, Link-Vorschau, Startseiten-Fotos, Hintergründe und Paketkacheln. Ohne eigenes Bild gilt jeweils das Standardbild."],legal:["Rechtstexte","Impressum, Datenschutzerklärung und AGB."],maintenance:["Wartungsmodus","Die ganze Website oder einzelne Bereiche vorübergehend für Besucher sperren."],countdown:["Launch-Countdown","Vor dem Start nur einen Countdown zeigen, der neugierig macht. Danach öffnet sich die Website von selbst."],email:["E-Mail-Versand","Zugangsdaten des Mail-Servers und die Texte der automatischen E-Mails."],google:["Google-Dienste","Google Analytics und Google-Bewertungen anbinden. Nur für Techniker."],connections:["Verbindungstest","Prüft auf Knopfdruck, ob Google, Mail-Server, Datenbank, Update-Server und Audio4Cars erreichbar sind und richtig eingerichtet."],database:["Datenbank","Verbindung und Struktur der Datenbank. Nur für Techniker."],"export-import":["Export & Import","Sicherung herunterladen oder auf einem anderen Server einspielen."],update:["Updates","Neue Versionen der Website installieren."],reset:["Zurücksetzen","Inhalte auf den Auslieferungszustand zurücksetzen. Vorher unbedingt exportieren."]};function l(){const{pathname:t}=a(),r=t.replace(/\/$/,"").split("/").pop(),[s,n]=u[r]||["Einstellungen",""];return e.jsxs("div",{children:[e.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:s}),n&&e.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:n}),e.jsx(i.Suspense,{fallback:e.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}),children:e.jsx(d,{})})]})}export{l as default};
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
import{G as a,j as e,r as i,O as u}from"./index-t1kn-QYw.js";const d={company:["Firmendaten","Telefon, Adresse, Öffnungszeiten, Logo und der Hinweis unter den Paketpreisen."],design:["Aussehen","Titelbild, Schriften und das Aussehen der Kacheln auf der Website."],legal:["Rechtstexte","Impressum, Datenschutzerklärung und AGB."],maintenance:["Wartungsmodus","Die ganze Website oder einzelne Bereiche vorübergehend für Besucher sperren."],countdown:["Launch-Countdown","Vor dem Start nur einen Countdown zeigen, der neugierig macht. Danach öffnet sich die Website von selbst."],email:["E-Mail-Versand","Zugangsdaten des Mail-Servers und die Texte der automatischen E-Mails."],google:["Google-Dienste","Google Analytics und Google-Bewertungen anbinden. Nur für Techniker."],connections:["Verbindungstest","Prüft auf Knopfdruck, ob Google, Mail-Server, Datenbank, Update-Server und Audio4Cars erreichbar sind und richtig eingerichtet."],database:["Datenbank","Verbindung und Struktur der Datenbank. Nur für Techniker."],"export-import":["Export & Import","Sicherung herunterladen oder auf einem anderen Server einspielen."],update:["Updates","Neue Versionen der Website installieren."],reset:["Zurücksetzen","Inhalte auf den Auslieferungszustand zurücksetzen. Vorher unbedingt exportieren."]};function l(){const{pathname:t}=a(),r=t.replace(/\/$/,"").split("/").pop(),[s,n]=d[r]||["Einstellungen",""];return e.jsxs("div",{children:[e.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:s}),n&&e.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:n}),e.jsx(i.Suspense,{fallback:e.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}),children:e.jsx(u,{})})]})}export{l as default};
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
||||||
import{j as o,c as x}from"./index-t1kn-QYw.js";import{u as p,a as f,D as m,c as v,S as y,r as j,v as C,b as R,s as w,K as D,T as N,P as T,d as E,C as G}from"./sortable.esm-dNCeQGtw.js";import{G as I}from"./grip-vertical-BnqeYamB.js";function P({items:t,onReorder:s,children:n,as:e="ul",className:d="",disabled:i=!1}){const l=p(f(T,{activationConstraint:{distance:4}}),f(N,{activationConstraint:{delay:150,tolerance:6}}),f(D,{coordinateGetter:w})),c=({active:r,over:a})=>{if(!a||r.id===a.id)return;const h=t.findIndex(b=>b.id===r.id),S=t.findIndex(b=>b.id===a.id);s(R(t,h,S))},u=e==="tbody"?"tbody":e==="grid"?"div":"ul",g=e==="tbody"?"tr":e==="grid"?"div":"li";return o.jsx(m,{sensors:l,collisionDetection:v,onDragEnd:c,children:o.jsx(y,{items:t.map(r=>r.id),strategy:e==="grid"?j:C,disabled:i,children:o.jsx(u,{className:d,children:t.map(r=>o.jsx(K,{id:r.id,tag:g,disabled:i,children:a=>n(r,a)},r.id))})})})}function K({id:t,tag:s,disabled:n,children:e}){const{attributes:d,listeners:i,setNodeRef:l,setActivatorNodeRef:c,transform:u,transition:g,isDragging:r}=E({id:t,disabled:n}),a=n?null:o.jsx("button",{type:"button",ref:c,...d,...i,title:"Ziehen, um die Reihenfolge zu ändern","aria-label":"Reihenfolge ändern",className:"cursor-grab touch-none rounded p-1 text-neutral-400 hover:bg-neutral-100 hover:text-neutral-600 active:cursor-grabbing dark:hover:bg-neutral-800",children:o.jsx(I,{className:"h-4 w-4"})});return o.jsx(s,{ref:l,style:{transform:G.Translate.toString(u),transition:g,position:"relative",zIndex:r?10:void 0},className:r?"bg-white shadow-lg ring-1 ring-brand-500 dark:bg-neutral-900":void 0,children:e(a)})}async function A(t,s){return await x.put(`/reorder/${t}`,{ids:s.map(n=>n.id)}),s.map((n,e)=>({...n,sort_order:(e+1)*10}))}export{P as S,A as s};
|
import{j as o,c as x}from"./index-D9iDlr3Q.js";import{u as p,a as f,D as m,c as v,S as y,r as j,v as C,b as R,s as w,K as D,T as N,P as T,d as E,C as G}from"./sortable.esm-0Y27tIYS.js";import{G as I}from"./grip-vertical-DF1UTnGm.js";function P({items:t,onReorder:s,children:n,as:e="ul",className:d="",disabled:i=!1}){const l=p(f(T,{activationConstraint:{distance:4}}),f(N,{activationConstraint:{delay:150,tolerance:6}}),f(D,{coordinateGetter:w})),c=({active:r,over:a})=>{if(!a||r.id===a.id)return;const h=t.findIndex(b=>b.id===r.id),S=t.findIndex(b=>b.id===a.id);s(R(t,h,S))},u=e==="tbody"?"tbody":e==="grid"?"div":"ul",g=e==="tbody"?"tr":e==="grid"?"div":"li";return o.jsx(m,{sensors:l,collisionDetection:v,onDragEnd:c,children:o.jsx(y,{items:t.map(r=>r.id),strategy:e==="grid"?j:C,disabled:i,children:o.jsx(u,{className:d,children:t.map(r=>o.jsx(K,{id:r.id,tag:g,disabled:i,children:a=>n(r,a)},r.id))})})})}function K({id:t,tag:s,disabled:n,children:e}){const{attributes:d,listeners:i,setNodeRef:l,setActivatorNodeRef:c,transform:u,transition:g,isDragging:r}=E({id:t,disabled:n}),a=n?null:o.jsx("button",{type:"button",ref:c,...d,...i,title:"Ziehen, um die Reihenfolge zu ändern","aria-label":"Reihenfolge ändern",className:"cursor-grab touch-none rounded p-1 text-neutral-400 hover:bg-neutral-100 hover:text-neutral-600 active:cursor-grabbing dark:hover:bg-neutral-800",children:o.jsx(I,{className:"h-4 w-4"})});return o.jsx(s,{ref:l,style:{transform:G.Translate.toString(u),transition:g,position:"relative",zIndex:r?10:void 0},className:r?"bg-white shadow-lg ring-1 ring-brand-500 dark:bg-neutral-900":void 0,children:e(a)})}async function A(t,s){return await x.put(`/reorder/${t}`,{ids:s.map(n=>n.id)}),s.map((n,e)=>({...n,sort_order:(e+1)*10}))}export{P as S,A as s};
|
||||||
|
|
@ -1 +1 @@
|
||||||
import{F as g,r as l,c as x,j as t}from"./index-t1kn-QYw.js";const y=[{label:"Standard",value:""},{label:"S (14px)",value:"14px"},{label:"M (16px)",value:"16px"},{label:"L (18px)",value:"18px"},{label:"XL (20px)",value:"20px"},{label:"XXL (24px)",value:"24px"},{label:"XXXL (28px)",value:"28px"},{label:"Groß (36px)",value:"36px"},{label:"Riesig (48px)",value:"48px"}],s={font_family:"",font_size:"",color:""};function k({fieldKey:o,previewText:p="Beispieltext",label:c="Stil"}){const b=g(),[a,n]=l.useState(s),[m,u]=l.useState(!0),[d,i]=l.useState("");l.useEffect(()=>{u(!0),x.get(`/text-styles/one?key=${encodeURIComponent(o)}`).then(e=>n({font_family:e.font_family||"",font_size:e.font_size||"",color:e.color||""})).catch(()=>n(s)).finally(()=>u(!1))},[o]);const r=async e=>{n(e),i("");try{await x.put("/text-styles",{field_key:o,...e})}catch(v){i(v.message)}};if(m)return null;const f={fontFamily:a.font_family||void 0,fontSize:a.font_size||void 0,color:a.color||void 0};return t.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-2 rounded-md border border-neutral-200 bg-neutral-50 p-2 dark:border-neutral-700 dark:bg-neutral-800/50",children:[t.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-neutral-400",children:c}),t.jsx("select",{value:a.font_family,onChange:e=>r({...a,font_family:e.target.value}),className:"rounded-md border border-neutral-300 bg-white px-2 py-1 text-xs dark:border-neutral-700 dark:bg-neutral-900",children:b.map(e=>t.jsx("option",{value:e.value,children:e.label},e.label))}),t.jsx("select",{value:a.font_size,onChange:e=>r({...a,font_size:e.target.value}),className:"rounded-md border border-neutral-300 bg-white px-2 py-1 text-xs dark:border-neutral-700 dark:bg-neutral-900",children:y.map(e=>t.jsx("option",{value:e.value,children:e.label},e.label))}),t.jsx("input",{type:"color",value:a.color||"#000000",onChange:e=>r({...a,color:e.target.value}),className:"h-7 w-9 cursor-pointer rounded border border-neutral-300 bg-white p-0.5 dark:border-neutral-700 dark:bg-neutral-900",title:"Textfarbe"}),t.jsx("button",{type:"button",onClick:()=>r(s),className:"rounded-md border border-neutral-300 px-2 py-1 text-xs text-neutral-500 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-400 dark:hover:bg-neutral-700",children:"Zurücksetzen"}),t.jsx("span",{className:"ml-1 rounded px-2 py-1 text-sm",style:f,children:p}),d&&t.jsx("span",{className:"text-xs text-red-600",children:d})]})}export{k as T};
|
import{B as g,r as l,c as x,j as t}from"./index-D9iDlr3Q.js";const y=[{label:"Standard",value:""},{label:"S (14px)",value:"14px"},{label:"M (16px)",value:"16px"},{label:"L (18px)",value:"18px"},{label:"XL (20px)",value:"20px"},{label:"XXL (24px)",value:"24px"},{label:"XXXL (28px)",value:"28px"},{label:"Groß (36px)",value:"36px"},{label:"Riesig (48px)",value:"48px"}],s={font_family:"",font_size:"",color:""};function k({fieldKey:o,previewText:p="Beispieltext",label:c="Stil"}){const b=g(),[a,n]=l.useState(s),[m,u]=l.useState(!0),[d,i]=l.useState("");l.useEffect(()=>{u(!0),x.get(`/text-styles/one?key=${encodeURIComponent(o)}`).then(e=>n({font_family:e.font_family||"",font_size:e.font_size||"",color:e.color||""})).catch(()=>n(s)).finally(()=>u(!1))},[o]);const r=async e=>{n(e),i("");try{await x.put("/text-styles",{field_key:o,...e})}catch(v){i(v.message)}};if(m)return null;const f={fontFamily:a.font_family||void 0,fontSize:a.font_size||void 0,color:a.color||void 0};return t.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-2 rounded-md border border-neutral-200 bg-neutral-50 p-2 dark:border-neutral-700 dark:bg-neutral-800/50",children:[t.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-neutral-400",children:c}),t.jsx("select",{value:a.font_family,onChange:e=>r({...a,font_family:e.target.value}),className:"rounded-md border border-neutral-300 bg-white px-2 py-1 text-xs dark:border-neutral-700 dark:bg-neutral-900",children:b.map(e=>t.jsx("option",{value:e.value,children:e.label},e.label))}),t.jsx("select",{value:a.font_size,onChange:e=>r({...a,font_size:e.target.value}),className:"rounded-md border border-neutral-300 bg-white px-2 py-1 text-xs dark:border-neutral-700 dark:bg-neutral-900",children:y.map(e=>t.jsx("option",{value:e.value,children:e.label},e.label))}),t.jsx("input",{type:"color",value:a.color||"#000000",onChange:e=>r({...a,color:e.target.value}),className:"h-7 w-9 cursor-pointer rounded border border-neutral-300 bg-white p-0.5 dark:border-neutral-700 dark:bg-neutral-900",title:"Textfarbe"}),t.jsx("button",{type:"button",onClick:()=>r(s),className:"rounded-md border border-neutral-300 px-2 py-1 text-xs text-neutral-500 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-400 dark:hover:bg-neutral-700",children:"Zurücksetzen"}),t.jsx("span",{className:"ml-1 rounded px-2 py-1 text-sm",style:f,children:p}),d&&t.jsx("span",{className:"text-xs text-red-600",children:d})]})}export{k as T};
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
||||||
import{j as n,z as a}from"./index-t1kn-QYw.js";function i({to:e,label:r="Ansehen",className:t=""}){return e?n.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",title:"Auf der Website ansehen (neuer Tab)",className:`inline-flex items-center gap-1 text-xs font-medium text-neutral-500 hover:text-brand-600 dark:text-neutral-400 ${t}`,children:[n.jsx(a,{className:"h-3.5 w-3.5"}),r]}):null}export{i as V};
|
import{j as n,z as a}from"./index-D9iDlr3Q.js";function i({to:e,label:r="Ansehen",className:t=""}){return e?n.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",title:"Auf der Website ansehen (neuer Tab)",className:`inline-flex items-center gap-1 text-xs font-medium text-neutral-500 hover:text-brand-600 dark:text-neutral-400 ${t}`,children:[n.jsx(a,{className:"h-3.5 w-3.5"}),r]}):null}export{i as V};
|
||||||
1
hifi/assets/WebsiteSettings-DmZBISn-.js
Normal file
1
hifi/assets/WebsiteSettings-DmZBISn-.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
||||||
import{K as e}from"./index-t1kn-QYw.js";/**
|
import{U as e}from"./index-D9iDlr3Q.js";/**
|
||||||
* @license lucide-react v1.23.0 - ISC
|
* @license lucide-react v1.23.0 - ISC
|
||||||
*
|
*
|
||||||
* This source code is licensed under the ISC license.
|
* This source code is licensed under the ISC license.
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import{K as c}from"./index-t1kn-QYw.js";/**
|
import{U as c}from"./index-D9iDlr3Q.js";/**
|
||||||
* @license lucide-react v1.23.0 - ISC
|
* @license lucide-react v1.23.0 - ISC
|
||||||
*
|
*
|
||||||
* This source code is licensed under the ISC license.
|
* This source code is licensed under the ISC license.
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import{K as e,M as L0,Q as x0,T as w0,U as f0,V as I0,W as C0,C as N0,Y as b0,w as $0,Z as q0,y as s,_ as z0,$ as S0,z as A0,a0 as H0,a1 as j0,a2 as V0,a3 as P0,a4 as B0,a5 as D0,a6 as F0,a7 as R0,a8 as T0,a9 as U0,aa as O0,P as G0,ab as Z0,ac as W0,v as E0,ad as X0,ae as K0,af as Q0,ag as J0,ah as Y0,ai as ea,X as aa,aj as ca,ak as fL,al as IL,am as CL,j as NL}from"./index-t1kn-QYw.js";import{D as ta,a as oa,b as da,c as l,F as na,L as ha,M as ia}from"./music-BTxi8SUh.js";import{a as ya,E as ra}from"./eye-D7_3vMVC.js";import{G as ka}from"./grip-vertical-BnqeYamB.js";import{R as pa,T as sa}from"./trash-2-DPlXc95k.js";/**
|
import{U as e,W as L0,Y as x0,Z as w0,_ as f0,$ as I0,a0 as C0,C as N0,a1 as b0,w as $0,a2 as q0,y as s,a3 as z0,a4 as S0,z as A0,a5 as H0,a6 as j0,a7 as V0,a8 as P0,a9 as B0,aa as D0,ab as F0,ac as R0,ad as T0,ae as U0,af as O0,P as G0,ag as Z0,ah as W0,v as E0,ai as X0,aj as K0,ak as Q0,al as J0,am as Y0,an as ea,X as aa,ao as ca,ap as fL,aq as IL,ar as CL,j as NL}from"./index-D9iDlr3Q.js";import{D as ta,a as oa,b as da,c as l,F as na,L as ha,M as ia}from"./music-CMTvNtNQ.js";import{a as ya,E as ra}from"./eye-DJVemz0M.js";import{G as ka}from"./grip-vertical-DF1UTnGm.js";import{R as pa,T as sa}from"./trash-2-BJFq3GHE.js";/**
|
||||||
* @license lucide-react v1.23.0 - ISC
|
* @license lucide-react v1.23.0 - ISC
|
||||||
*
|
*
|
||||||
* This source code is licensed under the ISC license.
|
* This source code is licensed under the ISC license.
|
||||||
1
hifi/assets/index-CVlYN9Ku.css
Normal file
1
hifi/assets/index-CVlYN9Ku.css
Normal file
File diff suppressed because one or more lines are too long
301
hifi/assets/index-D9iDlr3Q.js
Normal file
301
hifi/assets/index-D9iDlr3Q.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
||||||
import{K as a}from"./index-t1kn-QYw.js";/**
|
import{U as a}from"./index-D9iDlr3Q.js";/**
|
||||||
* @license lucide-react v1.23.0 - ISC
|
* @license lucide-react v1.23.0 - ISC
|
||||||
*
|
*
|
||||||
* This source code is licensed under the ISC license.
|
* This source code is licensed under the ISC license.
|
||||||
1
hifi/assets/packageTiers-DOLFlFAh.js
Normal file
1
hifi/assets/packageTiers-DOLFlFAh.js
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
const t=["Base","Clear","Drive","Prime","Elite","Apex","The Statement","Limitless"],r=e=>(e+1)*10;export{t as P,r as t};
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
||||||
import{K as a}from"./index-t1kn-QYw.js";/**
|
import{U as a}from"./index-D9iDlr3Q.js";/**
|
||||||
* @license lucide-react v1.23.0 - ISC
|
* @license lucide-react v1.23.0 - ISC
|
||||||
*
|
*
|
||||||
* This source code is licensed under the ISC license.
|
* This source code is licensed under the ISC license.
|
||||||
|
|
@ -49,8 +49,8 @@
|
||||||
"sameAs": ["https://www.youtube.com/@hifiplanet2812"]
|
"sameAs": ["https://www.youtube.com/@hifiplanet2812"]
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script type="module" crossorigin src="/assets/index-t1kn-QYw.js"></script>
|
<script type="module" crossorigin src="/assets/index-D9iDlr3Q.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-Dk-T0yKD.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-CVlYN9Ku.css">
|
||||||
</head>
|
</head>
|
||||||
<body class="bg-white text-slate-900 dark:bg-slate-950 dark:text-slate-100">
|
<body class="bg-white text-slate-900 dark:bg-slate-950 dark:text-slate-100">
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue