- Fix: Notifiable-Trait zum User-Model hinzugefuegt (behebt notify()-500er) - Installer: SMTP-Verbindungstest mit EsmtpTransport + Ueberspringen-Link - Admin: Neuer E-Mail-Tab mit SMTP-Konfiguration + Verbindungstest - Admin: Lazy Quill-Initialisierung (nur sichtbare Locale wird geladen) - Uebersetzungen: 17 neue Mail-Keys in allen 6 Sprachen Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
199 lines
13 KiB
PHP
Executable File
199 lines
13 KiB
PHP
Executable File
<x-layouts.admin :title="__('admin.dashboard_title')">
|
|
<h1 class="text-2xl font-bold mb-6">{{ __('admin.dashboard_title') }}</h1>
|
|
|
|
{{-- Update-Hinweis --}}
|
|
@if ($hasUpdate ?? false)
|
|
<div class="mb-6 p-4 bg-blue-50 border border-blue-200 rounded-lg flex items-center gap-3">
|
|
<svg class="w-6 h-6 text-blue-600 flex-shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
|
</svg>
|
|
<div>
|
|
<p class="text-sm font-medium text-blue-800">{{ __('admin.update_available', ['version' => $updateVersion]) }}</p>
|
|
<a href="{{ route('admin.settings.edit') }}#license" class="text-xs text-blue-600 underline">{{ __('admin.update_details') }}</a>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
|
|
{{-- Statistik-Karten --}}
|
|
<div class="grid grid-cols-2 lg:grid-cols-4 gap-4 mb-8">
|
|
<div class="bg-white rounded-lg shadow p-4">
|
|
<p class="text-sm text-gray-500">{{ __('admin.stat_users') }}</p>
|
|
<p class="text-2xl font-bold text-gray-900">{{ $stats['users'] }}</p>
|
|
</div>
|
|
<div class="bg-white rounded-lg shadow p-4">
|
|
<p class="text-sm text-gray-500">{{ __('admin.stat_players') }}</p>
|
|
<p class="text-2xl font-bold text-gray-900">{{ $stats['players'] }}</p>
|
|
</div>
|
|
<div class="bg-white rounded-lg shadow p-4">
|
|
<p class="text-sm text-gray-500">{{ __('admin.stat_upcoming') }}</p>
|
|
<p class="text-2xl font-bold text-gray-900">{{ $stats['upcoming_events'] }}</p>
|
|
</div>
|
|
<div class="bg-white rounded-lg shadow p-4">
|
|
<p class="text-sm text-gray-500">{{ __('admin.stat_invitations') }}</p>
|
|
<p class="text-2xl font-bold text-gray-900">{{ $stats['open_invitations'] }}</p>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- DSGVO — Bestätigung ausstehend --}}
|
|
@if ($pendingDsgvoUsers->isNotEmpty())
|
|
<div class="bg-orange-50 border border-orange-200 rounded-lg shadow p-6 mb-8" x-data="{ openModal: null }">
|
|
<div class="flex items-center gap-2 mb-4">
|
|
<svg class="w-5 h-5 text-orange-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.072 16.5c-.77.833.192 2.5 1.732 2.5z"/>
|
|
</svg>
|
|
<h2 class="text-lg font-semibold text-orange-800">{{ __('admin.dsgvo_pending_title') }}</h2>
|
|
<span class="bg-orange-200 text-orange-800 text-xs font-medium rounded-full px-2 py-0.5">{{ __('admin.dsgvo_pending_count', ['count' => $pendingDsgvoUsers->count()]) }}</span>
|
|
</div>
|
|
<div class="divide-y divide-orange-100">
|
|
@foreach ($pendingDsgvoUsers as $dsgvoUser)
|
|
<div class="py-3 flex items-center justify-between gap-2 flex-wrap">
|
|
<div class="flex items-center gap-3">
|
|
<img src="{{ $dsgvoUser->getAvatarUrl() ?? asset('images/profil_empty.png') }}" alt="" class="w-8 h-8 rounded-full object-cover flex-shrink-0">
|
|
<div>
|
|
<span class="text-sm font-medium text-gray-900">{{ $dsgvoUser->name }}</span>
|
|
<span class="text-xs text-gray-500 block">{{ $dsgvoUser->email }}</span>
|
|
</div>
|
|
</div>
|
|
<button @click="openModal = {{ $dsgvoUser->id }}"
|
|
class="bg-blue-600 text-white text-xs px-3 py-1.5 rounded-md hover:bg-blue-700 transition-colors">
|
|
{{ __('admin.dsgvo_view_document') }}
|
|
</button>
|
|
</div>
|
|
|
|
{{-- Modal für Dokument-Ansicht + Bestätigung/Ablehnung --}}
|
|
<template x-teleport="body">
|
|
<div x-show="openModal === {{ $dsgvoUser->id }}" x-cloak
|
|
class="fixed inset-0 z-50 flex items-center justify-center p-4"
|
|
@keydown.escape.window="openModal = null">
|
|
<div class="fixed inset-0 bg-black/50" @click="openModal = null"></div>
|
|
<div class="relative bg-white rounded-lg shadow-xl w-full max-w-2xl max-h-[90vh] flex flex-col z-10">
|
|
{{-- Modal Header --}}
|
|
<div class="flex items-center justify-between p-4 border-b">
|
|
<div>
|
|
<h3 class="text-lg font-semibold text-gray-900">{{ __('admin.dsgvo_consent_document') }}</h3>
|
|
<p class="text-sm text-gray-500">{{ $dsgvoUser->name }} ({{ $dsgvoUser->email }})</p>
|
|
</div>
|
|
<button @click="openModal = null" class="text-gray-400 hover:text-gray-600">
|
|
<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="M6 18L18 6M6 6l12 12"/></svg>
|
|
</button>
|
|
</div>
|
|
|
|
{{-- Modal Body: Dokument-Vorschau --}}
|
|
<div class="flex-1 overflow-auto p-4">
|
|
@php
|
|
$filePath = $dsgvoUser->dsgvo_consent_file;
|
|
$ext = strtolower(pathinfo($filePath, PATHINFO_EXTENSION));
|
|
@endphp
|
|
@if (in_array($ext, ['jpg', 'jpeg', 'png', 'gif', 'webp']))
|
|
<img src="{{ route('admin.users.view-dsgvo-consent', $dsgvoUser) }}" alt="DSGVO Consent" class="max-w-full rounded-lg mx-auto">
|
|
@elseif ($ext === 'pdf')
|
|
<iframe src="{{ route('admin.users.view-dsgvo-consent', $dsgvoUser) }}" class="w-full h-96 rounded-lg border"></iframe>
|
|
@else
|
|
<p class="text-sm text-gray-500 text-center py-8">{{ __('admin.dsgvo_preview_not_available') }}</p>
|
|
@endif
|
|
</div>
|
|
|
|
{{-- Modal Footer: Aktionen --}}
|
|
<div class="flex items-center justify-end gap-3 p-4 border-t bg-gray-50 rounded-b-lg">
|
|
<form method="POST" action="{{ route('admin.users.dsgvo-reject', $dsgvoUser) }}"
|
|
onsubmit="return confirm(@js(__('admin.dsgvo_reject_confirm')))">
|
|
@csrf
|
|
@method('PUT')
|
|
<button type="submit" class="bg-red-600 text-white text-sm px-4 py-2 rounded-md hover:bg-red-700 transition-colors">
|
|
{{ __('admin.dsgvo_reject') }}
|
|
</button>
|
|
</form>
|
|
<form method="POST" action="{{ route('admin.users.dsgvo-toggle', $dsgvoUser) }}">
|
|
@csrf
|
|
@method('PUT')
|
|
<button type="submit" class="bg-green-600 text-white text-sm px-4 py-2 rounded-md hover:bg-green-700 transition-colors">
|
|
{{ __('admin.dsgvo_confirm') }}
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
@endif
|
|
|
|
{{-- Quick-Links --}}
|
|
<div class="bg-white rounded-lg shadow p-6 mb-8">
|
|
<h2 class="text-lg font-semibold mb-3">{{ __('admin.quick_links') }}</h2>
|
|
<div class="flex flex-wrap gap-3">
|
|
<a href="{{ route('admin.events.create') }}" class="bg-blue-600 text-white px-4 py-2 rounded text-sm hover:bg-blue-700">{{ __('admin.new_event') }}</a>
|
|
<a href="{{ route('admin.players.create') }}" class="bg-green-600 text-white px-4 py-2 rounded text-sm hover:bg-green-700">{{ __('admin.new_player') }}</a>
|
|
<a href="{{ route('admin.invitations.create') }}" class="bg-purple-600 text-white px-4 py-2 rounded text-sm hover:bg-purple-700">{{ __('admin.new_invitation') }}</a>
|
|
<a href="{{ route('admin.teams.create') }}" class="bg-gray-600 text-white px-4 py-2 rounded text-sm hover:bg-gray-700">{{ __('admin.new_team') }}</a>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- Events mit offenen Rückmeldungen --}}
|
|
@if ($eventsWithOpenResponses->isNotEmpty())
|
|
<div class="bg-white rounded-lg shadow p-6">
|
|
<h2 class="text-lg font-semibold mb-3">{{ __('admin.open_responses_title') }}</h2>
|
|
<div class="divide-y divide-gray-100">
|
|
@foreach ($eventsWithOpenResponses as $event)
|
|
<div class="py-3 flex items-center justify-between">
|
|
<div>
|
|
<a href="{{ route('admin.events.edit', $event) }}" class="text-sm font-medium text-blue-600 hover:underline">{{ $event->title }}</a>
|
|
<p class="text-xs text-gray-500">{{ $event->team->name }} — {{ $event->start_at->translatedFormat(__('ui.date_format')) }}</p>
|
|
</div>
|
|
<span class="text-sm text-orange-600 font-medium">{{ __('admin.x_open', ['count' => $event->open_count]) }}</span>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
@endif
|
|
|
|
{{-- DSGVO-Ereignisse --}}
|
|
@if ($dsgvoEvents->isNotEmpty())
|
|
<div class="bg-white rounded-lg shadow p-6 mt-8">
|
|
<h2 class="text-lg font-semibold mb-3">{{ __('admin.dsgvo_events_title') }}</h2>
|
|
<div class="overflow-x-auto">
|
|
<table class="w-full text-sm">
|
|
<thead class="bg-gray-50 border-b">
|
|
<tr>
|
|
<th class="text-left px-4 py-2 font-medium text-gray-700 text-xs">{{ __('admin.log_time') }}</th>
|
|
<th class="text-left px-4 py-2 font-medium text-gray-700 text-xs">{{ __('admin.log_user') }}</th>
|
|
<th class="text-center px-4 py-2 font-medium text-gray-700 text-xs">{{ __('admin.log_action') }}</th>
|
|
<th class="text-left px-4 py-2 font-medium text-gray-700 text-xs">{{ __('admin.log_description') }}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-gray-100">
|
|
@foreach ($dsgvoEvents as $logEntry)
|
|
@php
|
|
$dsgvoColors = [
|
|
'dsgvo_consent_uploaded' => 'bg-blue-100 text-blue-800',
|
|
'dsgvo_consent_confirmed' => 'bg-green-100 text-green-800',
|
|
'dsgvo_consent_revoked' => 'bg-yellow-100 text-yellow-800',
|
|
'dsgvo_consent_removed' => 'bg-orange-100 text-orange-800',
|
|
'dsgvo_consent_rejected' => 'bg-red-100 text-red-800',
|
|
'account_self_deleted' => 'bg-red-100 text-red-800',
|
|
'child_auto_deactivated' => 'bg-red-100 text-red-800',
|
|
];
|
|
@endphp
|
|
<tr class="hover:bg-gray-50">
|
|
<td class="px-4 py-2 text-xs text-gray-500 whitespace-nowrap">
|
|
{{ $logEntry->created_at->translatedFormat(__('ui.date_format_short')) }}
|
|
</td>
|
|
<td class="px-4 py-2 text-xs text-gray-900">
|
|
{{ $logEntry->user?->name ?? __('admin.log_system') }}
|
|
</td>
|
|
<td class="px-4 py-2 text-center">
|
|
<span class="inline-block px-2 py-0.5 rounded-full text-xs font-medium {{ $dsgvoColors[$logEntry->action] ?? 'bg-gray-100 text-gray-800' }}">
|
|
{{ __('admin.dsgvo_action_' . $logEntry->action) }}
|
|
</span>
|
|
</td>
|
|
<td class="px-4 py-2 text-xs text-gray-600">{{ $logEntry->description }}</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
</x-layouts.admin>
|