Files
ladill-care/resources/views/care/nursing/my-shifts.blade.php
T
isaaccladandCursor 45da731561
Deploy Ladill Care / deploy (push) Successful in 39s
Add My ward nurse station for bedside clinical work.
Floor nurses keep Nursing Services admin-only, but now get a My ward
home keyed off today's roster or unit placement with patient lists and
direct links to MAR, vitals/assessments, notes, and handovers. Care unit
show and board crumbs open for station users so clinical pages are
reachable without department admin rights.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-20 15:54:26 +00:00

107 lines
6.4 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<x-app-layout title="My shifts">
<div class="space-y-6">
<div class="flex flex-wrap items-start justify-between gap-4">
<div>
<h1 class="text-2xl font-semibold text-slate-900">My shifts</h1>
<p class="mt-1 text-sm text-slate-500">
Your duty roster for
{{ $weekStart->format('d M Y') }} {{ $weekStart->copy()->addDays(6)->format('d M Y') }}.
</p>
</div>
<div class="flex flex-wrap gap-2">
<a href="{{ route('care.my-shifts', ['week' => $prevWeek]) }}" class="btn-secondary">Previous</a>
<a href="{{ route('care.my-shifts', ['week' => now()->startOfWeek(\Carbon\Carbon::MONDAY)->toDateString()]) }}" class="btn-secondary">This week</a>
<a href="{{ route('care.my-shifts', ['week' => $nextWeek]) }}" class="btn-secondary">Next</a>
</div>
</div>
@if ($todayEntries->isNotEmpty())
<div class="rounded-2xl border border-teal-200 bg-teal-50 p-5">
<h2 class="text-sm font-semibold uppercase tracking-wide text-teal-800">Today</h2>
<ul class="mt-3 space-y-2">
@foreach ($todayEntries as $entry)
<li class="flex flex-wrap items-center justify-between gap-2 rounded-xl bg-white/80 px-4 py-3 text-sm">
<div>
<p class="font-semibold text-slate-900">{{ $entry->shift?->label ?? 'Shift' }}</p>
<p class="text-xs text-slate-500">
{{ $entry->shift?->timeLabel() }}
· {{ $entry->careUnit?->name ?? 'Unit' }}
@if ($entry->careUnit?->department)
({{ $entry->careUnit->department->name }})
@endif
</p>
</div>
<div class="flex flex-wrap items-center gap-2">
@if ($entry->careUnit && app(\App\Services\Care\CarePermissions::class)->can(
auth()->user() ? app(\App\Services\Care\OrganizationResolver::class)->memberFor(auth()->user()) : null,
'nursing.station.view'
))
<a href="{{ route('care.nursing.station', ['unit' => $entry->care_unit_id]) }}" class="rounded-lg bg-slate-900 px-2.5 py-1 text-xs font-semibold text-white hover:bg-slate-800">Open ward</a>
@endif
<span class="rounded-full bg-teal-100 px-2.5 py-0.5 text-xs font-medium text-teal-800">
{{ config('care.roster_entry_statuses.'.$entry->status, $entry->status) }}
</span>
</div>
</li>
@endforeach
</ul>
</div>
@else
<div class="rounded-2xl border border-slate-200 bg-white px-5 py-4 text-sm text-slate-500">
No duty assigned for today.
</div>
@endif
<div class="overflow-hidden rounded-2xl border border-slate-200 bg-white">
<table class="min-w-full text-sm">
<thead class="bg-slate-50 text-left text-xs uppercase text-slate-500">
<tr>
<th class="px-4 py-3">Day</th>
<th class="px-4 py-3">Shift</th>
<th class="px-4 py-3">Unit</th>
<th class="px-4 py-3">Status</th>
</tr>
</thead>
<tbody class="divide-y divide-slate-50">
@foreach ($days as $day)
@php $dayEntries = $entriesByDate[$day->toDateString()] ?? []; @endphp
@forelse ($dayEntries as $entry)
<tr class="{{ $day->isToday() ? 'bg-teal-50/40' : '' }}">
<td class="px-4 py-3 whitespace-nowrap">
<span class="font-medium text-slate-900">{{ $day->format('D') }}</span>
<span class="text-slate-400">{{ $day->format('d M') }}</span>
@if ($day->isToday())
<span class="ml-1 text-[10px] font-semibold uppercase text-teal-700">Today</span>
@endif
</td>
<td class="px-4 py-3">
<span class="mr-1 inline-block h-2 w-2 rounded-full" style="background: {{ $entry->shift?->color ?? '#94a3b8' }}"></span>
{{ $entry->shift?->label ?? '—' }}
<div class="text-xs text-slate-400">{{ $entry->shift?->timeLabel() }}</div>
</td>
<td class="px-4 py-3">
{{ $entry->careUnit?->name ?? '—' }}
@if ($entry->careUnit?->department)
<div class="text-xs text-slate-400">{{ $entry->careUnit->department->name }}</div>
@endif
</td>
<td class="px-4 py-3 capitalize text-slate-600">
{{ config('care.roster_entry_statuses.'.$entry->status, $entry->status) }}
</td>
</tr>
@empty
<tr class="{{ $day->isToday() ? 'bg-teal-50/40' : '' }}">
<td class="px-4 py-3 whitespace-nowrap text-slate-500">
<span class="font-medium text-slate-700">{{ $day->format('D') }}</span>
{{ $day->format('d M') }}
</td>
<td class="px-4 py-3 text-slate-400" colspan="3">Off / not rostered</td>
</tr>
@endforelse
@endforeach
</tbody>
</table>
</div>
</div>
</x-app-layout>