refactor: update schedule filtering logic, adjust client page title, and reformat client index view components.
This commit is contained in:
@@ -13,11 +13,17 @@
|
||||
|
||||
{{-- ── Upcoming Alert Strip ─────────────────────────────────── --}}
|
||||
@php
|
||||
$upcomingList = $events->filter(fn($e) => $e->start_time->isFuture() && $e->start_time->diffInHours(now()) <= 24);
|
||||
$startOfMonth = now()->startOfMonth();
|
||||
$endOfMonth = now()->endOfMonth();
|
||||
$upcomingList = $events->filter(function($e) use ($startOfMonth, $endOfMonth) {
|
||||
$start = $e->start_time;
|
||||
$end = $e->end_time ?: $e->start_time;
|
||||
return $start->lte($endOfMonth) && $end->gte($startOfMonth);
|
||||
});
|
||||
@endphp
|
||||
@if($upcomingList->isNotEmpty())
|
||||
<div class="flex gap-2 overflow-x-auto pb-2 mb-4 -mx-4 px-4 lg:mx-0 lg:px-0">
|
||||
@foreach($upcomingList->take(6) as $event)
|
||||
@foreach($upcomingList as $event)
|
||||
<div class="shrink-0 flex items-center gap-2 bg-white rounded-2xl border border-pink-100 px-3 py-2 shadow-sm cursor-pointer hover:border-pink-300 transition-colors"
|
||||
onclick="openAlertEventModal({{ json_encode(['id' => $event->id, 'title' => $event->title, 'type' => $event->event_type, 'status' => $event->status->value, 'client' => $event->client?->name, 'start' => $event->start_time->format('d M Y H:i'), 'end' => $event->end_time?->format('d M Y H:i'), 'location' => $event->location, 'description' => $event->description, 'notes' => $event->notes, 'has_contract' => $event->has_contract, 'has_content' => $event->has_content]) }})">
|
||||
<div class="w-1.5 h-8 rounded-full shrink-0" style="background:{{ $event->color }}"></div>
|
||||
|
||||
Reference in New Issue
Block a user