HifiPlanet-Website/hifi/assets
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
..
apex-CFy2qup8.webp Consolidate the site onto a single branch: main now carries the build output 2026-07-20 06:59:33 +02:00
base-BKOm0Bib.webp Consolidate the site onto a single branch: main now carries the build output 2026-07-20 06:59:33 +02:00
bg-dark-DX_vTCv2.png Use the handoff's baked background images for the contact section 2026-07-20 07:24:59 +02:00
bg-light-C_7mxjWZ.png Use the handoff's baked background images for the contact section 2026-07-20 07:24:59 +02:00
clear-DZZMSrMX.webp Consolidate the site onto a single branch: main now carries the build output 2026-07-20 06:59:33 +02:00
drive-BE2W1yna.webp Consolidate the site onto a single branch: main now carries the build output 2026-07-20 06:59:33 +02:00
elite_r-BRvz_pyr.webp Consolidate the site onto a single branch: main now carries the build output 2026-07-20 06:59:33 +02:00
gallery-amp-purple-CESAKuOf.webp Consolidate the site onto a single branch: main now carries the build output 2026-07-20 06:59:33 +02:00
gallery-dash-Cg-7v9qo.webp Consolidate the site onto a single branch: main now carries the build output 2026-07-20 06:59:33 +02:00
gallery-dash2-CEVCErVK.webp Consolidate the site onto a single branch: main now carries the build output 2026-07-20 06:59:33 +02:00
gallery-rear-8cIXPC7T.webp Consolidate the site onto a single branch: main now carries the build output 2026-07-20 06:59:33 +02:00
gallery-speaker-CUXQZ49Q.webp Consolidate the site onto a single branch: main now carries the build output 2026-07-20 06:59:33 +02:00
gallery-subs-COSd4seJ.webp Consolidate the site onto a single branch: main now carries the build output 2026-07-20 06:59:33 +02:00
hero-highlight-Co4f1Kj5.webp Consolidate the site onto a single branch: main now carries the build output 2026-07-20 06:59:33 +02:00
hero-trunk-Dp4_JHDh.webp Consolidate the site onto a single branch: main now carries the build output 2026-07-20 06:59:33 +02:00
index-BVDYjPgo.js Let admins upload their own custom fonts 2026-09-10 03:28:57 +02:00
index-lUKoqEad.css Fix navbar no longer sticking to the top of the viewport 2026-09-10 03:06:22 +02:00
limitless-DDs0S_PU.webp Consolidate the site onto a single branch: main now carries the build output 2026-07-20 06:59:33 +02:00
logo-BNfZDkmN.png Consolidate the site onto a single branch: main now carries the build output 2026-07-20 06:59:33 +02:00
logo-dark-R-ckaBhx.png Consolidate the site onto a single branch: main now carries the build output 2026-07-20 06:59:33 +02:00
lucide-icons-Cg2IxtAO.js Add rich-text formatting and font choice for email templates 2026-09-09 01:49:13 +02:00
prime-BTVNe2Gb.webp Consolidate the site onto a single branch: main now carries the build output 2026-07-20 06:59:33 +02:00
statement-pTO-wTPx.webp Consolidate the site onto a single branch: main now carries the build output 2026-07-20 06:59:33 +02:00
youtube-hintergrund-C0osNxn7.mp4 Consolidate the site onto a single branch: main now carries the build output 2026-07-20 06:59:33 +02:00