HifiPlanet-Website/hifi/api/database
Maaxxs 326d124a60 Let admins upload their own custom fonts
Adds a new custom_fonts table (name, a server-generated collision-free
font_family identifier, file_path) with its own upload endpoint
(CustomFontController) separate from the generic image-only /uploads,
since it needs to accept WOFF2/WOFF/TTF/OTF instead. New management UI in
WebsiteSettings.jsx ("Eigene Schriftarten"): upload with a display name,
list with delete.

CustomFontsContext.jsx fetches the list once per layout (PublicLayout.jsx
for visitors, AdminLayout.jsx for the dashboard) and exposes it two ways:
useFontOptionsWithCustom() appends the uploaded fonts to the existing
static FONT_OPTIONS list for every font picker (RichTextEditor,
TextStyleWidget, the per-section and global site-font dropdowns), and a
new CustomFontFaces.jsx component renders the @font-face rules that
actually make an uploaded font usable - without it, picking a custom font
would just reference a name the browser has no file for. refresh() lets
WebsiteSettings.jsx update every picker immediately after an
upload/delete, not just on next page load.

Fonts::isValid() replaces the three places that validated a font_family
value against the fixed Fonts::VALUES list (site-wide default, per-section
override, per-field text style) - it now also accepts any uploaded
font's generated identifier, so those endpoints don't reject a custom
font as an unknown value.

Verified locally end-to-end: migration creates the table, a simulated
upload's font_family passes validation while a nonexistent one doesn't,
index() returns the expected shape, and destroy() removes both the row
and the file from uploads/.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-10 03:28:57 +02:00
..
migration_2fa.sql Initial commit: HifiPlanet Car-Hifi Shop (Frontend + Backend) 2026-07-05 13:37:06 +02:00
migration_analytics.sql Add Google Analytics integration with consent-gated loading 2026-07-07 01:32:44 +02:00
migration_analytics_dashboard.sql Add Google Analytics dashboard widget (GA4 Data API integration) 2026-07-07 01:57:32 +02:00
migration_brand_model_images.sql Add image support for car brands and models 2026-09-09 01:42:40 +02:00
migration_business_stammdaten.sql Add CMS v1: editable business identity and legal pages 2026-09-09 02:03:59 +02:00
migration_custom_fonts.sql Let admins upload their own custom fonts 2026-09-10 03:28:57 +02:00
migration_faqs.sql Move FAQ management into the admin panel and cover it plus the gallery in export/import 2026-07-07 19:25:06 +02:00
migration_font.sql Add global font selection with per-section override 2026-09-10 00:12:01 +02:00
migration_gallery_card_align.sql Make gallery card name label alignment configurable with a live preview 2026-09-09 03:13:58 +02:00
migration_gallery_card_drag.sql Replace left/center/right buttons with real drag-and-drop positioning 2026-09-09 03:23:37 +02:00
migration_gallery_card_y.sql Add vertical drag positioning for gallery card labels 2026-09-09 03:29:55 +02:00
migration_home_sections.sql Make the homepage's main marketing text blocks editable 2026-09-09 02:51:00 +02:00
migration_home_sections_position.sql Add live-preview positioning to all homepage sections 2026-09-09 03:42:17 +02:00
migration_last_active.sql Track when each admin user was last active 2026-08-29 22:14:06 +02:00
migration_mail_settings.sql Add configurable SMTP email settings and contact-form email notifications 2026-07-07 00:54:17 +02:00
migration_maintenance.sql Initial commit: HifiPlanet Car-Hifi Shop (Frontend + Backend) 2026-07-05 13:37:06 +02:00
migration_package_card_layout.sql Redesign package tiles as a dark, credit-card-style scroll strip with hue-sweeping tiers 2026-07-08 23:41:59 +02:00
migration_package_card_theme.sql Add selectable package card color themes and refine the feature list styling 2026-07-08 10:28:05 +02:00
migration_package_design.sql Make package cards configurable and give them a proper tiered design 2026-07-07 21:13:55 +02:00
migration_package_price_text.sql Implement client feedback: calmer cursor, price override text, 3D coverflow layout 2026-07-12 15:13:08 +02:00
migration_package_wheel_hint_interval.sql Repeat the wheel-scroll hint on an admin-configurable interval 2026-08-01 00:39:23 +02:00
migration_partners.sql Add Partner management to replace the hardcoded homepage brand strip 2026-09-10 00:05:44 +02:00
migration_permissions.sql Initial commit: HifiPlanet Car-Hifi Shop (Frontend + Backend) 2026-07-05 13:37:06 +02:00
migration_services.sql Initial commit: HifiPlanet Car-Hifi Shop (Frontend + Backend) 2026-07-05 13:37:06 +02:00
migration_site_settings.sql Add admin-configurable website settings and VIN field to contact form 2026-07-06 15:28:11 +02:00
migration_text_styles.sql Add generic per-field text styling (font/size/color), starting with home sections 2026-09-10 02:59:06 +02:00
migration_upgrades.sql Initial commit: HifiPlanet Car-Hifi Shop (Frontend + Backend) 2026-07-05 13:37:06 +02:00
schema.sql Let admins upload their own custom fonts 2026-09-10 03:28:57 +02:00