Colour overloaded days and late tasks in the task calendar
Days over the daily capacity are amber and late task bars red, next to the existing icon and text. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
@@ -595,6 +595,7 @@ new class extends Component
|
||||
|
||||
@foreach ($days as $index => $day)
|
||||
@php($booked = $row->minutesByDay[$day] ?? 0)
|
||||
@php($overloaded = $row->userId !== null && $booked > $this->capacityMinutes)
|
||||
<div
|
||||
wire:key="cell-{{ $rowKey }}-{{ $day }}"
|
||||
data-calendar-day="{{ $day }}"
|
||||
@@ -602,7 +603,8 @@ new class extends Component
|
||||
x-bind:class="isTarget('{{ $day }}', '{{ $row->userId ?? '' }}') && 'outline-2 -outline-offset-2 outline-blue-700 dark:outline-blue-300'"
|
||||
@class([
|
||||
'min-h-12 border-l border-zinc-200 dark:border-zinc-700',
|
||||
'bg-zinc-200 dark:bg-zinc-950' => $this->isDayOff($day),
|
||||
'bg-amber-100 dark:bg-amber-950' => $overloaded,
|
||||
'bg-zinc-200 dark:bg-zinc-950' => $this->isDayOff($day) && ! $overloaded,
|
||||
])
|
||||
style="grid-column: {{ $index + 2 }}; grid-row: 1 / span {{ $row->lanes + 1 }};"
|
||||
></div>
|
||||
@@ -613,7 +615,7 @@ new class extends Component
|
||||
wire:key="load-{{ $rowKey }}-{{ $day }}"
|
||||
@class([
|
||||
'pointer-events-none px-1 pt-1 text-right text-xs whitespace-nowrap',
|
||||
'font-semibold' => $booked > $this->capacityMinutes,
|
||||
'font-semibold text-amber-900 dark:text-amber-200' => $booked > $this->capacityMinutes,
|
||||
'text-zinc-600 dark:text-zinc-300' => $booked === 0,
|
||||
])
|
||||
style="grid-column: {{ $index + 2 }}; grid-row: 1;"
|
||||
@@ -644,7 +646,8 @@ new class extends Component
|
||||
@class([
|
||||
'relative z-10 mx-0.5 my-1 flex min-w-0 touch-none flex-col justify-center overflow-hidden border px-2 text-left text-xs leading-tight select-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-700 dark:focus-visible:outline-blue-300',
|
||||
'cursor-grab' => $canManage,
|
||||
'border-primary-300 bg-primary-100 text-primary-950 dark:border-primary-600 dark:bg-primary-900 dark:text-white' => $bar->task->status !== TaskStatus::Done,
|
||||
'border-primary-300 bg-primary-100 text-primary-950 dark:border-primary-600 dark:bg-primary-900 dark:text-white' => $bar->task->status !== TaskStatus::Done && ! $bar->late,
|
||||
'border-red-600 bg-red-100 text-red-950 dark:border-red-400 dark:bg-red-950 dark:text-white' => $bar->late,
|
||||
'border-zinc-300 bg-zinc-100 text-zinc-800 dark:border-zinc-600 dark:bg-zinc-700 dark:text-zinc-100' => $bar->task->status === TaskStatus::Done,
|
||||
'rounded-l-md' => $bar->from >= $days[0],
|
||||
'rounded-r-md' => $bar->to <= $days[count($days) - 1],
|
||||
@@ -705,7 +708,7 @@ new class extends Component
|
||||
<dd>
|
||||
{{ $this->shortDate($bar->from) }}–{{ $this->shortDate($bar->to) }}@if ($bar->minutes > 0), {{ $this->hours($bar->minutes) }} h @endif
|
||||
@if ($bar->late)
|
||||
<span class="inline-flex items-center gap-1 font-semibold">
|
||||
<span class="inline-flex items-center gap-1 font-semibold text-red-700 dark:text-red-400">
|
||||
<x-icon name="exclamation-triangle" class="size-4" aria-hidden="true" />{{ __('jobs.late') }}
|
||||
</span>
|
||||
@endif
|
||||
@@ -737,7 +740,11 @@ new class extends Component
|
||||
type="button"
|
||||
id="agenda-bar-{{ $bar->key() }}"
|
||||
wire:click="openDialog({{ $bar->task->taskId }}, {{ $bar->userId ?? 'null' }})"
|
||||
class="flex w-full flex-col gap-1 rounded-md border border-zinc-300 p-2 text-left text-sm focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-700 dark:border-zinc-600 dark:focus-visible:outline-blue-300"
|
||||
@class([
|
||||
'flex w-full flex-col gap-1 rounded-md border p-2 text-left text-sm focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-700 dark:focus-visible:outline-blue-300',
|
||||
'border-zinc-300 dark:border-zinc-600' => ! $bar->late,
|
||||
'border-red-600 border-l-4 bg-red-50 dark:border-red-400 dark:bg-red-950' => $bar->late,
|
||||
])
|
||||
>
|
||||
<span class="font-semibold break-words">{{ $bar->task->title }}</span>
|
||||
<span>{{ $this->shortDate($bar->from) }}–{{ $this->shortDate($bar->to) }}@if ($bar->minutes > 0), {{ $this->hours($bar->minutes) }} h @endif</span>
|
||||
@@ -746,7 +753,7 @@ new class extends Component
|
||||
<span class="break-words">{{ __('jobs.calendar.info.customer') }}: {{ $bar->task->customerName }}</span>
|
||||
@endif
|
||||
@if ($bar->late)
|
||||
<span class="inline-flex items-center gap-1 font-semibold">
|
||||
<span class="inline-flex items-center gap-1 font-semibold text-red-700 dark:text-red-300">
|
||||
<x-icon name="exclamation-triangle" class="size-4" aria-hidden="true" />{{ __('jobs.late') }}
|
||||
</span>
|
||||
@endif
|
||||
|
||||
Reference in New Issue
Block a user