Feature-Toggles, Administration, wiederkehrende Events und Event-Serien

- Administration & Rollenmanagement: Neuer Admin-Bereich mit Feature-Toggles
  und Sichtbarkeitseinstellungen pro Rolle (11 Toggles, 24 Visibility-Settings)
- AdministrationController mit eigenem Settings-Tab, aus SettingsController extrahiert
- Feature-Toggle-Guards in Controllers (Invitation, File, ListGenerator, Comment)
  und Views (events/show, events/edit, events/create)
- Setting::isFeatureEnabled() und isFeatureVisibleFor() Hilfsmethoden
- Wiederkehrende Trainings: Täglich/Wöchentlich/2-Wöchentlich mit Ende per
  Datum oder Anzahl (max. 52), Vorschau im Formular
- Event-Serien: Verknüpfung über event_series_id (UUID), Modal-Dialog beim
  Speichern und Löschen mit Optionen "nur dieses" / "alle folgenden"
- Löschen-Button direkt in der Event-Bearbeitung mit Serien-Dialog
- DemoDataSeeder: 4 Trainings als Serie mit gemeinsamer event_series_id
- Übersetzungen in allen 6 Sprachen (de, en, pl, ru, ar, tr)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Rhino
2026-03-03 08:38:45 +01:00
parent 0990e4249c
commit 8ccadbe89f
27 changed files with 1968 additions and 698 deletions

View File

@@ -0,0 +1,558 @@
<x-layouts.admin :title="__('admin.admin_title')">
<div x-data="administrationPage()" x-init="init()">
<h1 class="text-2xl font-bold mb-6">{{ __('admin.admin_title') }}</h1>
{{-- Tab Navigation --}}
<div class="border-b border-gray-200 mb-6 -mx-4 px-4 overflow-x-auto">
<nav class="flex -mb-px gap-1" role="tablist">
<button type="button" @click="tab = 'features'"
:class="tab === 'features' ? 'border-blue-500 text-blue-600' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'"
class="whitespace-nowrap px-4 py-2.5 border-b-2 text-sm font-medium transition-colors" role="tab">
{{ __('admin.admin_tab_features') }}
</button>
<button type="button" @click="tab = 'mail'"
:class="tab === 'mail' ? 'border-blue-500 text-blue-600' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'"
class="whitespace-nowrap px-4 py-2.5 border-b-2 text-sm font-medium transition-colors" role="tab">
{{ __('admin.admin_tab_mail') }}
</button>
<button type="button" @click="tab = 'license'"
:class="tab === 'license' ? 'border-blue-500 text-blue-600' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'"
class="whitespace-nowrap px-4 py-2.5 border-b-2 text-sm font-medium transition-colors" role="tab">
{{ __('admin.admin_tab_license') }}
</button>
<button type="button" @click="tab = 'maintenance'"
:class="tab === 'maintenance' ? 'border-red-500 text-red-600' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'"
class="whitespace-nowrap px-4 py-2.5 border-b-2 text-sm font-medium transition-colors" role="tab">
{{ __('admin.admin_tab_maintenance') }}
</button>
<button type="button" @click="tab = 'activity'"
:class="tab === 'activity' ? 'border-blue-500 text-blue-600' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'"
class="whitespace-nowrap px-4 py-2.5 border-b-2 text-sm font-medium transition-colors" role="tab">
{{ __('admin.admin_tab_activity') }}
</button>
</nav>
</div>
{{-- ============================================================ --}}
{{-- Tab: Rollenmanagement --}}
{{-- ============================================================ --}}
<div x-show="tab === 'features'" role="tabpanel">
<form method="POST" action="{{ route('admin.administration.update-features') }}">
@csrf
@method('PUT')
<div class="bg-white rounded-lg shadow p-6 mb-6">
<p class="text-sm text-gray-500 mb-5">{{ __('admin.features_description') }}</p>
@php
$features = [
'statistics' => __('admin.feature_statistics'),
'finances' => __('admin.feature_finances'),
'catering' => __('admin.feature_catering'),
'timekeepers' => __('admin.feature_timekeepers'),
'carpools' => __('admin.feature_carpools'),
'comments' => __('admin.feature_comments'),
'files' => __('admin.feature_files'),
'faqs' => __('admin.feature_faqs'),
'list_generator' => __('admin.feature_list_generator'),
'invitations' => __('admin.feature_invitations'),
'player_stats' => __('admin.feature_player_stats'),
];
$roles = [
'coach' => __('ui.enums.user_role.coach'),
'parent_rep' => __('ui.enums.user_role.parent_rep'),
];
@endphp
<div class="space-y-4">
@foreach ($features as $featureKey => $featureLabel)
@php
$globalKey = "feature_{$featureKey}";
$globalValue = $featureSettings[$globalKey]->value ?? '1';
@endphp
<div class="border border-gray-200 rounded-md p-4" x-data="{ enabled: {{ $globalValue === '1' ? 'true' : 'false' }} }">
{{-- Global Toggle --}}
<div class="flex items-center justify-between mb-3">
<h3 class="text-sm font-semibold text-gray-700">{{ $featureLabel }}</h3>
<label class="flex items-center gap-2 cursor-pointer">
<span class="text-xs font-medium" :class="enabled ? 'text-green-600' : 'text-gray-400'" x-text="enabled ? '{{ __("admin.feature_enabled") }}' : '{{ __("admin.feature_disabled") }}'"></span>
<input type="hidden" name="settings[{{ $globalKey }}]" :value="enabled ? '1' : '0'">
<button type="button" @click="enabled = !enabled"
:class="enabled ? 'bg-blue-600' : 'bg-gray-300'"
class="relative inline-flex h-6 w-11 flex-shrink-0 rounded-full transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2">
<span :class="enabled ? 'translate-x-5' : 'translate-x-0'"
class="pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out mt-0.5 ml-0.5 rtl:ml-0 rtl:mr-0.5"></span>
</button>
</label>
</div>
{{-- Pro-Rolle Toggles --}}
<div class="flex flex-wrap gap-6 pl-4 rtl:pl-0 rtl:pr-4 border-l-2 rtl:border-l-0 rtl:border-r-2 border-gray-200"
:class="{ 'opacity-40 pointer-events-none': !enabled }">
@foreach ($roles as $roleKey => $roleLabel)
@php
$settingKey = "visibility_{$featureKey}_{$roleKey}";
$currentValue = $visibilitySettings[$settingKey]->value ?? '1';
@endphp
<label class="flex items-center gap-3 cursor-pointer" x-data="{ on: {{ $currentValue === '1' ? 'true' : 'false' }} }">
<input type="hidden" name="settings[{{ $settingKey }}]" :value="on ? '1' : '0'">
<button type="button" @click="on = !on"
:class="on ? 'bg-blue-600' : 'bg-gray-300'"
class="relative inline-flex h-5 w-9 flex-shrink-0 rounded-full transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1">
<span :class="on ? 'translate-x-4' : 'translate-x-0'"
class="pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out mt-0.5 ml-0.5 rtl:ml-0 rtl:mr-0.5"></span>
</button>
<span class="text-sm text-gray-700">{{ $roleLabel }}</span>
</label>
@endforeach
</div>
</div>
@endforeach
</div>
</div>
<div class="flex gap-3">
<button type="submit" class="bg-blue-600 text-white px-6 py-2 rounded-md hover:bg-blue-700 font-medium">
{{ __('ui.save') }}
</button>
<a href="{{ route('admin.dashboard') }}" class="bg-gray-200 text-gray-700 px-6 py-2 rounded-md hover:bg-gray-300">
{{ __('ui.cancel') }}
</a>
</div>
</form>
</div>
{{-- ============================================================ --}}
{{-- Tab: E-Mail --}}
{{-- ============================================================ --}}
<div x-show="tab === 'mail'" role="tabpanel">
<form method="POST" action="{{ route('admin.administration.update-mail') }}"
x-data="{
mailMailer: @js($mailConfig['mailer'] ?? 'log'),
mailTesting: false,
mailTestResult: false,
mailTestSuccess: false,
mailTestMessage: '',
async testSmtp() {
this.mailTesting = true;
this.mailTestResult = false;
try {
const res = await fetch('{{ route("admin.administration.test-mail") }}', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-CSRF-TOKEN': '{{ csrf_token() }}',
'Accept': 'application/json',
},
body: JSON.stringify({
mail_host: this.$refs.mailHost.value,
mail_port: this.$refs.mailPort.value,
mail_username: this.$refs.mailUsername.value,
mail_password: this.$refs.mailPassword.value,
mail_encryption: this.$refs.mailEncryption.value,
}),
});
const data = await res.json();
this.mailTestSuccess = data.success;
this.mailTestMessage = data.message;
} catch (e) {
this.mailTestSuccess = false;
this.mailTestMessage = 'Netzwerkfehler: ' + e.message;
}
this.mailTesting = false;
this.mailTestResult = true;
}
}">
@csrf
@method('PUT')
<div class="bg-white rounded-lg shadow p-6 mb-6">
<h3 class="text-base font-semibold text-gray-800 mb-1">{{ __('admin.mail_config_title') }}</h3>
<p class="text-sm text-gray-500 mb-5">{{ __('admin.mail_config_hint') }}</p>
{{-- Versandmethode --}}
<div class="mb-5">
<label class="block text-sm font-medium text-gray-700 mb-2">{{ __('admin.mail_mailer_label') }}</label>
<div class="flex gap-4">
<label class="flex items-center gap-2 cursor-pointer">
<input type="radio" name="mail_mailer" value="smtp" x-model="mailMailer"
class="text-blue-600 focus:ring-blue-500">
<span class="text-sm">SMTP</span>
</label>
<label class="flex items-center gap-2 cursor-pointer">
<input type="radio" name="mail_mailer" value="log" x-model="mailMailer"
class="text-blue-600 focus:ring-blue-500">
<span class="text-sm">{{ __('admin.mail_log_mode') }}</span>
</label>
</div>
</div>
{{-- SMTP-Felder --}}
<div x-show="mailMailer === 'smtp'" x-cloak class="space-y-4 p-4 bg-gray-50 border border-gray-200 rounded-md">
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">{{ __('admin.mail_host_label') }}</label>
<input type="text" name="mail_host" x-ref="mailHost"
value="{{ $mailConfig['host'] }}"
placeholder="z.B. smtp.strato.de"
class="w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
@error('mail_host') <p class="text-xs text-red-600 mt-1">{{ $message }}</p> @enderror
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">{{ __('admin.mail_port_label') }}</label>
<input type="number" name="mail_port" x-ref="mailPort"
value="{{ $mailConfig['port'] }}"
class="w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
@error('mail_port') <p class="text-xs text-red-600 mt-1">{{ $message }}</p> @enderror
</div>
</div>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">{{ __('admin.mail_username_label') }}</label>
<input type="text" name="mail_username" x-ref="mailUsername"
value="{{ $mailConfig['username'] }}"
class="w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
@error('mail_username') <p class="text-xs text-red-600 mt-1">{{ $message }}</p> @enderror
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">{{ __('admin.mail_password_label') }}</label>
<input type="password" name="mail_password" x-ref="mailPassword"
value="{{ $mailConfig['password'] }}"
class="w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
@error('mail_password') <p class="text-xs text-red-600 mt-1">{{ $message }}</p> @enderror
</div>
</div>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">{{ __('admin.mail_from_address_label') }}</label>
<input type="email" name="mail_from_address"
value="{{ $mailConfig['from_address'] }}"
class="w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
@error('mail_from_address') <p class="text-xs text-red-600 mt-1">{{ $message }}</p> @enderror
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">{{ __('admin.mail_from_name_label') }} <span class="text-gray-400 font-normal">(optional)</span></label>
<input type="text" name="mail_from_name"
value="{{ $mailConfig['from_name'] }}"
class="w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
</div>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">{{ __('admin.mail_encryption_label') }}</label>
<select name="mail_encryption" x-ref="mailEncryption"
class="w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
@php $enc = $mailConfig['encryption'] ?? 'tls'; @endphp
<option value="tls" {{ $enc === 'tls' ? 'selected' : '' }}>TLS (Port 587)</option>
<option value="ssl" {{ $enc === 'ssl' ? 'selected' : '' }}>SSL (Port 465)</option>
<option value="none" {{ !in_array($enc, ['tls', 'ssl']) ? 'selected' : '' }}>{{ __('admin.mail_encryption_none') }}</option>
</select>
</div>
{{-- SMTP-Test --}}
<div class="pt-3 border-t border-gray-200">
<button type="button" @click="testSmtp()"
:disabled="mailTesting"
class="px-4 py-2 text-sm font-medium text-white bg-emerald-600 rounded-md hover:bg-emerald-700 transition disabled:opacity-50 disabled:cursor-wait inline-flex items-center gap-2">
<template x-if="mailTesting">
<svg class="animate-spin h-4 w-4 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path>
</svg>
</template>
<span x-text="mailTesting ? '{{ __("admin.mail_testing") }}' : '{{ __("admin.mail_test_button") }}'"></span>
</button>
<p x-show="mailTestResult" x-cloak x-text="mailTestMessage"
:class="mailTestSuccess ? 'text-green-600' : 'text-red-600'"
class="text-sm mt-2"></p>
</div>
</div>
</div>
<div class="flex justify-end">
<button type="submit"
class="px-5 py-2 text-sm font-medium text-white bg-blue-600 rounded-md hover:bg-blue-700 transition">
{{ __('admin.mail_save') }}
</button>
</div>
</form>
</div>
{{-- ============================================================ --}}
{{-- Tab: Lizenz & Support --}}
{{-- ============================================================ --}}
<div x-show="tab === 'license'" role="tabpanel">
{{-- License Key --}}
<form method="POST" action="{{ route('admin.administration.update-license') }}">
@csrf
@method('PUT')
<div class="bg-white rounded-lg shadow p-6 mb-6">
<h2 class="text-lg font-semibold text-gray-900 mb-1">{{ __('admin.license_title') }}</h2>
<p class="text-sm text-gray-500 mb-4">{{ __('admin.license_description') }}</p>
<label for="setting-license_key" class="block text-sm font-semibold text-gray-700 mb-2">{{ __('admin.license_key_label') }}</label>
<input type="text" name="license_key" id="setting-license_key"
value="{{ $licenseKey }}"
placeholder="XXXX-XXXX-XXXX-XXXX"
class="w-full px-3 py-2 border border-gray-300 rounded-md text-sm font-mono focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
{{-- Registration Status --}}
<div class="mt-6 pt-4 border-t border-gray-200">
<h3 class="text-sm font-semibold text-gray-700 mb-2">{{ __('admin.registration_status') }}</h3>
@if ($isRegistered)
<div class="flex items-center gap-2 text-sm text-green-700">
<svg class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>
{{ __('admin.registration_active') }}
</div>
<p class="text-xs text-gray-500 mt-1">Installation-ID: <span class="font-mono">{{ $installationId }}</span></p>
@else
<div class="flex items-center gap-2 text-sm text-gray-500 mb-3">
<svg class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>
{{ __('admin.registration_inactive') }}
</div>
@endif
</div>
<div class="flex justify-end mt-4">
<button type="submit"
class="px-5 py-2 text-sm font-medium text-white bg-blue-600 rounded-md hover:bg-blue-700 transition">
{{ __('ui.save') }}
</button>
</div>
</div>
</form>
{{-- Registration (nur wenn nicht registriert) --}}
@if (!$isRegistered)
<div class="bg-white rounded-lg shadow p-6 mb-6">
<p class="text-sm text-gray-600 mb-3">{{ __('admin.support_not_registered') }}</p>
<form method="POST" action="{{ route('admin.support.register') }}">
@csrf
<button type="submit" class="bg-green-600 text-white px-4 py-2 rounded-md text-sm hover:bg-green-700">
{{ __('admin.register_now') }}
</button>
</form>
</div>
@endif
{{-- System Info --}}
<div class="bg-white rounded-lg shadow p-6 mb-6">
<h3 class="text-sm font-semibold text-gray-700 mb-3">{{ __('admin.version_info') }}</h3>
<dl class="grid grid-cols-2 gap-y-2 gap-x-4 text-sm">
<dt class="text-gray-500">App-Version:</dt>
<dd class="text-gray-800 font-mono">{{ config('app.version') }}</dd>
<dt class="text-gray-500">PHP:</dt>
<dd class="text-gray-800 font-mono">{{ PHP_VERSION }}</dd>
<dt class="text-gray-500">Laravel:</dt>
<dd class="text-gray-800 font-mono">{{ app()->version() }}</dd>
<dt class="text-gray-500">Datenbank:</dt>
<dd class="text-gray-800 font-mono">{{ config('database.default') }}</dd>
</dl>
@if ($updateInfo && version_compare($updateInfo['latest_version'] ?? '0', config('app.version'), '>'))
<div class="mt-4 p-3 bg-blue-50 border border-blue-200 rounded-md">
<p class="text-sm font-medium text-blue-800">
{{ __('admin.update_available', ['version' => $updateInfo['latest_version']]) }}
</p>
@if ($updateInfo['changelog'] ?? null)
<p class="text-xs text-blue-600 mt-1">{{ $updateInfo['changelog'] }}</p>
@endif
@if (($updateInfo['download_url'] ?? null) && str_starts_with($updateInfo['download_url'], 'https://'))
<a href="{{ $updateInfo['download_url'] }}" target="_blank" rel="noopener"
class="inline-block mt-2 text-sm text-blue-700 underline">
{{ __('admin.download_update') }}
</a>
@endif
</div>
@endif
</div>
</div>
{{-- ============================================================ --}}
{{-- Tab: Wartung --}}
{{-- ============================================================ --}}
<div x-show="tab === 'maintenance'" role="tabpanel">
<div class="bg-white rounded-lg shadow p-6">
<h2 class="text-lg font-semibold text-gray-900 mb-4">{{ __('admin.demo_data_delete_title') }}</h2>
<p class="text-sm text-gray-600 mb-4">{{ __('admin.demo_data_delete_description') }}</p>
<div class="grid sm:grid-cols-2 gap-4 mb-5">
<div class="border border-red-200 bg-red-50 rounded-md p-4">
<h3 class="text-sm font-semibold text-red-700 mb-2">{{ __('admin.demo_data_deletes') }}</h3>
<ul class="text-sm text-red-600 space-y-1 list-disc list-inside">
<li>{{ __('admin.stat_users') }} ({{ __('admin.demo_data_except_admin') }})</li>
<li>{{ __('admin.nav_teams') }}</li>
<li>{{ __('admin.nav_players') }}</li>
<li>{{ __('admin.nav_events') }}</li>
<li>Kommentare</li>
<li>{{ __('admin.nav_locations') }}</li>
<li>{{ __('admin.nav_files') }}</li>
<li>{{ __('admin.activity_log_title') }}</li>
</ul>
</div>
<div class="border border-green-200 bg-green-50 rounded-md p-4">
<h3 class="text-sm font-semibold text-green-700 mb-2">{{ __('admin.demo_data_keeps') }}</h3>
<ul class="text-sm text-green-600 space-y-1 list-disc list-inside">
<li>{{ __('admin.demo_data_keeps_admin') }}</li>
<li>{{ __('admin.nav_settings') }}</li>
<li>{{ __('admin.settings_tab_categories') }}</li>
</ul>
</div>
</div>
<div class="border border-red-300 bg-red-50 rounded-md p-4 mb-5">
<p class="text-sm text-red-700 font-medium">{{ __('admin.demo_data_delete_warning') }}</p>
</div>
<form method="POST" action="{{ route('admin.administration.destroy-demo-data') }}"
onsubmit="return confirm(@js(__('admin.demo_data_delete_confirm')))">
@csrf
@method('DELETE')
<div class="mb-4">
<label for="demo-delete-password" class="block text-sm font-medium text-gray-700 mb-1">{{ __('admin.factory_reset_password_label') }}</label>
<input type="password" name="password" id="demo-delete-password" required autocomplete="current-password"
class="w-full max-w-sm px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-red-500 focus:border-red-500">
</div>
<button type="submit"
class="px-5 py-2.5 text-sm font-medium text-white bg-red-600 rounded-md hover:bg-red-700 transition">
{{ __('admin.demo_data_delete_button') }}
</button>
</form>
</div>
{{-- Factory Reset --}}
<div class="bg-white rounded-lg shadow p-6 mt-6 border-2 border-red-300">
<h2 class="text-lg font-semibold text-red-700 mb-4">{{ __('admin.factory_reset_title') }}</h2>
<p class="text-sm text-gray-600 mb-4">{{ __('admin.factory_reset_description') }}</p>
<div class="border border-red-200 bg-red-50 rounded-md p-4 mb-5">
<h3 class="text-sm font-semibold text-red-700 mb-2">{{ __('admin.factory_reset_deletes') }}</h3>
<ul class="text-sm text-red-600 space-y-1 list-disc list-inside">
<li>{{ __('admin.factory_reset_item_users') }}</li>
<li>{{ __('admin.factory_reset_item_data') }}</li>
<li>{{ __('admin.factory_reset_item_settings') }}</li>
<li>{{ __('admin.factory_reset_item_files') }}</li>
</ul>
</div>
<div class="bg-red-100 border border-red-300 rounded-md p-4 mb-5">
<p class="text-sm text-red-800 font-bold">{{ __('admin.factory_reset_warning') }}</p>
</div>
<form method="POST" action="{{ route('admin.administration.factory-reset') }}"
onsubmit="return confirm(@js(__('admin.factory_reset_confirm')))">
@csrf
@method('DELETE')
<div class="mb-4">
<label for="factory-reset-password" class="block text-sm font-medium text-gray-700 mb-1">{{ __('admin.factory_reset_password_label') }}</label>
<input type="password" name="password" id="factory-reset-password" required autocomplete="current-password"
class="w-full max-w-sm px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-red-500 focus:border-red-500">
</div>
<div class="mb-5">
<label for="factory-reset-confirmation" class="block text-sm font-medium text-gray-700 mb-1">{{ __('admin.factory_reset_confirmation_label') }}</label>
<input type="text" name="confirmation" id="factory-reset-confirmation" required
placeholder="RESET-BEST&Auml;TIGT"
class="w-full max-w-sm px-3 py-2 border border-gray-300 rounded-md text-sm font-mono focus:ring-2 focus:ring-red-500 focus:border-red-500">
<p class="mt-1 text-xs text-gray-500">{{ __('admin.factory_reset_confirmation_hint') }}</p>
</div>
<button type="submit"
class="px-5 py-2.5 text-sm font-medium text-white bg-red-700 rounded-md hover:bg-red-800 transition">
{{ __('admin.factory_reset_button') }}
</button>
</form>
</div>
</div>
{{-- ============================================================ --}}
{{-- Tab: Aktivitätslog --}}
{{-- ============================================================ --}}
<div x-show="tab === 'activity'" role="tabpanel">
<div class="bg-white rounded-lg shadow p-6 mb-4">
<div class="flex items-center justify-between mb-4">
<h2 class="text-lg font-semibold text-gray-900">{{ __('admin.activity_recent') }}</h2>
<a href="{{ route('admin.activity-logs.index') }}" class="text-sm text-blue-600 hover:text-blue-800 font-medium">
{{ __('admin.activity_log_title') }} &rarr;
</a>
</div>
<div class="overflow-x-auto">
<table class="w-full text-sm">
<thead class="bg-gray-50 border-b">
<tr>
<th class="text-left px-3 py-2 font-medium text-gray-700">{{ __('admin.log_time') }}</th>
<th class="text-left px-3 py-2 font-medium text-gray-700">{{ __('admin.log_user') }}</th>
<th class="text-center px-3 py-2 font-medium text-gray-700">{{ __('admin.log_action') }}</th>
<th class="text-left px-3 py-2 font-medium text-gray-700">{{ __('admin.log_description') }}</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-100">
@forelse ($recentLogs as $log)
@php
$actionColors = [
'login' => 'bg-green-100 text-green-800',
'logout' => 'bg-gray-100 text-gray-800',
'login_failed' => 'bg-red-100 text-red-800',
'registered' => 'bg-blue-100 text-blue-800',
'created' => 'bg-blue-100 text-blue-800',
'updated' => 'bg-yellow-100 text-yellow-800',
'deleted' => 'bg-red-100 text-red-800',
'restored' => 'bg-green-100 text-green-800',
'toggled_active' => 'bg-yellow-100 text-yellow-800',
'role_changed' => 'bg-purple-100 text-purple-800',
'password_reset' => 'bg-orange-100 text-orange-800',
'reverted' => 'bg-orange-100 text-orange-800',
];
$color = $actionColors[$log->action] ?? 'bg-gray-100 text-gray-800';
@endphp
<tr class="hover:bg-gray-50">
<td class="px-3 py-2 text-gray-500 whitespace-nowrap">{{ $log->created_at->format('d.m. H:i') }}</td>
<td class="px-3 py-2 text-gray-900">{{ $log->user?->name ?? __('admin.log_system') }}</td>
<td class="px-3 py-2 text-center">
<span class="inline-block px-2 py-0.5 rounded-full text-xs font-medium {{ $color }}">{{ $log->action }}</span>
</td>
<td class="px-3 py-2 text-gray-600 truncate max-w-xs">{{ $log->description }}</td>
</tr>
@empty
<tr>
<td colspan="4" class="px-3 py-6 text-center text-gray-400">{{ __('admin.log_empty') }}</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</div>
</div>
</div>
@push('scripts')
<script>
function administrationPage() {
return {
tab: 'features',
init() {
const validTabs = ['features', 'mail', 'license', 'maintenance', 'activity'];
const urlTab = new URLSearchParams(window.location.search).get('tab');
const hash = window.location.hash.replace('#', '');
const stored = sessionStorage.getItem('admin_tab');
if (validTabs.includes(urlTab)) {
this.tab = urlTab;
} else if (validTabs.includes(hash)) {
this.tab = hash;
} else if (validTabs.includes(stored)) {
this.tab = stored;
}
this.$watch('tab', val => {
sessionStorage.setItem('admin_tab', val);
history.replaceState(null, '', '#' + val);
});
},
};
}
</script>
@endpush
</x-layouts.admin>

View File

@@ -91,6 +91,61 @@
@error('status')<p class="mt-1 text-sm text-red-600">{{ $message }}</p>@enderror
</div>
{{-- Wiederholung (nur Training) --}}
<div class="mb-4" x-data="recurrenceData()" x-show="isTraining" x-cloak>
<div class="border border-gray-200 rounded-md p-4">
<h3 class="text-sm font-semibold text-gray-700 mb-3">{{ __('admin.recurrence') }}</h3>
<div class="mb-3">
<label class="block text-xs text-gray-600 mb-1">{{ __('admin.recurrence') }}</label>
<select x-model="recurrence" class="w-full px-3 py-2 border border-gray-300 rounded-md text-sm">
<option value="none">{{ __('admin.recurrence_none') }}</option>
<option value="daily">{{ __('admin.recurrence_daily') }}</option>
<option value="weekly">{{ __('admin.recurrence_weekly') }}</option>
<option value="biweekly">{{ __('admin.recurrence_biweekly') }}</option>
</select>
</div>
<div x-show="recurrence !== 'none'" x-cloak>
<div class="mb-3">
<label class="block text-xs text-gray-600 mb-1">{{ __('admin.recurrence_end_type') }}</label>
<div class="flex gap-4">
<label class="flex items-center gap-1.5 text-sm text-gray-700 cursor-pointer">
<input type="radio" x-model="endType" value="date" class="text-blue-600">
{{ __('admin.recurrence_end_date') }}
</label>
<label class="flex items-center gap-1.5 text-sm text-gray-700 cursor-pointer">
<input type="radio" x-model="endType" value="count" class="text-blue-600">
{{ __('admin.recurrence_end_count') }}
</label>
</div>
</div>
<div x-show="endType === 'date'" class="mb-3">
<label class="block text-xs text-gray-600 mb-1">{{ __('admin.recurrence_end_date') }}</label>
<input type="date" x-model="endDate" class="w-full px-3 py-2 border border-gray-300 rounded-md text-sm">
</div>
<div x-show="endType === 'count'" class="mb-3">
<label class="block text-xs text-gray-600 mb-1">{{ __('admin.recurrence_count_label') }}</label>
<input type="number" x-model.number="count" min="1" max="52" class="w-24 px-3 py-2 border border-gray-300 rounded-md text-sm">
</div>
<div x-show="previewCount > 0" class="text-sm text-blue-600 bg-blue-50 rounded-md px-3 py-2">
<span x-text="previewText"></span>
</div>
<div x-show="previewCount >= 52" class="text-xs text-orange-600 mt-1">
{{ __('admin.recurrence_max_warning', ['max' => 52]) }}
</div>
</div>
</div>
<input type="hidden" name="recurrence" :value="recurrence">
<input type="hidden" name="recurrence_end_type" :value="endType">
<input type="hidden" name="recurrence_end_date" :value="endDate">
<input type="hidden" name="recurrence_count" :value="count">
</div>
{{-- Mindestanforderungen --}}
<div class="mb-4" x-data="minRequirementsData()" x-init="listenTypeChange()">
<div x-show="showDropdowns" x-cloak class="border border-gray-200 rounded-md p-4">
@@ -105,6 +160,7 @@
@endfor
</select>
</div>
@if (\App\Models\Setting::isFeatureEnabled('catering'))
<div x-show="showCatering">
<label class="block text-xs text-gray-600 mb-1">{{ __('admin.min_catering') }}</label>
<select name="min_catering" x-model="minCatering" class="w-full px-2 py-1.5 border border-gray-300 rounded-md text-sm">
@@ -114,6 +170,8 @@
@endfor
</select>
</div>
@endif
@if (\App\Models\Setting::isFeatureEnabled('timekeepers'))
<div x-show="showTimekeepers">
<label class="block text-xs text-gray-600 mb-1">{{ __('admin.min_timekeepers') }}</label>
<select name="min_timekeepers" x-model="minTimekeepers" class="w-full px-2 py-1.5 border border-gray-300 rounded-md text-sm">
@@ -123,6 +181,7 @@
@endfor
</select>
</div>
@endif
</div>
</div>
</div>
@@ -184,6 +243,7 @@
</div>
{{-- Catering/Zeitnehmer-Zuweisungen (nicht für away_game/meeting) --}}
@if (\App\Models\Setting::isFeatureEnabled('catering') || \App\Models\Setting::isFeatureEnabled('timekeepers'))
<div class="mb-4" x-data="assignmentData()" x-init="listenTeamChange()"
x-show="!['away_game', 'meeting'].includes(currentType)" x-cloak>
<template x-if="parents.length > 0">
@@ -193,24 +253,32 @@
<thead>
<tr class="border-b border-gray-200">
<th class="text-left py-2 font-medium text-gray-600">{{ __('ui.name') }}</th>
@if (\App\Models\Setting::isFeatureEnabled('catering'))
<th class="text-center py-2 font-medium text-gray-600">{{ __('admin.catering_assignment') }}</th>
@endif
@if (\App\Models\Setting::isFeatureEnabled('timekeepers'))
<th class="text-center py-2 font-medium text-gray-600">{{ __('admin.timekeeper_assignment') }}</th>
@endif
</tr>
</thead>
<tbody>
<template x-for="p in parents" :key="p.id">
<tr class="border-b border-gray-100">
<td class="py-2" x-text="p.name"></td>
@if (\App\Models\Setting::isFeatureEnabled('catering'))
<td class="py-2 text-center">
<input type="checkbox" name="catering_users[]" :value="p.id"
:checked="assignedCatering.includes(p.id)"
class="rounded border-gray-300 text-blue-600">
</td>
@endif
@if (\App\Models\Setting::isFeatureEnabled('timekeepers'))
<td class="py-2 text-center">
<input type="checkbox" name="timekeeper_users[]" :value="p.id"
:checked="assignedTimekeeper.includes(p.id)"
class="rounded border-gray-300 text-blue-600">
</td>
@endif
</tr>
</template>
</tbody>
@@ -218,6 +286,7 @@
</div>
</template>
</div>
@endif
{{-- Dateien --}}
<div class="mb-4" x-data="{ showPicker: false, newFileCount: 0 }">
@@ -294,6 +363,41 @@
document.getElementById('description_html').value = quill.root.innerHTML;
});
// Recurrence data for Training events
function recurrenceData() {
const typeSel = document.getElementById('type');
const dateSel = document.getElementById('start_date');
const previewTpl = @js(__('admin.recurrence_preview', ['count' => '__COUNT__']));
return {
recurrence: @js(old('recurrence', 'none')),
endType: @js(old('recurrence_end_type', 'date')),
endDate: @js(old('recurrence_end_date', '')),
count: @js((int) old('recurrence_count', 10)),
isTraining: typeSel.value === 'training',
init() {
typeSel.addEventListener('change', () => {
this.isTraining = typeSel.value === 'training';
if (!this.isTraining) this.recurrence = 'none';
});
},
get startDate() { return dateSel.value; },
get previewCount() {
if (this.recurrence === 'none') return 0;
if (this.endType === 'count') return Math.min(Math.max(1, this.count || 0), 52);
if (!this.startDate || !this.endDate) return 0;
const days = { daily: 1, weekly: 7, biweekly: 14 };
const start = new Date(this.startDate);
const end = new Date(this.endDate);
const diff = Math.floor((end - start) / (1000 * 60 * 60 * 24));
if (diff <= 0) return 0;
return Math.min(Math.floor(diff / days[this.recurrence]), 52);
},
get previewText() {
return previewTpl.replace('__COUNT__', this.previewCount);
}
};
}
// Assignment data for Catering/Timekeeper
function assignmentData() {
const teamParents = @js($teamParents);

View File

@@ -16,6 +16,12 @@
@csrf
@method('PUT')
@if ($event->isPartOfSeries())
<div class="mb-4 bg-blue-50 border border-blue-200 rounded-md px-4 py-2 text-sm text-blue-700">
{{ __('admin.series_hint', ['count' => $event->followingSeriesEvents()->count()]) }}
</div>
@endif
<div class="grid grid-cols-2 gap-4 mb-4">
<div>
<label for="team_id" class="block text-sm font-medium text-gray-700 mb-1">{{ __('ui.team') }} *</label>
@@ -92,6 +98,61 @@
@error('status')<p class="mt-1 text-sm text-red-600">{{ $message }}</p>@enderror
</div>
{{-- Wiederholung (nur Training) --}}
<div class="mb-4" x-data="recurrenceData()" x-show="isTraining" x-cloak>
<div class="border border-gray-200 rounded-md p-4">
<h3 class="text-sm font-semibold text-gray-700 mb-3">{{ __('admin.recurrence') }}</h3>
<div class="mb-3">
<label class="block text-xs text-gray-600 mb-1">{{ __('admin.recurrence') }}</label>
<select x-model="recurrence" class="w-full px-3 py-2 border border-gray-300 rounded-md text-sm">
<option value="none">{{ __('admin.recurrence_none') }}</option>
<option value="daily">{{ __('admin.recurrence_daily') }}</option>
<option value="weekly">{{ __('admin.recurrence_weekly') }}</option>
<option value="biweekly">{{ __('admin.recurrence_biweekly') }}</option>
</select>
</div>
<div x-show="recurrence !== 'none'" x-cloak>
<div class="mb-3">
<label class="block text-xs text-gray-600 mb-1">{{ __('admin.recurrence_end_type') }}</label>
<div class="flex gap-4">
<label class="flex items-center gap-1.5 text-sm text-gray-700 cursor-pointer">
<input type="radio" x-model="endType" value="date" class="text-blue-600">
{{ __('admin.recurrence_end_date') }}
</label>
<label class="flex items-center gap-1.5 text-sm text-gray-700 cursor-pointer">
<input type="radio" x-model="endType" value="count" class="text-blue-600">
{{ __('admin.recurrence_end_count') }}
</label>
</div>
</div>
<div x-show="endType === 'date'" class="mb-3">
<label class="block text-xs text-gray-600 mb-1">{{ __('admin.recurrence_end_date') }}</label>
<input type="date" x-model="endDate" class="w-full px-3 py-2 border border-gray-300 rounded-md text-sm">
</div>
<div x-show="endType === 'count'" class="mb-3">
<label class="block text-xs text-gray-600 mb-1">{{ __('admin.recurrence_count_label') }}</label>
<input type="number" x-model.number="count" min="1" max="52" class="w-24 px-3 py-2 border border-gray-300 rounded-md text-sm">
</div>
<div x-show="previewCount > 0" class="text-sm text-blue-600 bg-blue-50 rounded-md px-3 py-2">
<span x-text="previewText"></span>
</div>
<div x-show="previewCount >= 52" class="text-xs text-orange-600 mt-1">
{{ __('admin.recurrence_max_warning', ['max' => 52]) }}
</div>
</div>
</div>
<input type="hidden" name="recurrence" :value="recurrence">
<input type="hidden" name="recurrence_end_type" :value="endType">
<input type="hidden" name="recurrence_end_date" :value="endDate">
<input type="hidden" name="recurrence_count" :value="count">
</div>
{{-- Mindestanforderungen --}}
<div class="mb-4" x-data="minRequirementsData()" x-init="listenTypeChange()">
<div x-show="showDropdowns" x-cloak class="border border-gray-200 rounded-md p-4">
@@ -106,6 +167,7 @@
@endfor
</select>
</div>
@if (\App\Models\Setting::isFeatureEnabled('catering'))
<div x-show="showCatering">
<label class="block text-xs text-gray-600 mb-1">{{ __('admin.min_catering') }}</label>
<select name="min_catering" x-model="minCatering" class="w-full px-2 py-1.5 border border-gray-300 rounded-md text-sm">
@@ -115,6 +177,8 @@
@endfor
</select>
</div>
@endif
@if (\App\Models\Setting::isFeatureEnabled('timekeepers'))
<div x-show="showTimekeepers">
<label class="block text-xs text-gray-600 mb-1">{{ __('admin.min_timekeepers') }}</label>
<select name="min_timekeepers" x-model="minTimekeepers" class="w-full px-2 py-1.5 border border-gray-300 rounded-md text-sm">
@@ -124,6 +188,7 @@
@endfor
</select>
</div>
@endif
</div>
</div>
</div>
@@ -185,6 +250,7 @@
</div>
{{-- Catering/Zeitnehmer-Zuweisungen (nicht für away_game/meeting) --}}
@if (\App\Models\Setting::isFeatureEnabled('catering') || \App\Models\Setting::isFeatureEnabled('timekeepers'))
<div class="mb-4" x-data="assignmentData()" x-init="listenTeamChange()"
x-show="!['away_game', 'meeting'].includes(currentType)" x-cloak>
<template x-if="parents.length > 0">
@@ -194,24 +260,32 @@
<thead>
<tr class="border-b border-gray-200">
<th class="text-left py-2 font-medium text-gray-600">{{ __('ui.name') }}</th>
@if (\App\Models\Setting::isFeatureEnabled('catering'))
<th class="text-center py-2 font-medium text-gray-600">{{ __('admin.catering_assignment') }}</th>
@endif
@if (\App\Models\Setting::isFeatureEnabled('timekeepers'))
<th class="text-center py-2 font-medium text-gray-600">{{ __('admin.timekeeper_assignment') }}</th>
@endif
</tr>
</thead>
<tbody>
<template x-for="p in parents" :key="p.id">
<tr class="border-b border-gray-100">
<td class="py-2" x-text="p.name"></td>
@if (\App\Models\Setting::isFeatureEnabled('catering'))
<td class="py-2 text-center">
<input type="checkbox" name="catering_users[]" :value="p.id"
:checked="assignedCatering.includes(p.id)"
class="rounded border-gray-300 text-blue-600">
</td>
@endif
@if (\App\Models\Setting::isFeatureEnabled('timekeepers'))
<td class="py-2 text-center">
<input type="checkbox" name="timekeeper_users[]" :value="p.id"
:checked="assignedTimekeeper.includes(p.id)"
class="rounded border-gray-300 text-blue-600">
</td>
@endif
</tr>
</template>
</tbody>
@@ -219,6 +293,7 @@
</div>
</template>
</div>
@endif
{{-- Dateien --}}
<div class="mb-4" x-data="{ showPicker: false, newFileCount: 0 }">
@@ -277,9 +352,57 @@
<button type="button" @click="newFileCount++" class="mt-2 text-sm text-blue-600 hover:text-blue-800">+ {{ __('admin.upload_new_file') }}</button>
</div>
<div class="flex items-center gap-3">
<button type="submit" class="bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700 text-sm font-medium">{{ __('ui.save') }}</button>
<div class="flex items-center gap-3 flex-wrap">
@if ($event->isPartOfSeries() && $event->followingSeriesEvents()->count() > 0)
{{-- Serien-Event: Modal-Dialog beim Speichern --}}
<div x-data="{ showSaveModal: false }" class="contents">
<button type="button" @click="showSaveModal = true" class="bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700 text-sm font-medium">{{ __('ui.save') }}</button>
<div x-show="showSaveModal" x-cloak class="fixed inset-0 z-50 flex items-center justify-center bg-black/50" @keydown.escape.window="showSaveModal = false">
<div class="bg-white rounded-lg shadow-lg p-6 max-w-sm mx-4" @click.outside="showSaveModal = false">
<h3 class="font-semibold text-gray-900 mb-2">{{ __('admin.save_series_title') }}</h3>
<p class="text-sm text-gray-600 mb-4">{{ __('admin.save_series_description', ['count' => $event->followingSeriesEvents()->count()]) }}</p>
<div class="flex flex-col gap-2">
<button type="submit" class="w-full text-left px-3 py-2 text-sm bg-gray-100 hover:bg-gray-200 rounded-md font-medium">{{ __('admin.save_only_this') }}</button>
<button type="submit" name="update_following" value="1" class="w-full text-left px-3 py-2 text-sm bg-green-100 hover:bg-green-200 text-green-700 rounded-md font-medium">{{ __('admin.save_this_and_following') }}</button>
<button type="button" @click="showSaveModal = false" class="text-sm text-gray-500 hover:underline mt-1">{{ __('ui.cancel') }}</button>
</div>
</div>
</div>
</div>
@else
<button type="submit" class="bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700 text-sm font-medium">{{ __('ui.save') }}</button>
@endif
<a href="{{ route('admin.events.index') }}" class="text-sm text-gray-600 hover:underline">{{ __('ui.cancel') }}</a>
{{-- Löschen-Button --}}
@if ($event->isPartOfSeries() && $event->followingSeriesEvents()->count() > 0)
<div x-data="{ showDeleteModal: false }" class="ml-auto">
<button type="button" @click="showDeleteModal = true" class="text-red-600 hover:text-red-800 text-sm font-medium">{{ __('ui.delete') }}</button>
<div x-show="showDeleteModal" x-cloak class="fixed inset-0 z-50 flex items-center justify-center bg-black/50" @keydown.escape.window="showDeleteModal = false">
<div class="bg-white rounded-lg shadow-lg p-6 max-w-sm mx-4" @click.outside="showDeleteModal = false">
<h3 class="font-semibold text-gray-900 mb-2">{{ __('admin.delete_series_title') }}</h3>
<p class="text-sm text-gray-600 mb-4">{{ __('admin.delete_series_description') }}</p>
<div class="flex flex-col gap-2">
<form method="POST" action="{{ route('admin.events.destroy', $event) }}">
@csrf @method('DELETE')
<button type="submit" class="w-full text-left px-3 py-2 text-sm bg-gray-100 hover:bg-gray-200 rounded-md">{{ __('admin.delete_only_this') }}</button>
</form>
<form method="POST" action="{{ route('admin.events.destroy', $event) }}">
@csrf @method('DELETE')
<input type="hidden" name="delete_following" value="1">
<button type="submit" class="w-full text-left px-3 py-2 text-sm bg-red-100 hover:bg-red-200 text-red-700 rounded-md">{{ __('admin.delete_this_and_following') }}</button>
</form>
<button type="button" @click="showDeleteModal = false" class="text-sm text-gray-500 hover:underline mt-1">{{ __('ui.cancel') }}</button>
</div>
</div>
</div>
</div>
@else
<form method="POST" action="{{ route('admin.events.destroy', $event) }}" class="ml-auto inline" onsubmit="return confirm(@js(__('admin.confirm_delete_event')))">
@csrf @method('DELETE')
<button type="submit" class="text-red-600 hover:text-red-800 text-sm font-medium">{{ __('ui.delete') }}</button>
</form>
@endif
</div>
</form>
</div>
@@ -358,7 +481,7 @@
@endif
{{-- Spielerstatistik (nur Spieltypen mit zugesagten Spielern) --}}
@if ($event->type->isGameType())
@if (\App\Models\Setting::isFeatureEnabled('player_stats') && $event->type->isGameType())
@php
$confirmedPlayers = $event->participants
->where('status', \App\Enums\ParticipantStatus::Yes)
@@ -564,6 +687,41 @@
};
}
// Recurrence data for Training events
function recurrenceData() {
const typeSel = document.getElementById('type');
const dateSel = document.getElementById('start_date');
const previewTpl = @js(__('admin.recurrence_preview', ['count' => '__COUNT__']));
return {
recurrence: @js(old('recurrence', 'none')),
endType: @js(old('recurrence_end_type', 'date')),
endDate: @js(old('recurrence_end_date', '')),
count: @js((int) old('recurrence_count', 10)),
isTraining: typeSel.value === 'training',
init() {
typeSel.addEventListener('change', () => {
this.isTraining = typeSel.value === 'training';
if (!this.isTraining) this.recurrence = 'none';
});
},
get startDate() { return dateSel.value; },
get previewCount() {
if (this.recurrence === 'none') return 0;
if (this.endType === 'count') return Math.min(Math.max(1, this.count || 0), 52);
if (!this.startDate || !this.endDate) return 0;
const days = { daily: 1, weekly: 7, biweekly: 14 };
const start = new Date(this.startDate);
const end = new Date(this.endDate);
const diff = Math.floor((end - start) / (1000 * 60 * 60 * 24));
if (diff <= 0) return 0;
return Math.min(Math.floor(diff / days[this.recurrence]), 52);
},
get previewText() {
return previewTpl.replace('__COUNT__', this.previewCount);
}
};
}
function assignmentData() {
const teamParents = @js($teamParents);
const assignedCatering = @js($assignedCatering);

View File

@@ -74,11 +74,35 @@
<div class="shrink-0 text-right">
<div class="flex items-center justify-end gap-2">
<a href="{{ route('admin.events.edit', $event) }}" class="text-blue-600 hover:underline text-sm">{{ __('ui.edit') }}</a>
<form method="POST" action="{{ route('admin.events.destroy', $event) }}" class="inline" onsubmit="return confirm(@js(__('admin.confirm_delete_event')))">
@csrf
@method('DELETE')
<button type="submit" class="text-red-600 hover:text-red-800 text-sm">{{ __('ui.delete') }}</button>
</form>
@if ($event->isPartOfSeries())
<div x-data="{ showDeleteModal: false }" class="inline">
<button @click="showDeleteModal = true" class="text-red-600 hover:text-red-800 text-sm">{{ __('ui.delete') }}</button>
<div x-show="showDeleteModal" x-cloak class="fixed inset-0 z-50 flex items-center justify-center bg-black/50" @keydown.escape.window="showDeleteModal = false">
<div class="bg-white rounded-lg shadow-lg p-6 max-w-sm mx-4" @click.outside="showDeleteModal = false">
<h3 class="font-semibold text-gray-900 mb-2">{{ __('admin.delete_series_title') }}</h3>
<p class="text-sm text-gray-600 mb-4">{{ __('admin.delete_series_description') }}</p>
<div class="flex flex-col gap-2">
<form method="POST" action="{{ route('admin.events.destroy', $event) }}">
@csrf @method('DELETE')
<button type="submit" class="w-full text-left px-3 py-2 text-sm bg-gray-100 hover:bg-gray-200 rounded-md">{{ __('admin.delete_only_this') }}</button>
</form>
<form method="POST" action="{{ route('admin.events.destroy', $event) }}">
@csrf @method('DELETE')
<input type="hidden" name="delete_following" value="1">
<button type="submit" class="w-full text-left px-3 py-2 text-sm bg-red-100 hover:bg-red-200 text-red-700 rounded-md">{{ __('admin.delete_this_and_following') }}</button>
</form>
<button @click="showDeleteModal = false" class="text-sm text-gray-500 hover:underline mt-1">{{ __('ui.cancel') }}</button>
</div>
</div>
</div>
</div>
@else
<form method="POST" action="{{ route('admin.events.destroy', $event) }}" class="inline" onsubmit="return confirm(@js(__('admin.confirm_delete_event')))">
@csrf
@method('DELETE')
<button type="submit" class="text-red-600 hover:text-red-800 text-sm">{{ __('ui.delete') }}</button>
</form>
@endif
</div>
</div>
</div>

View File

@@ -10,11 +10,6 @@
class="whitespace-nowrap px-4 py-2.5 border-b-2 text-sm font-medium transition-colors" role="tab">
{{ __('admin.settings_tab_general') }}
</button>
<button type="button" @click="tab = 'mail'"
:class="tab === 'mail' ? 'border-blue-500 text-blue-600' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'"
class="whitespace-nowrap px-4 py-2.5 border-b-2 text-sm font-medium transition-colors" role="tab">
{{ __('admin.settings_tab_mail') }}
</button>
<button type="button" @click="tab = 'legal'"
:class="tab === 'legal' ? 'border-blue-500 text-blue-600' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'"
class="whitespace-nowrap px-4 py-2.5 border-b-2 text-sm font-medium transition-colors" role="tab">
@@ -36,21 +31,6 @@
class="whitespace-nowrap px-4 py-2.5 border-b-2 text-sm font-medium transition-colors" role="tab">
{{ __('admin.settings_tab_seasons') }}
</button>
<button type="button" @click="tab = 'visibility'"
:class="tab === 'visibility' ? 'border-blue-500 text-blue-600' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'"
class="whitespace-nowrap px-4 py-2.5 border-b-2 text-sm font-medium transition-colors" role="tab">
{{ __('admin.settings_tab_visibility') }}
</button>
<button type="button" @click="tab = 'license'"
:class="tab === 'license' ? 'border-blue-500 text-blue-600' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'"
class="whitespace-nowrap px-4 py-2.5 border-b-2 text-sm font-medium transition-colors" role="tab">
{{ __('admin.settings_tab_license') }}
</button>
<button type="button" @click="tab = 'maintenance'"
:class="tab === 'maintenance' ? 'border-red-500 text-red-600' : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'"
class="whitespace-nowrap px-4 py-2.5 border-b-2 text-sm font-medium transition-colors" role="tab">
{{ __('admin.settings_tab_maintenance') }}
</button>
@endif
</nav>
</div>
@@ -63,7 +43,7 @@
<div x-show="tab === 'general'" x-effect="if (tab === 'general' && !sloganInitialized) $nextTick(() => initSloganEditors())" role="tabpanel">
{{-- Text-Inputs (app_name etc.) --}}
@foreach ($settings as $key => $setting)
@if ($setting->type !== 'html' && $setting->type !== 'richtext' && $key !== 'app_favicon' && $key !== 'statistics_enabled')
@if ($setting->type !== 'html' && $setting->type !== 'richtext' && $key !== 'app_favicon' && $key !== 'statistics_enabled' && $key !== 'license_key')
<div class="bg-white rounded-lg shadow p-6 mb-6">
<label for="setting-{{ $key }}" class="block text-sm font-semibold text-gray-700 mb-2">{{ $setting->label }}</label>
<input
@@ -157,159 +137,6 @@
@endforeach
</div>
{{-- Tab: E-Mail --}}
<div x-show="tab === 'mail'" role="tabpanel">
<form method="POST" action="{{ route('admin.settings.update-mail') }}"
x-data="{
mailMailer: @js($mailConfig['mailer'] ?? 'log'),
mailTesting: false,
mailTestResult: false,
mailTestSuccess: false,
mailTestMessage: '',
async testSmtp() {
this.mailTesting = true;
this.mailTestResult = false;
try {
const res = await fetch('{{ route("admin.settings.test-mail") }}', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-CSRF-TOKEN': '{{ csrf_token() }}',
'Accept': 'application/json',
},
body: JSON.stringify({
mail_host: this.$refs.mailHost.value,
mail_port: this.$refs.mailPort.value,
mail_username: this.$refs.mailUsername.value,
mail_password: this.$refs.mailPassword.value,
mail_encryption: this.$refs.mailEncryption.value,
}),
});
const data = await res.json();
this.mailTestSuccess = data.success;
this.mailTestMessage = data.message;
} catch (e) {
this.mailTestSuccess = false;
this.mailTestMessage = 'Netzwerkfehler: ' + e.message;
}
this.mailTesting = false;
this.mailTestResult = true;
}
}">
@csrf
@method('PUT')
<div class="bg-white rounded-lg shadow p-6 mb-6">
<h3 class="text-base font-semibold text-gray-800 mb-1">{{ __('admin.mail_config_title') }}</h3>
<p class="text-sm text-gray-500 mb-5">{{ __('admin.mail_config_hint') }}</p>
{{-- Versandmethode --}}
<div class="mb-5">
<label class="block text-sm font-medium text-gray-700 mb-2">{{ __('admin.mail_mailer_label') }}</label>
<div class="flex gap-4">
<label class="flex items-center gap-2 cursor-pointer">
<input type="radio" name="mail_mailer" value="smtp" x-model="mailMailer"
class="text-blue-600 focus:ring-blue-500">
<span class="text-sm">SMTP</span>
</label>
<label class="flex items-center gap-2 cursor-pointer">
<input type="radio" name="mail_mailer" value="log" x-model="mailMailer"
class="text-blue-600 focus:ring-blue-500">
<span class="text-sm">{{ __('admin.mail_log_mode') }}</span>
</label>
</div>
</div>
{{-- SMTP-Felder --}}
<div x-show="mailMailer === 'smtp'" x-cloak class="space-y-4 p-4 bg-gray-50 border border-gray-200 rounded-md">
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">{{ __('admin.mail_host_label') }}</label>
<input type="text" name="mail_host" x-ref="mailHost"
value="{{ $mailConfig['host'] }}"
placeholder="z.B. smtp.strato.de"
class="w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
@error('mail_host') <p class="text-xs text-red-600 mt-1">{{ $message }}</p> @enderror
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">{{ __('admin.mail_port_label') }}</label>
<input type="number" name="mail_port" x-ref="mailPort"
value="{{ $mailConfig['port'] }}"
class="w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
@error('mail_port') <p class="text-xs text-red-600 mt-1">{{ $message }}</p> @enderror
</div>
</div>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">{{ __('admin.mail_username_label') }}</label>
<input type="text" name="mail_username" x-ref="mailUsername"
value="{{ $mailConfig['username'] }}"
class="w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
@error('mail_username') <p class="text-xs text-red-600 mt-1">{{ $message }}</p> @enderror
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">{{ __('admin.mail_password_label') }}</label>
<input type="password" name="mail_password" x-ref="mailPassword"
value="{{ $mailConfig['password'] }}"
class="w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
@error('mail_password') <p class="text-xs text-red-600 mt-1">{{ $message }}</p> @enderror
</div>
</div>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">{{ __('admin.mail_from_address_label') }}</label>
<input type="email" name="mail_from_address"
value="{{ $mailConfig['from_address'] }}"
class="w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
@error('mail_from_address') <p class="text-xs text-red-600 mt-1">{{ $message }}</p> @enderror
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">{{ __('admin.mail_from_name_label') }} <span class="text-gray-400 font-normal">(optional)</span></label>
<input type="text" name="mail_from_name"
value="{{ $mailConfig['from_name'] }}"
class="w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
</div>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">{{ __('admin.mail_encryption_label') }}</label>
<select name="mail_encryption" x-ref="mailEncryption"
class="w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
@php $enc = $mailConfig['encryption'] ?? 'tls'; @endphp
<option value="tls" {{ $enc === 'tls' ? 'selected' : '' }}>TLS (Port 587)</option>
<option value="ssl" {{ $enc === 'ssl' ? 'selected' : '' }}>SSL (Port 465)</option>
<option value="none" {{ !in_array($enc, ['tls', 'ssl']) ? 'selected' : '' }}>{{ __('admin.mail_encryption_none') }}</option>
</select>
</div>
{{-- SMTP-Test --}}
<div class="pt-3 border-t border-gray-200">
<button type="button" @click="testSmtp()"
:disabled="mailTesting"
class="px-4 py-2 text-sm font-medium text-white bg-emerald-600 rounded-md hover:bg-emerald-700 transition disabled:opacity-50 disabled:cursor-wait inline-flex items-center gap-2">
<template x-if="mailTesting">
<svg class="animate-spin h-4 w-4 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path>
</svg>
</template>
<span x-text="mailTesting ? '{{ __("admin.mail_testing") }}' : '{{ __("admin.mail_test_button") }}'"></span>
</button>
<p x-show="mailTestResult" x-cloak x-text="mailTestMessage"
:class="mailTestSuccess ? 'text-green-600' : 'text-red-600'"
class="text-sm mt-2"></p>
</div>
</div>
</div>
<div class="flex justify-end">
<button type="submit"
class="px-5 py-2 text-sm font-medium text-white bg-blue-600 rounded-md hover:bg-blue-700 transition">
{{ __('admin.mail_save') }}
</button>
</div>
</form>
</div>
{{-- Tab: Rechtliches Multi-Language mit Flaggen --}}
<div x-show="tab === 'legal'" x-effect="if (tab === 'legal' && !editorsInitialized) $nextTick(() => initEditors())" role="tabpanel">
{{-- Sprach-Flaggen-Leiste --}}
@@ -556,126 +383,8 @@
</div>
@endif
{{-- Tab: Sichtbarkeit (nur Admin) --}}
@if (auth()->user()->isAdmin())
<div x-show="tab === 'visibility'" role="tabpanel">
<div class="bg-white rounded-lg shadow p-6">
<p class="text-sm text-gray-500 mb-5">{{ __('admin.visibility_description') }}</p>
@php
$features = [
'statistics' => __('admin.visibility_feature_statistics'),
'finances' => __('admin.visibility_feature_finances'),
'catering_history' => __('admin.visibility_feature_catering_history'),
];
$roles = [
'coach' => __('ui.enums.user_role.coach'),
'parent_rep' => __('ui.enums.user_role.parent_rep'),
];
@endphp
<div class="space-y-4">
@foreach ($features as $featureKey => $featureLabel)
<div class="border border-gray-200 rounded-md p-4">
<h3 class="text-sm font-semibold text-gray-700 mb-3">{{ $featureLabel }}</h3>
<div class="flex flex-wrap gap-6">
@foreach ($roles as $roleKey => $roleLabel)
@php
$settingKey = "visibility_{$featureKey}_{$roleKey}";
$currentValue = $visibilitySettings[$settingKey]->value ?? '1';
@endphp
<label class="flex items-center gap-3 cursor-pointer" x-data="{ on: {{ $currentValue === '1' ? 'true' : 'false' }} }">
<input type="hidden" name="settings[{{ $settingKey }}]" :value="on ? '1' : '0'">
<button type="button" @click="on = !on"
:class="on ? 'bg-blue-600' : 'bg-gray-300'"
class="relative inline-flex h-6 w-11 flex-shrink-0 rounded-full transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2">
<span :class="on ? 'translate-x-5' : 'translate-x-0'"
class="pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out mt-0.5 ml-0.5"></span>
</button>
<span class="text-sm text-gray-700">{{ $roleLabel }}</span>
</label>
@endforeach
</div>
</div>
@endforeach
</div>
</div>
</div>
@endif
{{-- Tab: Lizenz & Support (nur Admin) --}}
@if (auth()->user()->isAdmin())
<div x-show="tab === 'license'" role="tabpanel">
{{-- License Key --}}
<div class="bg-white rounded-lg shadow p-6 mb-6">
<h2 class="text-lg font-semibold text-gray-900 mb-1">{{ __('admin.license_title') }}</h2>
<p class="text-sm text-gray-500 mb-4">{{ __('admin.license_description') }}</p>
<label for="setting-license_key" class="block text-sm font-semibold text-gray-700 mb-2">{{ __('admin.license_key_label') }}</label>
<input type="text" name="settings[license_key]" id="setting-license_key"
value="{{ $settings['license_key']->value ?? '' }}"
placeholder="XXXX-XXXX-XXXX-XXXX"
class="w-full px-3 py-2 border border-gray-300 rounded-md text-sm font-mono focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
{{-- Registration Status --}}
<div class="mt-6 pt-4 border-t border-gray-200">
<h3 class="text-sm font-semibold text-gray-700 mb-2">{{ __('admin.registration_status') }}</h3>
@if ($isRegistered)
<div class="flex items-center gap-2 text-sm text-green-700">
<svg class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>
{{ __('admin.registration_active') }}
</div>
<p class="text-xs text-gray-500 mt-1">Installation-ID: <span class="font-mono">{{ $installationId }}</span></p>
@else
<div class="flex items-center gap-2 text-sm text-gray-500 mb-3">
<svg class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>
{{ __('admin.registration_inactive') }}
</div>
@endif
</div>
</div>
{{-- System Info --}}
<div class="bg-white rounded-lg shadow p-6 mb-6">
<h3 class="text-sm font-semibold text-gray-700 mb-3">{{ __('admin.version_info') }}</h3>
<dl class="grid grid-cols-2 gap-y-2 gap-x-4 text-sm">
<dt class="text-gray-500">App-Version:</dt>
<dd class="text-gray-800 font-mono">{{ config('app.version') }}</dd>
<dt class="text-gray-500">PHP:</dt>
<dd class="text-gray-800 font-mono">{{ PHP_VERSION }}</dd>
<dt class="text-gray-500">Laravel:</dt>
<dd class="text-gray-800 font-mono">{{ app()->version() }}</dd>
<dt class="text-gray-500">Datenbank:</dt>
<dd class="text-gray-800 font-mono">{{ config('database.default') }}</dd>
</dl>
@if ($updateInfo && version_compare($updateInfo['latest_version'] ?? '0', config('app.version'), '>'))
<div class="mt-4 p-3 bg-blue-50 border border-blue-200 rounded-md">
<p class="text-sm font-medium text-blue-800">
{{ __('admin.update_available', ['version' => $updateInfo['latest_version']]) }}
</p>
@if ($updateInfo['changelog'] ?? null)
<p class="text-xs text-blue-600 mt-1">{{ $updateInfo['changelog'] }}</p>
@endif
@if (($updateInfo['download_url'] ?? null) && str_starts_with($updateInfo['download_url'], 'https://'))
<a href="{{ $updateInfo['download_url'] }}" target="_blank" rel="noopener"
class="inline-block mt-2 text-sm text-blue-700 underline">
{{ __('admin.download_update') }}
</a>
@endif
</div>
@endif
</div>
</div>
@endif
{{-- Save/Cancel (sichtbar auf allen Form-Tabs, nicht auf Wartung) --}}
<div x-show="tab !== 'categories' && tab !== 'maintenance'" class="flex gap-3 mt-6">
{{-- Save/Cancel (sichtbar auf allen Form-Tabs) --}}
<div x-show="tab !== 'categories'" class="flex gap-3 mt-6">
<button type="submit" class="bg-blue-600 text-white px-6 py-2 rounded-md hover:bg-blue-700 font-medium">
{{ __('ui.save') }}
</button>
@@ -685,118 +394,6 @@
</div>
</form>
{{-- Registration (außerhalb der Settings-Form, nur auf Lizenz-Tab) --}}
@if (auth()->user()->isAdmin() && !$isRegistered)
<div x-show="tab === 'license'" class="mt-6">
<div class="bg-white rounded-lg shadow p-6">
<p class="text-sm text-gray-600 mb-3">{{ __('admin.support_not_registered') }}</p>
<form method="POST" action="{{ route('admin.support.register') }}">
@csrf
<button type="submit" class="bg-green-600 text-white px-4 py-2 rounded-md text-sm hover:bg-green-700">
{{ __('admin.register_now') }}
</button>
</form>
</div>
</div>
@endif
{{-- Tab: Wartung (nur Admin, eigenes Formular) --}}
@if (auth()->user()->isAdmin())
<div x-show="tab === 'maintenance'" role="tabpanel">
<div class="bg-white rounded-lg shadow p-6">
<h2 class="text-lg font-semibold text-gray-900 mb-4">{{ __('admin.demo_data_delete_title') }}</h2>
<p class="text-sm text-gray-600 mb-4">{{ __('admin.demo_data_delete_description') }}</p>
<div class="grid sm:grid-cols-2 gap-4 mb-5">
<div class="border border-red-200 bg-red-50 rounded-md p-4">
<h3 class="text-sm font-semibold text-red-700 mb-2">{{ __('admin.demo_data_deletes') }}</h3>
<ul class="text-sm text-red-600 space-y-1 list-disc list-inside">
<li>{{ __('admin.stat_users') }} ({{ __('admin.demo_data_except_admin') }})</li>
<li>{{ __('admin.nav_teams') }}</li>
<li>{{ __('admin.nav_players') }}</li>
<li>{{ __('admin.nav_events') }}</li>
<li>Kommentare</li>
<li>{{ __('admin.nav_locations') }}</li>
<li>{{ __('admin.nav_files') }}</li>
<li>{{ __('admin.activity_log_title') }}</li>
</ul>
</div>
<div class="border border-green-200 bg-green-50 rounded-md p-4">
<h3 class="text-sm font-semibold text-green-700 mb-2">{{ __('admin.demo_data_keeps') }}</h3>
<ul class="text-sm text-green-600 space-y-1 list-disc list-inside">
<li>{{ __('admin.demo_data_keeps_admin') }}</li>
<li>{{ __('admin.nav_settings') }}</li>
<li>{{ __('admin.settings_tab_categories') }}</li>
</ul>
</div>
</div>
<div class="border border-red-300 bg-red-50 rounded-md p-4 mb-5">
<p class="text-sm text-red-700 font-medium">{{ __('admin.demo_data_delete_warning') }}</p>
</div>
<form method="POST" action="{{ route('admin.settings.destroy-demo-data') }}"
onsubmit="return confirm(@js(__('admin.demo_data_delete_confirm')))">
@csrf
@method('DELETE')
<div class="mb-4">
<label for="demo-delete-password" class="block text-sm font-medium text-gray-700 mb-1">{{ __('admin.factory_reset_password_label') }}</label>
<input type="password" name="password" id="demo-delete-password" required autocomplete="current-password"
class="w-full max-w-sm px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-red-500 focus:border-red-500">
</div>
<button type="submit"
class="px-5 py-2.5 text-sm font-medium text-white bg-red-600 rounded-md hover:bg-red-700 transition">
{{ __('admin.demo_data_delete_button') }}
</button>
</form>
</div>
{{-- Factory Reset (nur Admin) --}}
@if (auth()->user()->isAdmin())
<div class="bg-white rounded-lg shadow p-6 mt-6 border-2 border-red-300">
<h2 class="text-lg font-semibold text-red-700 mb-4">{{ __('admin.factory_reset_title') }}</h2>
<p class="text-sm text-gray-600 mb-4">{{ __('admin.factory_reset_description') }}</p>
<div class="border border-red-200 bg-red-50 rounded-md p-4 mb-5">
<h3 class="text-sm font-semibold text-red-700 mb-2">{{ __('admin.factory_reset_deletes') }}</h3>
<ul class="text-sm text-red-600 space-y-1 list-disc list-inside">
<li>{{ __('admin.factory_reset_item_users') }}</li>
<li>{{ __('admin.factory_reset_item_data') }}</li>
<li>{{ __('admin.factory_reset_item_settings') }}</li>
<li>{{ __('admin.factory_reset_item_files') }}</li>
</ul>
</div>
<div class="bg-red-100 border border-red-300 rounded-md p-4 mb-5">
<p class="text-sm text-red-800 font-bold">{{ __('admin.factory_reset_warning') }}</p>
</div>
<form method="POST" action="{{ route('admin.settings.factory-reset') }}"
onsubmit="return confirm(@js(__('admin.factory_reset_confirm')))">
@csrf
@method('DELETE')
<div class="mb-4">
<label for="factory-reset-password" class="block text-sm font-medium text-gray-700 mb-1">{{ __('admin.factory_reset_password_label') }}</label>
<input type="password" name="password" id="factory-reset-password" required autocomplete="current-password"
class="w-full max-w-sm px-3 py-2 border border-gray-300 rounded-md text-sm focus:ring-2 focus:ring-red-500 focus:border-red-500">
</div>
<div class="mb-5">
<label for="factory-reset-confirmation" class="block text-sm font-medium text-gray-700 mb-1">{{ __('admin.factory_reset_confirmation_label') }}</label>
<input type="text" name="confirmation" id="factory-reset-confirmation" required
placeholder="RESET-BEST&Auml;TIGT"
class="w-full max-w-sm px-3 py-2 border border-gray-300 rounded-md text-sm font-mono focus:ring-2 focus:ring-red-500 focus:border-red-500">
<p class="mt-1 text-xs text-gray-500">{{ __('admin.factory_reset_confirmation_hint') }}</p>
</div>
<button type="submit"
class="px-5 py-2.5 text-sm font-medium text-white bg-red-700 rounded-md hover:bg-red-800 transition">
{{ __('admin.factory_reset_button') }}
</button>
</form>
</div>
@endif
</div>
@endif
{{-- Tab: Dateikategorien (eigene Formulare) --}}
<div x-show="tab === 'categories'" role="tabpanel">
<div class="bg-white rounded-lg shadow p-6">
@@ -875,7 +472,7 @@
],
init() {
const validTabs = ['general', 'mail', 'legal', 'defaults', 'categories', 'seasons', 'visibility', 'license', 'maintenance'];
const validTabs = ['general', 'legal', 'defaults', 'categories', 'seasons'];
const urlTab = new URLSearchParams(window.location.search).get('tab');
const hash = window.location.hash.replace('#', '');
const stored = sessionStorage.getItem('settings_tab');