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:
558
resources/views/admin/administration/index.blade.php
Normal file
558
resources/views/admin/administration/index.blade.php
Normal 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Ä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') }} →
|
||||
</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>
|
||||
Reference in New Issue
Block a user