Files
WitShop/resources/views/admin/settings/index.blade.php
T
marcoandClaude Sonnet 4.6 4f42b64f24
Deploy to Production (witstore.wende.it) / deploy (push) Successful in 6s
Add theme picker UI to admin settings
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-20 22:00:02 +02:00

133 lines
7.9 KiB
PHP

@extends('layouts.admin')
@section('title', 'Einstellungen')
@section('content')
<form method="POST" action="{{ route('admin.settings.update') }}" class="max-w-3xl" enctype="multipart/form-data">
@csrf @method('PUT')
<div class="space-y-6">
{{-- Shop-Daten --}}
<div class="bg-white rounded shadow p-6">
<h3 class="font-semibold mb-4">Shop-Informationen</h3>
<div class="grid grid-cols-2 gap-4">
{{-- Logo --}}
<div class="col-span-2">
<label class="block text-sm font-medium mb-2">Shop-Logo</label>
@if($settings['shop_logo'])
<div class="flex items-center gap-4 mb-3">
<img src="{{ asset('storage/'.$settings['shop_logo']) }}"
alt="Logo" class="h-14 object-contain border rounded p-1 bg-gray-50">
<label class="flex items-center gap-2 text-sm text-red-600 cursor-pointer">
<input type="checkbox" name="delete_logo" value="1">
Logo löschen
</label>
</div>
@endif
<input type="file" name="shop_logo" accept="image/*" class="text-sm">
<p class="text-xs text-gray-400 mt-1">PNG oder SVG empfohlen, max. 2 MB. Wird im Header und Footer angezeigt.</p>
</div>
@foreach(['shop_name' => 'Shop-Name', 'shop_email' => 'Shop-E-Mail', 'shop_phone' => 'Telefon', 'shop_owner' => 'Inhaber / Firma', 'shop_vat_id' => 'USt-IdNr.'] as $key => $label)
<div>
<label class="block text-sm font-medium mb-1">{{ $label }}</label>
<input type="text" name="{{ $key }}" value="{{ $settings[$key] }}" class="w-full border rounded px-3 py-2 text-sm">
</div>
@endforeach
<div class="col-span-2">
<label class="block text-sm font-medium mb-1">Adresse (für Impressum & Rechnung)</label>
<textarea name="shop_address" rows="3" class="w-full border rounded px-3 py-2 text-sm">{{ $settings['shop_address'] }}</textarea>
</div>
</div>
</div>
{{-- Bankdaten --}}
<div class="bg-white rounded shadow p-6">
<h3 class="font-semibold mb-4">Bankverbindung (Vorkasse)</h3>
<div class="grid grid-cols-3 gap-4">
@foreach(['bank_name' => 'Bank', 'bank_iban' => 'IBAN', 'bank_bic' => 'BIC'] as $key => $label)
<div>
<label class="block text-sm font-medium mb-1">{{ $label }}</label>
<input type="text" name="{{ $key }}" value="{{ $settings[$key] }}" class="w-full border rounded px-3 py-2 text-sm font-mono">
</div>
@endforeach
</div>
<div class="mt-4 max-w-xs">
<label class="block text-sm font-medium mb-1">Zahlungsziel Rechnung (Tage)</label>
<input type="number" name="invoice_payment_days" value="{{ $settings['invoice_payment_days'] }}" class="w-full border rounded px-3 py-2 text-sm">
</div>
</div>
{{-- SMTP --}}
<div class="bg-white rounded shadow p-6">
<h3 class="font-semibold mb-4">E-Mail / SMTP</h3>
<div class="grid grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium mb-1">SMTP Host</label>
<input type="text" name="smtp_host" value="{{ $settings['smtp_host'] }}" class="w-full border rounded px-3 py-2 text-sm font-mono">
</div>
<div>
<label class="block text-sm font-medium mb-1">SMTP Port</label>
<input type="number" name="smtp_port" value="{{ $settings['smtp_port'] }}" class="w-full border rounded px-3 py-2 text-sm">
</div>
<div>
<label class="block text-sm font-medium mb-1">SMTP Benutzername</label>
<input type="text" name="smtp_user" value="{{ $settings['smtp_user'] }}" class="w-full border rounded px-3 py-2 text-sm">
</div>
<div>
<label class="block text-sm font-medium mb-1">SMTP Passwort</label>
<input type="password" name="smtp_password" value="{{ $settings['smtp_password'] }}" class="w-full border rounded px-3 py-2 text-sm" autocomplete="new-password">
</div>
<div>
<label class="block text-sm font-medium mb-1">Absendername</label>
<input type="text" name="smtp_from_name" value="{{ $settings['smtp_from_name'] }}" class="w-full border rounded px-3 py-2 text-sm">
</div>
<div>
<label class="block text-sm font-medium mb-1">Absender-E-Mail</label>
<input type="email" name="smtp_from_email" value="{{ $settings['smtp_from_email'] }}" class="w-full border rounded px-3 py-2 text-sm">
</div>
</div>
</div>
{{-- Sonstiges --}}
<div class="bg-white rounded shadow p-6">
<h3 class="font-semibold mb-4">Sonstiges</h3>
<label class="flex items-center gap-2 text-sm mb-3">
<input type="checkbox" name="cookie_consent" value="1" {{ $settings['cookie_consent'] ? 'checked' : '' }}>
Cookie-Consent-Banner anzeigen
</label>
<label class="flex items-center gap-2 text-sm mb-3">
<input type="checkbox" name="require_customer_approval" value="1" {{ ($settings['require_customer_approval'] ?? false) ? 'checked' : '' }}>
<span>Neue Kunden müssen manuell freigeschaltet werden <span class="text-gray-400">(nach Registrierung gesperrt bis Admin-Freigabe)</span></span>
</label>
<div>
<label class="block text-sm font-medium mb-1">Google Analytics Tracking-ID (leer = deaktiviert)</label>
<input type="text" name="google_analytics" value="{{ $settings['google_analytics'] }}" class="w-full border rounded px-3 py-2 text-sm font-mono max-w-xs" placeholder="G-XXXXXXXXXX">
</div>
</div>
{{-- Design / Theme --}}
<div class="bg-white rounded shadow p-6">
<h3 class="font-semibold mb-4">Design</h3>
<p class="text-sm text-gray-500 mb-4">Wählen Sie die Hauptfarbe Ihres Shops. Die Änderung wird sofort nach dem Speichern aktiv.</p>
<input type="hidden" name="theme_name" id="theme_name" value="{{ $settings['theme_name'] ?: 'default' }}">
<div class="flex flex-wrap gap-3">
@foreach(config('themes') as $key => $theme)
<button type="button"
onclick="document.getElementById('theme_name').value='{{ $key }}'; document.querySelectorAll('.theme-btn').forEach(b=>b.classList.remove('ring-2','ring-offset-2','ring-gray-800')); this.classList.add('ring-2','ring-offset-2','ring-gray-800');"
class="theme-btn flex items-center gap-2 px-4 py-2 rounded border text-sm font-medium transition
{{ ($settings['theme_name'] ?: 'default') === $key ? 'ring-2 ring-offset-2 ring-gray-800' : '' }}">
<span class="w-5 h-5 rounded-full inline-block border border-gray-300" style="background:{{ $theme['primary'] }}"></span>
{{ $theme['name'] }}
</button>
@endforeach
</div>
</div>
<div class="flex gap-3">
<button type="submit" class="bg-blue-600 text-white px-6 py-2 rounded hover:bg-blue-700">Einstellungen speichern</button>
<a href="{{ route('admin.shipping.index') }}" class="border px-6 py-2 rounded hover:bg-gray-50 text-sm">Versandkosten verwalten →</a>
</div>
</div>
</form>
@endsection