Neues Design: Tailwind + shadcn-vue statt Vuetify/Material 3
Some checks failed
CI / PHP 8.4 / mariadb:10.6 (pull_request) Failing after 1m3s
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m7s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Failing after 1m16s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Failing after 1m20s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 1m29s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 1m33s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 1m28s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 1m33s
CI / Build-Artefakte aktuell (pull_request) Failing after 52s
Some checks failed
CI / PHP 8.4 / mariadb:10.6 (pull_request) Failing after 1m3s
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m7s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Failing after 1m16s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Failing after 1m20s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 1m29s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 1m33s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 1m28s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 1m33s
CI / Build-Artefakte aktuell (pull_request) Failing after 52s
- Nüchterne, professionelle Optik: neutrale Flächen, Markenfarbe nur als Akzent, Inter-Schrift (lokal) - Zweizeiliger Header mit Suche, Hauptnavigation und Avatar-Menü - Startseite mit Begrüßungskarte, Schnellzugriffen und „Neu im Team“ - Personenverzeichnis mit Suche, Abteilungsfilter und Seitenaufteilung - Markenfarbe exakt übernommen, Abstufungen serverseitig in OKLCH (ColorPalette) – gemeinsam für Portal und Admin, keine Farbberechnung im Browser - Schnellzugriffe im Admin pflegbar - Filament-Avatare lokal statt über ui-avatars.com (DSGVO) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
9c0f8de791
commit
5a3f1f34c7
141 changed files with 3873 additions and 974 deletions
|
|
@ -2,14 +2,37 @@
|
|||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Resources\PersonResource;
|
||||
use App\Models\User;
|
||||
use App\Support\QuickLinks;
|
||||
use Illuminate\Http\Request;
|
||||
use Inertia\Inertia;
|
||||
use Inertia\Response;
|
||||
|
||||
class DashboardController extends Controller
|
||||
{
|
||||
public function __invoke(Request $request): Response
|
||||
public function __invoke(Request $request, QuickLinks $quickLinks): Response
|
||||
{
|
||||
return Inertia::render('Dashboard');
|
||||
$user = $request->user();
|
||||
|
||||
return Inertia::render('Dashboard', [
|
||||
'profile' => [
|
||||
'job_title' => $user->job_title,
|
||||
'department' => $user->department,
|
||||
'location' => $user->location,
|
||||
'avatar_url' => $user->avatarUrl(256),
|
||||
],
|
||||
'quickLinks' => $quickLinks->all(),
|
||||
'newColleagues' => PersonResource::collection(
|
||||
User::query()
|
||||
->active()
|
||||
->whereKeyNot($user->getKey())
|
||||
->where('created_at', '>=', now()->subDays(90))
|
||||
->latest()
|
||||
->limit(6)
|
||||
->get()
|
||||
),
|
||||
'peopleCount' => User::query()->active()->count(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,12 +2,58 @@
|
|||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Resources\PersonResource;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Inertia\Inertia;
|
||||
use Inertia\Response;
|
||||
|
||||
class PeopleController extends Controller
|
||||
{
|
||||
public function index(Request $request): Response
|
||||
{
|
||||
$filters = $request->validate([
|
||||
'q' => ['nullable', 'string', 'max:100'],
|
||||
'abteilung' => ['nullable', 'string', 'max:150'],
|
||||
]);
|
||||
|
||||
$search = trim($filters['q'] ?? '');
|
||||
$department = $filters['abteilung'] ?? null;
|
||||
|
||||
$people = User::query()
|
||||
->active()
|
||||
->when($search !== '', function (Builder $query) use ($search) {
|
||||
$like = '%'.str_replace(['\\', '%', '_'], ['\\\\', '\\%', '\\_'], $search).'%';
|
||||
|
||||
$query->where(fn (Builder $q) => $q
|
||||
->where('name', 'like', $like)
|
||||
->orWhere('email', 'like', $like)
|
||||
->orWhere('job_title', 'like', $like)
|
||||
->orWhere('department', 'like', $like)
|
||||
->orWhere('location', 'like', $like));
|
||||
})
|
||||
->when($department, fn (Builder $query) => $query->where('department', $department))
|
||||
->orderBy('last_name')
|
||||
->orderBy('first_name')
|
||||
->orderBy('name')
|
||||
->paginate(24)
|
||||
->withQueryString();
|
||||
|
||||
return Inertia::render('People/Index', [
|
||||
'people' => PersonResource::collection($people),
|
||||
'filters' => ['q' => $search, 'abteilung' => $department],
|
||||
'departments' => Cache::remember('people.departments', 300, fn () => User::query()
|
||||
->active()
|
||||
->whereNotNull('department')
|
||||
->distinct()
|
||||
->orderBy('department')
|
||||
->pluck('department')
|
||||
->all()),
|
||||
]);
|
||||
}
|
||||
|
||||
public function show(User $user): Response
|
||||
{
|
||||
abort_unless($user->is_active, 404);
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
namespace App\Http\Middleware;
|
||||
|
||||
use App\Support\Branding;
|
||||
use App\Support\Navigation;
|
||||
use Illuminate\Http\Request;
|
||||
use Inertia\Middleware;
|
||||
|
||||
|
|
@ -10,7 +11,10 @@ class HandleInertiaRequests extends Middleware
|
|||
{
|
||||
protected $rootView = 'app';
|
||||
|
||||
public function __construct(private readonly Branding $branding) {}
|
||||
public function __construct(
|
||||
private readonly Branding $branding,
|
||||
private readonly Navigation $navigation,
|
||||
) {}
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
|
|
@ -34,6 +38,7 @@ class HandleInertiaRequests extends Middleware
|
|||
'is_admin' => $user->is_admin,
|
||||
] : null,
|
||||
],
|
||||
'navigation' => fn () => $user ? $this->navigation->items($request) : [],
|
||||
'flash' => [
|
||||
'status' => fn () => $request->session()->get('status'),
|
||||
],
|
||||
|
|
|
|||
33
app/Http/Resources/PersonResource.php
Normal file
33
app/Http/Resources/PersonResource.php
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
/**
|
||||
* Kompakte Darstellung einer Person für Listen und Kacheln.
|
||||
*
|
||||
* @mixin User
|
||||
*/
|
||||
class PersonResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'name' => $this->name,
|
||||
'initials' => $this->initials,
|
||||
'job_title' => $this->job_title,
|
||||
'department' => $this->department,
|
||||
'location' => $this->location,
|
||||
'email' => $this->email,
|
||||
'phone' => $this->phone,
|
||||
'avatar_url' => $this->avatarUrl(96),
|
||||
];
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue