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:
@@ -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Ä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');
|
||||
|
||||
Reference in New Issue
Block a user