Stand: SMTP-Test, Admin-Mail-Tab, Notifiable-Fix, Lazy-Quill
- 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>
This commit is contained in:
78
resources/views/components/event-status-boxes.blade.php
Executable file
78
resources/views/components/event-status-boxes.blade.php
Executable file
@@ -0,0 +1,78 @@
|
||||
@props(['event'])
|
||||
|
||||
@php
|
||||
use App\Enums\ParticipantStatus;
|
||||
use App\Enums\CateringStatus;
|
||||
use App\Enums\EventType;
|
||||
|
||||
$isMeeting = $event->type === EventType::Meeting;
|
||||
$yesCount = $event->participants->where('status', ParticipantStatus::Yes)->count();
|
||||
$noCount = $event->participants->where('status', ParticipantStatus::No)->count();
|
||||
$openCount = $event->participants->where('status', ParticipantStatus::Unknown)->count();
|
||||
|
||||
// withCount-Attribute nutzen wenn vorhanden (Index-Views), sonst Collection filtern (Show-View)
|
||||
$hasCatering = $event->type->hasCatering();
|
||||
$hasTimekeepers = $event->type->hasTimekeepers();
|
||||
$cateringYes = $hasCatering ? ($event->caterings_yes_count ?? $event->caterings->where('status', CateringStatus::Yes)->count()) : 0;
|
||||
$timekeeperYes = $hasTimekeepers ? ($event->timekeepers_yes_count ?? $event->timekeepers->where('status', CateringStatus::Yes)->count()) : 0;
|
||||
|
||||
// Individual minimum status
|
||||
if ($event->min_players !== null) {
|
||||
$playersMet = $yesCount >= $event->min_players;
|
||||
} else {
|
||||
$playersMet = null;
|
||||
}
|
||||
|
||||
$cateringMet = ($hasCatering && $event->min_catering !== null) ? $cateringYes >= $event->min_catering : null;
|
||||
$timekeepersMet = ($hasTimekeepers && $event->min_timekeepers !== null) ? $timekeeperYes >= $event->min_timekeepers : null;
|
||||
|
||||
// Box size classes
|
||||
$boxClass = 'inline-flex items-center justify-center w-9 h-9 rounded text-sm font-bold';
|
||||
$participantsLabel = $isMeeting ? __('admin.nav_users') : __('admin.nav_players');
|
||||
@endphp
|
||||
|
||||
<div class="flex items-start gap-4 sm:gap-6">
|
||||
{{-- Spieler / Benutzer --}}
|
||||
<div class="text-center">
|
||||
<div class="text-[10px] font-semibold text-gray-500 uppercase tracking-wide mb-1">{{ $participantsLabel }}</div>
|
||||
<div class="flex gap-0.5">
|
||||
@if ($playersMet === true)
|
||||
<span class="{{ $boxClass }} bg-green-500 text-white">{{ $yesCount }}</span>
|
||||
<span class="{{ $boxClass }} bg-green-500 text-white">{{ $noCount }}</span>
|
||||
<span class="{{ $boxClass }} bg-green-500 text-white">{{ $openCount }}</span>
|
||||
@else
|
||||
<span class="{{ $boxClass }} bg-green-500 text-white">{{ $yesCount }}</span>
|
||||
<span class="{{ $boxClass }} bg-red-500 text-white">{{ $noCount }}</span>
|
||||
<span class="{{ $boxClass }} bg-gray-300 text-gray-700">{{ $openCount }}</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($hasCatering)
|
||||
{{-- Catering --}}
|
||||
<div class="text-center">
|
||||
<div class="text-[10px] font-semibold text-gray-500 uppercase tracking-wide mb-1">{{ __('events.catering_short') }}</div>
|
||||
@if ($cateringMet === true)
|
||||
<span class="{{ $boxClass }} bg-green-500 text-white">{{ $cateringYes }}</span>
|
||||
@elseif ($cateringMet === false)
|
||||
<span class="{{ $boxClass }} bg-red-500 text-white">{{ $cateringYes }}</span>
|
||||
@else
|
||||
<span class="{{ $boxClass }} bg-gray-200 text-gray-600">{{ $cateringYes }}</span>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($hasTimekeepers)
|
||||
{{-- Zeitnehmer --}}
|
||||
<div class="text-center">
|
||||
<div class="text-[10px] font-semibold text-gray-500 uppercase tracking-wide mb-1">{{ __('events.timekeeper_short') }}</div>
|
||||
@if ($timekeepersMet === true)
|
||||
<span class="{{ $boxClass }} bg-green-500 text-white">{{ $timekeeperYes }}</span>
|
||||
@elseif ($timekeepersMet === false)
|
||||
<span class="{{ $boxClass }} bg-red-500 text-white">{{ $timekeeperYes }}</span>
|
||||
@else
|
||||
<span class="{{ $boxClass }} bg-gray-200 text-gray-600">{{ $timekeeperYes }}</span>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
18
resources/views/components/event-type-badge.blade.php
Executable file
18
resources/views/components/event-type-badge.blade.php
Executable file
@@ -0,0 +1,18 @@
|
||||
@props(['type'])
|
||||
|
||||
@php
|
||||
$colors = match($type->value ?? $type) {
|
||||
'home_game' => 'bg-blue-100 text-blue-800',
|
||||
'away_game' => 'bg-indigo-100 text-indigo-800',
|
||||
'training' => 'bg-green-100 text-green-800',
|
||||
'tournament' => 'bg-purple-100 text-purple-800',
|
||||
'meeting' => 'bg-yellow-100 text-yellow-800',
|
||||
'other' => 'bg-gray-100 text-gray-800',
|
||||
default => 'bg-gray-100 text-gray-800',
|
||||
};
|
||||
$label = method_exists($type, 'label') ? $type->label() : $type;
|
||||
@endphp
|
||||
|
||||
<span class="inline-block px-2 py-0.5 rounded text-xs font-medium {{ $colors }}">
|
||||
{{ $label }}
|
||||
</span>
|
||||
109
resources/views/components/file-preview-modal.blade.php
Normal file
109
resources/views/components/file-preview-modal.blade.php
Normal file
@@ -0,0 +1,109 @@
|
||||
{{-- File Preview Modal (Alpine.js) --}}
|
||||
<div x-data="filePreviewModal()" x-cloak @open-file-preview.window="openFile($event.detail)" @keydown.escape.window="close()">
|
||||
{{-- Backdrop --}}
|
||||
<div x-show="open"
|
||||
x-transition:enter="transition ease-out duration-200"
|
||||
x-transition:enter-start="opacity-0"
|
||||
x-transition:enter-end="opacity-100"
|
||||
x-transition:leave="transition ease-in duration-150"
|
||||
x-transition:leave-start="opacity-100"
|
||||
x-transition:leave-end="opacity-0"
|
||||
@click="close()"
|
||||
class="fixed inset-0 bg-black/60 z-40"></div>
|
||||
|
||||
{{-- Modal --}}
|
||||
<div x-show="open"
|
||||
x-transition:enter="transition ease-out duration-200"
|
||||
x-transition:enter-start="opacity-0 scale-95"
|
||||
x-transition:enter-end="opacity-100 scale-100"
|
||||
x-transition:leave="transition ease-in duration-150"
|
||||
x-transition:leave-start="opacity-100 scale-100"
|
||||
x-transition:leave-end="opacity-0 scale-95"
|
||||
class="fixed inset-0 flex items-center justify-center z-50 p-4 sm:p-6">
|
||||
<div @click.away="close()"
|
||||
class="bg-white rounded-xl shadow-2xl flex flex-col overflow-hidden"
|
||||
:class="(file.isPdf || file.isHtml) ? 'w-full max-w-3xl max-h-[92vh]' : 'w-full max-w-lg max-h-[90vh]'">
|
||||
|
||||
{{-- Header --}}
|
||||
<div class="flex items-center justify-between px-5 py-3 border-b min-w-0">
|
||||
<h3 class="font-semibold text-gray-900 truncate pr-4" x-text="file.name"></h3>
|
||||
<button @click="close()" class="flex-shrink-0 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>
|
||||
|
||||
{{-- Content --}}
|
||||
<div class="flex-1 overflow-y-auto p-5" :class="(file.isPdf || file.isHtml) ? 'p-0' : 'p-5'">
|
||||
{{-- Image Preview --}}
|
||||
<template x-if="file.isImage && file.previewUrl">
|
||||
<div class="flex justify-center mb-4 bg-gray-50 rounded-lg p-2 mx-5 mt-5">
|
||||
<img :src="file.previewUrl" :alt="file.name" class="max-w-full max-h-80 rounded object-contain" loading="lazy">
|
||||
</div>
|
||||
</template>
|
||||
|
||||
{{-- PDF Preview --}}
|
||||
<template x-if="file.isPdf && file.previewUrl">
|
||||
<iframe :src="file.previewUrl" class="w-full border-0" style="height: 70vh;"></iframe>
|
||||
</template>
|
||||
|
||||
{{-- HTML Preview --}}
|
||||
<template x-if="file.isHtml && file.previewUrl">
|
||||
<iframe :src="file.previewUrl" class="w-full border-0" style="height: 70vh;"></iframe>
|
||||
</template>
|
||||
|
||||
{{-- Non-Image/Non-PDF/Non-HTML: Large Icon --}}
|
||||
<template x-if="!file.isImage && !file.isPdf && !file.isHtml">
|
||||
<div class="flex justify-center mb-4 mx-5 mt-5">
|
||||
<div class="w-20 h-20 rounded-xl flex items-center justify-center" :class="file.iconBg">
|
||||
<svg class="w-10 h-10" fill="currentColor" viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 2l5 5h-5V4z"/></svg>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
{{-- File Info (nicht bei PDF/HTML, da dort der iframe den Platz braucht) --}}
|
||||
<template x-if="!file.isPdf && !file.isHtml">
|
||||
<div class="space-y-2 text-center px-5 pb-2">
|
||||
<div>
|
||||
<span class="inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-700" x-text="file.category"></span>
|
||||
</div>
|
||||
<p class="text-sm text-gray-500" x-text="file.size"></p>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
{{-- Footer --}}
|
||||
<div class="px-5 py-3 border-t bg-gray-50 flex justify-between items-center">
|
||||
<div class="flex items-center gap-3">
|
||||
<button @click="close()" class="text-sm text-gray-500 hover:text-gray-700">{{ __('ui.close') }}</button>
|
||||
<template x-if="file.isPdf || file.isHtml">
|
||||
<span class="text-xs text-gray-400">
|
||||
<span x-text="file.category"></span> · <span x-text="file.size"></span>
|
||||
</span>
|
||||
</template>
|
||||
</div>
|
||||
<a :href="file.downloadUrl" class="inline-flex items-center gap-1.5 bg-blue-600 text-white px-4 py-2 rounded-md text-sm hover:bg-blue-700">
|
||||
<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/></svg>
|
||||
{{ __('ui.download') }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function filePreviewModal() {
|
||||
return {
|
||||
open: false,
|
||||
file: { name: '', category: '', size: '', downloadUrl: '', previewUrl: null, isImage: false, isPdf: false, isHtml: false, iconBg: '' },
|
||||
openFile(detail) {
|
||||
this.file = detail;
|
||||
this.open = true;
|
||||
document.body.style.overflow = 'hidden';
|
||||
},
|
||||
close() {
|
||||
this.open = false;
|
||||
document.body.style.overflow = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
17
resources/views/components/flash-message.blade.php
Executable file
17
resources/views/components/flash-message.blade.php
Executable file
@@ -0,0 +1,17 @@
|
||||
@props(['type' => 'success', 'message'])
|
||||
|
||||
@php
|
||||
$classes = match($type) {
|
||||
'success' => 'bg-green-50 border-green-400 text-green-800',
|
||||
'error' => 'bg-red-50 border-red-400 text-red-800',
|
||||
'warning' => 'bg-yellow-50 border-yellow-400 text-yellow-800',
|
||||
default => 'bg-blue-50 border-blue-400 text-blue-800',
|
||||
};
|
||||
@endphp
|
||||
|
||||
<div class="mb-4 p-3 border-l-4 rounded {{ $classes }}" x-data="{ show: true }" x-show="show">
|
||||
<div class="flex justify-between items-center">
|
||||
<p class="text-sm">{{ $message }}</p>
|
||||
<button @click="show = false" class="ml-4 text-lg leading-none opacity-50 hover:opacity-100">×</button>
|
||||
</div>
|
||||
</div>
|
||||
160
resources/views/components/layouts/admin.blade.php
Executable file
160
resources/views/components/layouts/admin.blade.php
Executable file
@@ -0,0 +1,160 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ app()->getLocale() }}" dir="{{ app()->getLocale() === 'ar' ? 'rtl' : 'ltr' }}">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
<title>{{ __('ui.admin') }} - {{ $title ?? \App\Models\Setting::get('app_name', config('app.name')) }}</title>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.14.9/dist/cdn.min.js" integrity="sha384-9Ax3MmS9AClxJyd5/zafcXXjxmwFhZCdsT6HJoJjarvCaAkJlk5QDzjLJm+Wdx5F" crossorigin="anonymous"></script>
|
||||
@php $favicon = \App\Models\Setting::get('app_favicon'); @endphp
|
||||
@if ($favicon)
|
||||
<link rel="icon" href="{{ asset('storage/' . $favicon) }}">
|
||||
@else
|
||||
<link rel="icon" href="{{ asset('favicon.ico') }}">
|
||||
@endif
|
||||
{{-- PWA --}}
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
<meta name="theme-color" content="#1f2937">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||
<meta name="apple-mobile-web-app-title" content="SG Wölfe">
|
||||
<link rel="apple-touch-icon" href="/images/apple-touch-icon.png">
|
||||
@stack('styles')
|
||||
</head>
|
||||
<body class="min-h-screen bg-gray-100 flex flex-col">
|
||||
{{-- Admin Navigation --}}
|
||||
<nav class="bg-gray-800 text-white" x-data="{ open: false, mgmt: false }">
|
||||
<div class="max-w-6xl mx-auto px-4">
|
||||
<div class="flex justify-between h-14">
|
||||
<div class="flex items-center space-x-6 rtl:space-x-reverse">
|
||||
<a href="{{ route('admin.dashboard') }}" class="flex items-center gap-2 font-bold">
|
||||
<img src="/images/logo_woelfe.png" alt="Logo" class="h-8 w-8 object-contain">
|
||||
{{ __('ui.admin') }}
|
||||
</a>
|
||||
{{-- Desktop nav links (ab lg sichtbar) --}}
|
||||
<div class="hidden lg:flex items-center space-x-5 rtl:space-x-reverse">
|
||||
<a href="{{ route('admin.events.index') }}" class="text-sm text-gray-300 hover:text-white {{ request()->routeIs('admin.events.*') ? 'text-white font-semibold' : '' }}">{{ __('admin.nav_events') }}</a>
|
||||
@if (\App\Models\Setting::isFeatureVisibleFor('statistics', auth()->user()))
|
||||
<a href="{{ route('admin.statistics.index') }}" class="text-sm text-gray-300 hover:text-white {{ request()->routeIs('admin.statistics.*') ? 'text-white font-semibold' : '' }}">{{ __('admin.nav_statistics') }}</a>
|
||||
@endif
|
||||
@if (auth()->user()->isStaff())
|
||||
<a href="{{ route('admin.teams.index') }}" class="text-sm text-gray-300 hover:text-white {{ request()->routeIs('admin.teams.*') ? 'text-white font-semibold' : '' }}">{{ __('admin.nav_teams') }}</a>
|
||||
<a href="{{ route('admin.players.index') }}" class="text-sm text-gray-300 hover:text-white {{ request()->routeIs('admin.players.*') ? 'text-white font-semibold' : '' }}">{{ __('admin.nav_players') }}</a>
|
||||
<a href="{{ route('admin.users.index') }}" class="text-sm text-gray-300 hover:text-white {{ request()->routeIs('admin.users.*') ? 'text-white font-semibold' : '' }}">{{ __('admin.nav_users') }}</a>
|
||||
@endif
|
||||
<a href="{{ route('admin.files.index') }}" class="text-sm text-gray-300 hover:text-white {{ request()->routeIs('admin.files.*') ? 'text-white font-semibold' : '' }}">{{ __('admin.nav_files') }}</a>
|
||||
@if (auth()->user()->isStaff())
|
||||
<a href="{{ route('admin.locations.index') }}" class="text-sm text-gray-300 hover:text-white {{ request()->routeIs('admin.locations.*') ? 'text-white font-semibold' : '' }}">{{ __('admin.nav_locations') }}</a>
|
||||
{{-- Verwaltung-Dropdown --}}
|
||||
<div class="relative" @click.away="mgmt = false">
|
||||
<button @click="mgmt = !mgmt" class="text-sm text-gray-300 hover:text-white flex items-center gap-1 {{ request()->routeIs('admin.settings.*') || request()->routeIs('admin.invitations.*') || request()->routeIs('admin.activity-logs.*') || request()->routeIs('admin.support.*') ? 'text-white font-semibold' : '' }}">
|
||||
{{ __('admin.nav_verwaltung') }}
|
||||
@if (\Illuminate\Support\Facades\Cache::has('support.update_check'))
|
||||
<span class="w-2 h-2 bg-blue-400 rounded-full"></span>
|
||||
@endif
|
||||
<svg class="w-3 h-3 transition-transform" :class="mgmt ? 'rotate-180' : ''" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"/></svg>
|
||||
</button>
|
||||
<div x-show="mgmt" x-cloak x-transition class="absolute left-0 rtl:left-auto rtl:right-0 mt-2 w-48 bg-gray-700 rounded-md shadow-lg py-1 z-50">
|
||||
<a href="{{ route('admin.settings.edit') }}" class="block px-4 py-2 text-sm text-gray-200 hover:bg-gray-600 {{ request()->routeIs('admin.settings.*') ? 'bg-gray-600 font-semibold' : '' }}">{{ __('admin.nav_settings') }}</a>
|
||||
<a href="{{ route('admin.invitations.index') }}" class="block px-4 py-2 text-sm text-gray-200 hover:bg-gray-600 {{ request()->routeIs('admin.invitations.*') ? 'bg-gray-600 font-semibold' : '' }}">{{ __('admin.nav_invitations') }}</a>
|
||||
<a href="{{ route('admin.list-generator.create') }}" class="block px-4 py-2 text-sm text-gray-200 hover:bg-gray-600 {{ request()->routeIs('admin.list-generator.*') ? 'bg-gray-600 font-semibold' : '' }}">{{ __('admin.nav_list_generator') }}</a>
|
||||
<a href="{{ route('admin.support.index') }}" class="block px-4 py-2 text-sm text-gray-200 hover:bg-gray-600 {{ request()->routeIs('admin.support.*') ? 'bg-gray-600 font-semibold' : '' }}">{{ __('admin.nav_support') }}</a>
|
||||
@if (auth()->user()->canViewActivityLog())
|
||||
<a href="{{ route('admin.activity-logs.index') }}" class="block px-4 py-2 text-sm text-gray-200 hover:bg-gray-600 {{ request()->routeIs('admin.activity-logs.*') ? 'bg-gray-600 font-semibold' : '' }}">{{ __('admin.nav_activity_log') }}</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Mobile/Tablet menu button --}}
|
||||
<div class="flex items-center lg:hidden">
|
||||
<button @click="open = !open" class="text-gray-300 hover:text-white">
|
||||
<svg class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path x-show="!open" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"/>
|
||||
<path x-show="open" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="hidden lg:flex items-center space-x-4 rtl:space-x-reverse">
|
||||
<a href="{{ route('dashboard') }}" class="flex items-center gap-2 text-sm text-gray-300 hover:text-white">
|
||||
@if (auth()->user()->getAvatarUrl())
|
||||
<img src="{{ auth()->user()->getAvatarUrl() }}" alt="{{ auth()->user()->name }}" class="w-7 h-7 rounded-full object-cover border border-gray-600">
|
||||
@else
|
||||
<div class="w-7 h-7 rounded-full bg-gray-600 flex items-center justify-center text-gray-200 text-xs font-semibold">
|
||||
{{ auth()->user()->getInitials() }}
|
||||
</div>
|
||||
@endif
|
||||
{{ __('ui.back_to_app') }}
|
||||
</a>
|
||||
<form method="POST" action="{{ route('logout') }}">
|
||||
@csrf
|
||||
<button type="submit" class="text-sm text-gray-400 hover:text-white">{{ __('ui.logout') }}</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Mobile/Tablet menu --}}
|
||||
<div x-show="open" x-cloak class="lg:hidden border-t border-gray-700 px-4 py-2 space-y-1">
|
||||
<a href="{{ route('admin.events.index') }}" class="block py-2 text-sm text-gray-300">{{ __('admin.nav_events') }}</a>
|
||||
@if (\App\Models\Setting::isFeatureVisibleFor('statistics', auth()->user()))
|
||||
<a href="{{ route('admin.statistics.index') }}" class="block py-2 text-sm text-gray-300">{{ __('admin.nav_statistics') }}</a>
|
||||
@endif
|
||||
@if (auth()->user()->isStaff())
|
||||
<a href="{{ route('admin.teams.index') }}" class="block py-2 text-sm text-gray-300">{{ __('admin.nav_teams') }}</a>
|
||||
<a href="{{ route('admin.players.index') }}" class="block py-2 text-sm text-gray-300">{{ __('admin.nav_players') }}</a>
|
||||
<a href="{{ route('admin.users.index') }}" class="block py-2 text-sm text-gray-300">{{ __('admin.nav_users') }}</a>
|
||||
@endif
|
||||
<a href="{{ route('admin.files.index') }}" class="block py-2 text-sm text-gray-300">{{ __('admin.nav_files') }}</a>
|
||||
@if (auth()->user()->isStaff())
|
||||
<a href="{{ route('admin.locations.index') }}" class="block py-2 text-sm text-gray-300">{{ __('admin.nav_locations') }}</a>
|
||||
<div class="border-t border-gray-700 mt-1 pt-1">
|
||||
<span class="block py-1 text-xs text-gray-500 uppercase tracking-wider">{{ __('admin.nav_verwaltung') }}</span>
|
||||
<a href="{{ route('admin.settings.edit') }}" class="block py-2 text-sm text-gray-300 pl-3 rtl:pr-3 rtl:pl-0">{{ __('admin.nav_settings') }}</a>
|
||||
<a href="{{ route('admin.invitations.index') }}" class="block py-2 text-sm text-gray-300 pl-3 rtl:pr-3 rtl:pl-0">{{ __('admin.nav_invitations') }}</a>
|
||||
<a href="{{ route('admin.list-generator.create') }}" class="block py-2 text-sm text-gray-300 pl-3 rtl:pr-3 rtl:pl-0">{{ __('admin.nav_list_generator') }}</a>
|
||||
<a href="{{ route('admin.support.index') }}" class="block py-2 text-sm text-gray-300 pl-3 rtl:pr-3 rtl:pl-0">{{ __('admin.nav_support') }}</a>
|
||||
@if (auth()->user()->canViewActivityLog())
|
||||
<a href="{{ route('admin.activity-logs.index') }}" class="block py-2 text-sm text-gray-300 pl-3 rtl:pr-3 rtl:pl-0">{{ __('admin.nav_activity_log') }}</a>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
<a href="{{ route('dashboard') }}" class="block py-2 text-sm text-gray-300">{{ __('ui.back_to_app') }}</a>
|
||||
<form method="POST" action="{{ route('logout') }}">
|
||||
@csrf
|
||||
<button type="submit" class="block py-2 text-sm text-gray-400">{{ __('ui.logout') }}</button>
|
||||
</form>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<main class="flex-1 max-w-6xl mx-auto w-full px-4 py-6">
|
||||
@if (session('success'))
|
||||
<x-flash-message type="success" :message="session('success')" />
|
||||
@endif
|
||||
|
||||
@if (session('error'))
|
||||
<x-flash-message type="error" :message="session('error')" />
|
||||
@endif
|
||||
|
||||
{{ $slot }}
|
||||
</main>
|
||||
|
||||
<footer class="text-center py-2 text-xs text-gray-400">v{{ config('app.version') }}</footer>
|
||||
|
||||
@stack('scripts')
|
||||
|
||||
{{-- Service Worker --}}
|
||||
<script>
|
||||
if ('serviceWorker' in navigator) {
|
||||
window.addEventListener('load', () => {
|
||||
navigator.serviceWorker.register('/sw.js', { scope: '/' })
|
||||
.catch((err) => { console.error('SW:', err); });
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
190
resources/views/components/layouts/app.blade.php
Executable file
190
resources/views/components/layouts/app.blade.php
Executable file
@@ -0,0 +1,190 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ app()->getLocale() }}" dir="{{ app()->getLocale() === 'ar' ? 'rtl' : 'ltr' }}">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
<title>{{ $title ?? \App\Models\Setting::get('app_name', config('app.name')) }}</title>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.14.9/dist/cdn.min.js" integrity="sha384-9Ax3MmS9AClxJyd5/zafcXXjxmwFhZCdsT6HJoJjarvCaAkJlk5QDzjLJm+Wdx5F" crossorigin="anonymous"></script>
|
||||
@php $favicon = \App\Models\Setting::get('app_favicon'); @endphp
|
||||
@if ($favicon)
|
||||
<link rel="icon" href="{{ asset('storage/' . $favicon) }}">
|
||||
@else
|
||||
<link rel="icon" href="{{ asset('favicon.ico') }}">
|
||||
@endif
|
||||
{{-- PWA --}}
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
<meta name="theme-color" content="#1f2937">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||
<meta name="apple-mobile-web-app-title" content="SG Wölfe">
|
||||
<link rel="apple-touch-icon" href="/images/apple-touch-icon.png">
|
||||
@stack('styles')
|
||||
</head>
|
||||
<body class="min-h-screen bg-gray-100 flex flex-col">
|
||||
{{-- Navigation --}}
|
||||
<nav class="bg-white shadow" x-data="{ open: false }">
|
||||
<div class="max-w-5xl mx-auto px-4">
|
||||
<div class="flex justify-between h-14">
|
||||
<div class="flex items-center space-x-6 rtl:space-x-reverse">
|
||||
<a href="{{ route('dashboard') }}" class="flex items-center gap-2 font-bold text-gray-900">
|
||||
<img src="/images/logo_woelfe.png" alt="Logo" class="h-8 w-8 object-contain">
|
||||
{{ \App\Models\Setting::get('app_name', config('app.name')) }}
|
||||
</a>
|
||||
<div class="hidden sm:flex items-center space-x-6 rtl:space-x-reverse">
|
||||
<a href="{{ route('dashboard') }}" class="text-sm text-gray-600 hover:text-gray-900 {{ request()->routeIs('dashboard') ? 'font-semibold text-gray-900' : '' }}">{{ __('ui.dashboard') }}</a>
|
||||
<a href="{{ route('events.index') }}" class="text-sm text-gray-600 hover:text-gray-900 {{ request()->routeIs('events.*') ? 'font-semibold text-gray-900' : '' }}">{{ __('ui.events') }}</a>
|
||||
<a href="{{ route('files.index') }}" class="text-sm text-gray-600 hover:text-gray-900 {{ request()->routeIs('files.*') ? 'font-semibold text-gray-900' : '' }}">{{ __('ui.files') }}</a>
|
||||
@if (auth()->user()->canAccessAdminPanel())
|
||||
@php $pendingDsgvoCount = \App\Models\User::where('role', 'user')->whereNotNull('dsgvo_consent_file')->whereNull('dsgvo_accepted_at')->count(); @endphp
|
||||
<a href="{{ route('admin.dashboard') }}" class="text-sm text-red-600 hover:text-red-800 {{ request()->routeIs('admin.*') ? 'font-semibold' : '' }}">
|
||||
{{ __('ui.admin') }}
|
||||
@if ($pendingDsgvoCount > 0)
|
||||
<span class="bg-red-500 text-white text-xs rounded-full px-1.5 py-0.5 ml-1">{{ $pendingDsgvoCount }}</span>
|
||||
@endif
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Mobile menu button --}}
|
||||
<div class="flex items-center sm:hidden">
|
||||
<button @click="open = !open" class="text-gray-600 hover:text-gray-900">
|
||||
<svg class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path x-show="!open" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"/>
|
||||
<path x-show="open" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{{-- Desktop right side --}}
|
||||
<div class="hidden sm:flex items-center space-x-4 rtl:space-x-reverse">
|
||||
<a href="{{ route('profile.edit') }}" class="flex items-center gap-2 text-sm text-gray-600 hover:text-gray-900">
|
||||
@if (auth()->user()->getAvatarUrl())
|
||||
<img src="{{ auth()->user()->getAvatarUrl() }}" alt="{{ auth()->user()->name }}" class="w-7 h-7 rounded-full object-cover">
|
||||
@else
|
||||
<div class="w-7 h-7 rounded-full bg-blue-100 flex items-center justify-center text-blue-600 text-xs font-semibold">
|
||||
{{ auth()->user()->getInitials() }}
|
||||
</div>
|
||||
@endif
|
||||
{{ auth()->user()->name }}
|
||||
</a>
|
||||
<form method="POST" action="{{ route('logout') }}">
|
||||
@csrf
|
||||
<button type="submit" class="text-sm text-gray-500 hover:text-gray-700">{{ __('ui.logout') }}</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Mobile menu --}}
|
||||
<div x-show="open" x-cloak class="sm:hidden border-t border-gray-200 px-4 py-2 space-y-1">
|
||||
<a href="{{ route('dashboard') }}" class="block py-2 text-sm text-gray-700">{{ __('ui.dashboard') }}</a>
|
||||
<a href="{{ route('events.index') }}" class="block py-2 text-sm text-gray-700">{{ __('ui.events') }}</a>
|
||||
<a href="{{ route('files.index') }}" class="block py-2 text-sm text-gray-700">{{ __('ui.files') }}</a>
|
||||
@if (auth()->user()->canAccessAdminPanel())
|
||||
<a href="{{ route('admin.dashboard') }}" class="block py-2 text-sm text-red-600">
|
||||
{{ __('ui.admin') }}
|
||||
@if ($pendingDsgvoCount > 0)
|
||||
<span class="bg-red-500 text-white text-xs rounded-full px-1.5 py-0.5 ml-1">{{ $pendingDsgvoCount }}</span>
|
||||
@endif
|
||||
</a>
|
||||
@endif
|
||||
<a href="{{ route('profile.edit') }}" class="flex items-center gap-2 py-2 text-sm text-gray-700">
|
||||
@if (auth()->user()->getAvatarUrl())
|
||||
<img src="{{ auth()->user()->getAvatarUrl() }}" alt="{{ auth()->user()->name }}" class="w-6 h-6 rounded-full object-cover">
|
||||
@else
|
||||
<div class="w-6 h-6 rounded-full bg-blue-100 flex items-center justify-center text-blue-600 text-xs font-semibold">
|
||||
{{ auth()->user()->getInitials() }}
|
||||
</div>
|
||||
@endif
|
||||
{{ __('ui.profile') }}
|
||||
</a>
|
||||
<form method="POST" action="{{ route('logout') }}">
|
||||
@csrf
|
||||
<button type="submit" class="block py-2 text-sm text-gray-500">{{ __('ui.logout') }}</button>
|
||||
</form>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
{{-- DSGVO-Hinweis-Banner (2 Zustände) --}}
|
||||
@php $dsgvoBannerState = auth()->user()->dsgvoBannerState(); @endphp
|
||||
@if ($dsgvoBannerState === 'upload_required')
|
||||
<div class="bg-yellow-50 border-b-2 border-yellow-400">
|
||||
<div class="max-w-5xl mx-auto px-4 py-4">
|
||||
<div class="flex items-start gap-3">
|
||||
<div class="flex-shrink-0 mt-0.5">
|
||||
<svg class="w-6 h-6 text-yellow-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>
|
||||
</div>
|
||||
<div class="flex-1">
|
||||
<h3 class="text-sm font-semibold text-yellow-800">{{ __('ui.dsgvo_banner_title') }}</h3>
|
||||
<p class="text-sm text-yellow-700 mt-1">{{ __('ui.dsgvo_banner_text') }}</p>
|
||||
<a href="{{ route('profile.edit') }}#dsgvo-consent"
|
||||
class="inline-flex items-center gap-1.5 mt-3 bg-yellow-600 text-white px-4 py-2 rounded-md text-sm font-medium hover:bg-yellow-700 transition-colors">
|
||||
<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"/>
|
||||
</svg>
|
||||
{{ __('ui.dsgvo_banner_action') }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@elseif ($dsgvoBannerState === 'pending_confirmation')
|
||||
<div class="bg-blue-50 border-b-2 border-blue-400">
|
||||
<div class="max-w-5xl mx-auto px-4 py-4">
|
||||
<div class="flex items-start gap-3">
|
||||
<div class="flex-shrink-0 mt-0.5">
|
||||
<svg class="w-6 h-6 text-blue-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
||||
</svg>
|
||||
</div>
|
||||
<div class="flex-1">
|
||||
<h3 class="text-sm font-semibold text-blue-800">{{ __('ui.dsgvo_banner_pending_title') }}</h3>
|
||||
<p class="text-sm text-blue-700 mt-1">{{ __('ui.dsgvo_banner_pending_text') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<main class="flex-1 max-w-5xl mx-auto w-full px-4 py-6">
|
||||
@if (session('success'))
|
||||
<x-flash-message type="success" :message="session('success')" />
|
||||
@endif
|
||||
|
||||
@if (session('error'))
|
||||
<x-flash-message type="error" :message="session('error')" />
|
||||
@endif
|
||||
|
||||
{{ $slot }}
|
||||
</main>
|
||||
|
||||
<footer class="text-center py-4 text-sm text-gray-500 border-t border-gray-200">
|
||||
@php $slogan = \App\Models\Setting::get('app_slogan'); @endphp
|
||||
@if ($slogan)
|
||||
<div class="mb-2 text-xs text-gray-400">{!! app(\App\Services\HtmlSanitizerService::class)->sanitize($slogan) !!}</div>
|
||||
@endif
|
||||
<a href="/impressum" class="hover:underline">{{ __('ui.footer_impressum') }}</a>
|
||||
<span class="mx-2">|</span>
|
||||
<a href="/datenschutz" class="hover:underline">{{ __('ui.footer_privacy') }}</a>
|
||||
</footer>
|
||||
|
||||
@include('components.pwa-install-banner')
|
||||
|
||||
@stack('scripts')
|
||||
|
||||
{{-- Service Worker --}}
|
||||
<script>
|
||||
if ('serviceWorker' in navigator) {
|
||||
window.addEventListener('load', () => {
|
||||
navigator.serviceWorker.register('/sw.js', { scope: '/' })
|
||||
.catch((err) => { console.error('SW:', err); });
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
85
resources/views/components/layouts/guest.blade.php
Executable file
85
resources/views/components/layouts/guest.blade.php
Executable file
@@ -0,0 +1,85 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ app()->getLocale() }}" dir="{{ app()->getLocale() === 'ar' ? 'rtl' : 'ltr' }}">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
<title>{{ $title ?? \App\Models\Setting::get('app_name', config('app.name')) }}</title>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.14.9/dist/cdn.min.js" integrity="sha384-9Ax3MmS9AClxJyd5/zafcXXjxmwFhZCdsT6HJoJjarvCaAkJlk5QDzjLJm+Wdx5F" crossorigin="anonymous"></script>
|
||||
@php $favicon = \App\Models\Setting::get('app_favicon'); @endphp
|
||||
@if ($favicon)
|
||||
<link rel="icon" href="{{ asset('storage/' . $favicon) }}">
|
||||
@else
|
||||
<link rel="icon" href="{{ asset('favicon.ico') }}">
|
||||
@endif
|
||||
{{-- PWA --}}
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
<meta name="theme-color" content="#1f2937">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||
<meta name="apple-mobile-web-app-title" content="SG Wölfe">
|
||||
<link rel="apple-touch-icon" href="/images/apple-touch-icon.png">
|
||||
</head>
|
||||
<body class="min-h-screen bg-gray-100 flex flex-col">
|
||||
<main class="flex-1 flex items-center justify-center px-4 py-12">
|
||||
<div class="w-full max-w-md">
|
||||
<div class="text-center mb-8">
|
||||
<a href="{{ auth()->check() ? route('dashboard') : route('login') }}">
|
||||
<img src="/images/logo_sg_woelfe.png" alt="Logo" class="mx-auto h-24 mb-3">
|
||||
</a>
|
||||
<h1 class="text-2xl font-bold text-gray-900">{{ \App\Models\Setting::get('app_name', config('app.name')) }}</h1>
|
||||
@php $slogan = \App\Models\Setting::get('app_slogan'); @endphp
|
||||
@if ($slogan)
|
||||
<div class="text-sm text-gray-500 mt-1">{!! app(\App\Services\HtmlSanitizerService::class)->sanitize($slogan) !!}</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@if (session('error'))
|
||||
<x-flash-message type="error" :message="session('error')" />
|
||||
@endif
|
||||
|
||||
@if (session('success'))
|
||||
<x-flash-message type="success" :message="session('success')" />
|
||||
@endif
|
||||
|
||||
<div class="bg-white rounded-lg shadow-md p-6">
|
||||
{{ $slot }}
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer class="text-center py-4 text-sm text-gray-500">
|
||||
<div class="mb-2">
|
||||
<a href="/impressum" class="hover:underline">{{ __('ui.footer_impressum') }}</a>
|
||||
<span class="mx-2">|</span>
|
||||
<a href="/datenschutz" class="hover:underline">{{ __('ui.footer_privacy') }}</a>
|
||||
</div>
|
||||
@php
|
||||
$flags = ['de' => "\u{1F1E9}\u{1F1EA}", 'en' => "\u{1F1EC}\u{1F1E7}", 'pl' => "\u{1F1F5}\u{1F1F1}", 'ru' => "\u{1F1F7}\u{1F1FA}", 'ar' => "\u{1F1F8}\u{1F1E6}", 'tr' => "\u{1F1F9}\u{1F1F7}"];
|
||||
@endphp
|
||||
<div class="flex justify-center gap-2">
|
||||
@foreach ($flags as $code => $flag)
|
||||
<form method="POST" action="{{ route('locale.switch') }}" class="inline">
|
||||
@csrf
|
||||
<input type="hidden" name="locale" value="{{ $code }}">
|
||||
<button type="submit"
|
||||
class="text-xl leading-none transition-all {{ $code === app()->getLocale() ? 'scale-110' : 'opacity-50 hover:opacity-80' }}"
|
||||
title="{{ __('ui.locales.' . $code) }}">
|
||||
{{ $flag }}
|
||||
</button>
|
||||
</form>
|
||||
@endforeach
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
{{-- Service Worker --}}
|
||||
<script>
|
||||
if ('serviceWorker' in navigator) {
|
||||
window.addEventListener('load', () => {
|
||||
navigator.serviceWorker.register('/sw.js', { scope: '/' })
|
||||
.catch((err) => { console.error('SW:', err); });
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
69
resources/views/components/layouts/installer.blade.php
Normal file
69
resources/views/components/layouts/installer.blade.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de" dir="ltr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Installation — Handball WebApp</title>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.14.9/dist/cdn.min.js" integrity="sha384-9Ax3MmS9AClxJyd5/zafcXXjxmwFhZCdsT6HJoJjarvCaAkJlk5QDzjLJm+Wdx5F" crossorigin="anonymous"></script>
|
||||
<link rel="icon" href="{{ asset('favicon.ico') }}">
|
||||
</head>
|
||||
<body class="min-h-screen bg-gray-100 flex flex-col">
|
||||
<main class="flex-1 flex items-center justify-center px-4 py-12">
|
||||
<div class="w-full max-w-2xl">
|
||||
{{-- Logo --}}
|
||||
<div class="text-center mb-6">
|
||||
<img src="/images/logo_sg_woelfe.png" alt="Logo" class="mx-auto h-20 mb-3">
|
||||
<h1 class="text-xl font-bold text-gray-900">Installation</h1>
|
||||
</div>
|
||||
|
||||
{{-- Progress indicator --}}
|
||||
<div class="flex justify-center items-center mb-8">
|
||||
@php
|
||||
$stepLabels = ['Systemcheck', 'Datenbank', 'Einstellungen', 'E-Mail', 'Abschluss'];
|
||||
@endphp
|
||||
@for ($i = 1; $i <= 5; $i++)
|
||||
<div class="flex items-center">
|
||||
<div class="flex flex-col items-center">
|
||||
<div class="w-9 h-9 rounded-full flex items-center justify-center text-sm font-semibold
|
||||
{{ $i < $currentStep ? 'bg-green-500 text-white' : '' }}
|
||||
{{ $i === $currentStep ? 'bg-blue-600 text-white ring-2 ring-blue-300' : '' }}
|
||||
{{ $i > $currentStep ? 'bg-gray-200 text-gray-400' : '' }}">
|
||||
@if ($i < $currentStep)
|
||||
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"/></svg>
|
||||
@else
|
||||
{{ $i }}
|
||||
@endif
|
||||
</div>
|
||||
<span class="text-xs mt-1 {{ $i === $currentStep ? 'text-blue-600 font-medium' : 'text-gray-400' }}">{{ $stepLabels[$i - 1] }}</span>
|
||||
</div>
|
||||
@if ($i < 5)
|
||||
<div class="w-12 sm:w-20 h-0.5 mx-1 mb-5 {{ $i < $currentStep ? 'bg-green-500' : 'bg-gray-200' }}"></div>
|
||||
@endif
|
||||
</div>
|
||||
@endfor
|
||||
</div>
|
||||
|
||||
{{-- Flash messages --}}
|
||||
@if (session('error'))
|
||||
<div class="mb-4 p-3 bg-red-50 border border-red-200 rounded-md text-sm text-red-700">
|
||||
{{ session('error') }}
|
||||
</div>
|
||||
@endif
|
||||
@if (session('success'))
|
||||
<div class="mb-4 p-3 bg-green-50 border border-green-200 rounded-md text-sm text-green-700">
|
||||
{{ session('success') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{-- Step content --}}
|
||||
<div class="bg-white rounded-lg shadow-md p-6">
|
||||
{{ $slot }}
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<footer class="text-center py-3 text-xs text-gray-400">
|
||||
Handball WebApp — Installation
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
129
resources/views/components/pwa-install-banner.blade.php
Normal file
129
resources/views/components/pwa-install-banner.blade.php
Normal file
@@ -0,0 +1,129 @@
|
||||
{{-- PWA Install Banner (Android + iOS) --}}
|
||||
<div id="pwa-install-banner" style="display: none;">
|
||||
<style>
|
||||
#pwa-install-banner {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: #1f2937;
|
||||
color: white;
|
||||
padding: 1rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
z-index: 9999;
|
||||
box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
|
||||
}
|
||||
#pwa-install-banner .pwa-text {
|
||||
flex: 1;
|
||||
font-size: 0.9rem;
|
||||
line-height: 1.4;
|
||||
}
|
||||
#pwa-install-banner .pwa-text strong {
|
||||
display: block;
|
||||
font-size: 1rem;
|
||||
margin-bottom: 0.2rem;
|
||||
}
|
||||
#pwa-install-banner .pwa-ios-steps {
|
||||
font-size: 0.82rem;
|
||||
margin-top: 0.3rem;
|
||||
color: rgba(255,255,255,0.85);
|
||||
}
|
||||
#pwa-install-banner .pwa-ios-steps .pwa-icon {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
font-size: 1.05rem;
|
||||
}
|
||||
#pwa-install-banner button {
|
||||
border: none;
|
||||
padding: 0.6rem 1.2rem;
|
||||
border-radius: 0.4rem;
|
||||
font-size: 0.9rem;
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
}
|
||||
#pwa-install-banner .pwa-install-btn {
|
||||
background: white;
|
||||
color: #1f2937;
|
||||
font-weight: 600;
|
||||
}
|
||||
#pwa-install-banner .pwa-dismiss-btn {
|
||||
background: transparent;
|
||||
color: rgba(255,255,255,0.8);
|
||||
padding: 0.6rem;
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="pwa-text">
|
||||
<strong id="pwa-title">{{ __('ui.pwa_install_title') }}</strong>
|
||||
<span id="pwa-desc">{{ __('ui.pwa_install_text') }}</span>
|
||||
<div id="pwa-ios-steps" class="pwa-ios-steps" style="display: none;">
|
||||
{!! app(\App\Services\HtmlSanitizerService::class)->sanitize(__('ui.pwa_ios_steps')) !!}
|
||||
</div>
|
||||
</div>
|
||||
<button class="pwa-install-btn" id="pwa-install-btn">{{ __('ui.pwa_install_btn') }}</button>
|
||||
<button class="pwa-dismiss-btn" id="pwa-dismiss-btn">×</button>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
let deferredPrompt;
|
||||
const banner = document.getElementById('pwa-install-banner');
|
||||
const installBtn = document.getElementById('pwa-install-btn');
|
||||
const dismissBtn = document.getElementById('pwa-dismiss-btn');
|
||||
const iosSteps = document.getElementById('pwa-ios-steps');
|
||||
|
||||
const dismissed = localStorage.getItem('pwa-install-dismissed');
|
||||
const isStandalone = window.matchMedia('(display-mode: standalone)').matches
|
||||
|| window.navigator.standalone === true;
|
||||
|
||||
// Reset nach 30 Tagen
|
||||
if (dismissed && (Date.now() - parseInt(dismissed)) > 30 * 24 * 60 * 60 * 1000) {
|
||||
localStorage.removeItem('pwa-install-dismissed');
|
||||
}
|
||||
|
||||
// Bereits installiert → nichts anzeigen
|
||||
if (isStandalone) return;
|
||||
|
||||
// iOS-Erkennung (iPhone, iPad, iPod)
|
||||
const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent)
|
||||
|| (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
|
||||
|
||||
if (isIOS) {
|
||||
// iOS: Manuellen Hinweis zeigen (kein beforeinstallprompt)
|
||||
if (!dismissed) {
|
||||
installBtn.style.display = 'none';
|
||||
iosSteps.style.display = 'block';
|
||||
banner.style.display = 'flex';
|
||||
}
|
||||
} else {
|
||||
// Android/Chrome: beforeinstallprompt abfangen
|
||||
window.addEventListener('beforeinstallprompt', (e) => {
|
||||
e.preventDefault();
|
||||
deferredPrompt = e;
|
||||
|
||||
if (!dismissed) {
|
||||
banner.style.display = 'flex';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
installBtn.addEventListener('click', async () => {
|
||||
if (!deferredPrompt) return;
|
||||
|
||||
deferredPrompt.prompt();
|
||||
await deferredPrompt.userChoice;
|
||||
|
||||
deferredPrompt = null;
|
||||
banner.style.display = 'none';
|
||||
});
|
||||
|
||||
dismissBtn.addEventListener('click', () => {
|
||||
banner.style.display = 'none';
|
||||
localStorage.setItem('pwa-install-dismissed', Date.now());
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
15
resources/views/components/status-chip.blade.php
Executable file
15
resources/views/components/status-chip.blade.php
Executable file
@@ -0,0 +1,15 @@
|
||||
@props(['status'])
|
||||
|
||||
@php
|
||||
$colors = match($status->value ?? $status) {
|
||||
'yes' => 'bg-green-100 text-green-800',
|
||||
'no' => 'bg-red-100 text-red-800',
|
||||
'unknown' => 'bg-gray-100 text-gray-600',
|
||||
default => 'bg-gray-100 text-gray-600',
|
||||
};
|
||||
$label = method_exists($status, 'label') ? $status->label() : $status;
|
||||
@endphp
|
||||
|
||||
<span class="inline-block px-2 py-0.5 rounded-full text-xs font-medium {{ $colors }}">
|
||||
{{ $label }}
|
||||
</span>
|
||||
13
resources/views/components/traffic-light.blade.php
Executable file
13
resources/views/components/traffic-light.blade.php
Executable file
@@ -0,0 +1,13 @@
|
||||
@props(['event'])
|
||||
|
||||
@php
|
||||
$yes = $event->participants->where('status', \App\Enums\ParticipantStatus::Yes)->count();
|
||||
$no = $event->participants->where('status', \App\Enums\ParticipantStatus::No)->count();
|
||||
$open = $event->participants->where('status', \App\Enums\ParticipantStatus::Unknown)->count();
|
||||
@endphp
|
||||
|
||||
<span class="inline-flex items-center gap-1 text-xs font-semibold tabular-nums" title="{{ __('events.confirmations') }}: {{ $yes }} / {{ __('events.rejections') }}: {{ $no }} / {{ __('events.open_responses') }}: {{ $open }}">
|
||||
<span class="text-green-600">{{ $yes }}</span>
|
||||
<span class="text-red-500">{{ $no }}</span>
|
||||
<span class="text-gray-400">{{ $open }}</span>
|
||||
</span>
|
||||
Reference in New Issue
Block a user