Add email templates, page layouts, and shop themes (template system)
Deploy to Production (witstore.wende.it) / deploy (push) Successful in 7s

- E-Mail-Templates: DB-gespeicherte HTML-Templates mit {{placeholder}}-System,
  Admin-UI zum Bearbeiten von Betreff und Body, alle 4 Mailables aktualisiert
- Seiten-Layouts: 4 Layouts für CMS-Seiten (Standard, Sidebar, Volle Breite, Landing),
  Layout-Auswahl im Admin-Formular
- Shop-Themes: 5 Farbthemen via CSS-Variablen, Picker in Einstellungen
- Deployment: EmailTemplateSeeder wird automatisch beim Deploy ausgeführt

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-20 22:04:54 +02:00
co-authored by Claude Sonnet 4.6
parent 4f42b64f24
commit 5dad8b9324
23 changed files with 700 additions and 55 deletions
@@ -0,0 +1,48 @@
@extends('layouts.admin')
@section('title', 'E-Mail-Template: ' . $template->label)
@section('content')
<div class="flex items-center gap-3 mb-6">
<a href="{{ route('admin.email-templates.index') }}" class="text-gray-400 hover:text-gray-600">← Zurück</a>
<h2 class="text-xl font-bold">{{ $template->label }}</h2>
</div>
@if(session('success'))
<div class="bg-green-100 border border-green-300 text-green-800 px-4 py-3 rounded mb-4">{{ session('success') }}</div>
@endif
<form method="POST" action="{{ route('admin.email-templates.update', $template) }}" class="space-y-5">
@csrf @method('PUT')
<div class="bg-white rounded shadow p-6 space-y-4">
<div>
<label class="block text-sm font-medium mb-1">Betreff</label>
<input type="text" name="subject" value="{{ old('subject', $template->subject) }}"
class="w-full border rounded px-3 py-2 text-sm @error('subject') border-red-500 @enderror">
@error('subject')<p class="text-red-600 text-xs mt-1">{{ $message }}</p>@enderror
</div>
<div>
<label class="block text-sm font-medium mb-1">HTML-Inhalt</label>
<textarea name="body" rows="24"
class="w-full border rounded px-3 py-2 text-sm font-mono @error('body') border-red-500 @enderror">{{ old('body', $template->body) }}</textarea>
@error('body')<p class="text-red-600 text-xs mt-1">{{ $message }}</p>@enderror
</div>
</div>
@if($template->variables)
<div class="bg-blue-50 border border-blue-200 rounded p-4 text-sm">
<p class="font-medium text-blue-800 mb-2">Verfügbare Platzhalter:</p>
<div class="flex flex-wrap gap-2">
@foreach($template->variables as $var)
<code class="bg-blue-100 text-blue-700 px-2 py-0.5 rounded text-xs">{{"{{"}}{{ $var }}{{"}}"}}</code>
@endforeach
</div>
</div>
@endif
<div class="flex gap-3">
<button type="submit" class="bg-blue-600 text-white px-6 py-2 rounded hover:bg-blue-700">Speichern</button>
<a href="{{ route('admin.email-templates.index') }}" class="border px-6 py-2 rounded hover:bg-gray-50 text-sm">Abbrechen</a>
</div>
</form>
@endsection
@@ -0,0 +1,43 @@
@extends('layouts.admin')
@section('title', 'E-Mail-Templates')
@section('content')
<div class="flex items-center justify-between mb-6">
<h2 class="text-xl font-bold">E-Mail-Templates</h2>
</div>
@if(session('success'))
<div class="bg-green-100 border border-green-300 text-green-800 px-4 py-3 rounded mb-4">{{ session('success') }}</div>
@endif
@if($templates->isEmpty())
<div class="bg-yellow-50 border border-yellow-200 text-yellow-800 px-4 py-3 rounded">
Keine Templates gefunden. Bitte führen Sie <code>php artisan db:seed --class=EmailTemplateSeeder</code> aus.
</div>
@else
<div class="bg-white rounded shadow overflow-hidden">
<table class="w-full text-sm">
<thead class="bg-gray-50 text-gray-600 uppercase text-xs">
<tr>
<th class="px-4 py-3 text-left">Template</th>
<th class="px-4 py-3 text-left">Betreff</th>
<th class="px-4 py-3 text-left">Zuletzt geändert</th>
<th class="px-4 py-3"></th>
</tr>
</thead>
<tbody class="divide-y divide-gray-100">
@foreach($templates as $tpl)
<tr class="hover:bg-gray-50">
<td class="px-4 py-3 font-medium">{{ $tpl->label }}</td>
<td class="px-4 py-3 text-gray-600 max-w-xs truncate">{{ $tpl->subject }}</td>
<td class="px-4 py-3 text-gray-500">{{ $tpl->updated_at->format('d.m.Y H:i') }}</td>
<td class="px-4 py-3 text-right">
<a href="{{ route('admin.email-templates.edit', $tpl) }}"
class="text-blue-600 hover:underline">Bearbeiten</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endif
@endsection
@@ -152,6 +152,14 @@
class="w-full border rounded px-3 py-2 text-sm" min="0">
<p class="text-xs text-gray-400 mt-1">Niedrigere Zahl = weiter links</p>
</div>
<div>
<label class="block text-sm font-medium mb-1">Seiten-Layout</label>
<select name="layout" class="w-full border rounded px-3 py-2 text-sm">
@foreach(['default'=>'Standard (zentriert)','sidebar'=>'Mit Sidebar','full'=>'Volle Breite','landing'=>'Landing Page (ohne Header/Footer)'] as $val => $label)
<option value="{{ $val }}" {{ old('layout', $page->layout ?? 'default') === $val ? 'selected' : '' }}>{{ $label }}</option>
@endforeach
</select>
</div>
</div>
</div>