refactor(admin): remove legacy hero section and section ordering form from general dashboard

This commit is contained in:
Daniel S
2026-08-09 22:37:53 +02:00
parent da50ac468b
commit 11f8e33818

View File

@@ -76,49 +76,11 @@ const presets = Object.values(THEME_PRESETS);
</div>
<div>
<label class="block text-xs font-bold text-slate-400 mb-1">Meta Beschreibung</label>
<textarea id="metaDescription" rows="2" class="w-full glass-panel bg-slate-950/60 rounded-xl p-3 text-xs text-white focus:outline-none focus:border-sky-400 resize-none">{siteConfig.metaDescription}</textarea>
<textarea id="metaDescription" rows="3" class="w-full glass-panel bg-slate-950/60 rounded-xl p-3 text-xs text-white focus:outline-none focus:border-sky-400 resize-none">{siteConfig.metaDescription}</textarea>
</div>
</div>
</div>
<!-- Hero Config -->
<div class="glass-panel rounded-3xl p-6 space-y-4">
<h2 class="text-lg font-bold text-sky-400 uppercase tracking-wider flex items-center gap-2">
Hero Sektion
</h2>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div>
<label class="block text-xs font-bold text-slate-400 mb-1">Badge</label>
<input type="text" id="heroBadge" value={siteConfig.hero.badge} class="w-full glass-panel bg-slate-950/60 rounded-xl p-3 text-xs text-white focus:outline-none focus:border-sky-400" />
</div>
<div>
<label class="block text-xs font-bold text-slate-400 mb-1">Hauptueberschrift (Title)</label>
<input type="text" id="heroTitle" value={siteConfig.hero.title} class="w-full glass-panel bg-slate-950/60 rounded-xl p-3 text-xs text-white focus:outline-none focus:border-sky-400" />
</div>
<div class="sm:col-span-2">
<label class="block text-xs font-bold text-slate-400 mb-1">Unterueberschrift (Subtitle)</label>
<textarea id="heroSubtitle" rows="2" class="w-full glass-panel bg-slate-950/60 rounded-xl p-3 text-xs text-white focus:outline-none focus:border-sky-400 resize-none">{siteConfig.hero.subtitle}</textarea>
</div>
<div>
<label class="block text-xs font-bold text-slate-400 mb-1">CTA2 Text</label>
<input type="text" id="ctaPrimaryText" value={siteConfig.hero.ctaPrimaryText} class="w-full glass-panel bg-slate-950-60 rounded-xl p-3 text-xs text-white focus:outline-none focus:border-sky-400" />
</div>
<div>
<label class="block text-xs font-bold text-slate-400 mb-1">CTA2 Link</label>
<input type="text" id="ctaPrimaryLink" value={siteConfig.hero.ctaPrimaryLink} class="w-full glass-panel bg-slate-950-60 rounded-xl p-3 text-xs text-white focus:outline-none focus:border-sky-400" />
</div>
</div>
</div>
<!-- Section Order Management -->
<div class="glass-panel rounded-2xl p-6 space-y-4">
<h2 class="text-lg font-bold text-sky-400 uppercase tracking-wider flex items-center gap-2">
Sektionen Reihenfolge (Layout)
</h2>
<p class="text-xs text-slate-400">Kommagetrennte Liste der aktiv gerenderten Sektionen:</p>
<input type="text" id="sectionsOrder" value={siteConfig.sectionsOrder.join(', ')} class="w-full glass-panel bg-slate-950/60 rounded-xl p-3 text-xs text-white font-mono focus:outline-none focus:border-sky-400" />
</div>
</div>
<!-- Sidebar Column -->
@@ -195,7 +157,6 @@ const presets = Object.values(THEME_PRESETS);
saveBtn.textContent = 'Wird gespeichert...';
const selectedPreset = document.querySelector('input[name="activePreset"]:checked')?.value || 'corporateDark';
const sections = document.getElementById('sectionsOrder').value.split(',').map(s => s.trim()).filter(Boolean);
const getVal = (id) => (document.getElementById(id))?.value || '';
const getNum = (id) => parseInt(document.getElementById(id)?.value || '0') || 587;
@@ -204,15 +165,7 @@ const presets = Object.values(THEME_PRESETS);
const payload = {
siteConfig: {
siteName: getVal('siteName'),
metaDescription: getVal('metaDescription'),
hero: {
badge: getVal('heroBadge'),
title: getVal('heroTitle'),
subtitle: getVal('heroSubtitle'),
ctaPrimaryText: getVal('ctaPrimaryText'),
ctaPrimaryLink: getVal('ctaPrimaryLink')
},
sectionsOrder: sections
metaDescription: getVal('metaDescription')
},
themeConfig: {
activePreset: selectedPreset
@@ -227,6 +180,7 @@ const presets = Object.values(THEME_PRESETS);
};
try {
const res = await fetch('/api/config', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },