Show a task card's actions above tabs for notes, images and materials
The opened task card keeps its details and description at the top, then the status, book hours, edit and remove actions, and below them tabs: checklist and comments, images, and materials and machines. The tabs are a project component (x-tabs) after the WAI-ARIA pattern, because TallStackUI's tab ties its panels to missing ids and has no arrow keys. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
@@ -470,14 +470,6 @@ new class extends Component
|
||||
<p class="whitespace-pre-line">{{ $task->description }}</p>
|
||||
@endif
|
||||
|
||||
<livewire:jobs::task-checklist :job-id="$job->id" :task-id="$task->id" :task-title="$task->title" :wire:key="'checklist-'.$task->id" />
|
||||
|
||||
<livewire:jobs::task-comments :job-id="$job->id" :task-id="$task->id" :task-title="$task->title" :wire:key="'comments-'.$task->id" />
|
||||
|
||||
<livewire:jobs::task-images :job-id="$job->id" :task-id="$task->id" :task-title="$task->title" :wire:key="'images-'.$task->id" />
|
||||
<livewire:inventory::task-materials :job-id="$job->id" :task-id="$task->id" :task-title="$task->title" :wire:key="'materials-'.$task->id" />
|
||||
<livewire:machines::task-machine :job-id="$job->id" :task-id="$task->id" :task-title="$task->title" :wire:key="'machine-'.$task->id" />
|
||||
|
||||
<div class="flex flex-wrap items-end gap-3">
|
||||
@if ($canChangeStatus)
|
||||
<div class="w-full sm:w-56">
|
||||
@@ -530,6 +522,33 @@ new class extends Component
|
||||
/>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<x-tabs
|
||||
id="task-{{ $task->id }}-tabs"
|
||||
:label="__('jobs.tasks.tabs.label', ['title' => $task->title])"
|
||||
:tabs="[
|
||||
'notes' => __('jobs.tasks.tabs.notes'),
|
||||
'images' => __('jobs.tasks.tabs.images'),
|
||||
'materials' => __('jobs.tasks.tabs.materials'),
|
||||
]"
|
||||
class="pt-2"
|
||||
>
|
||||
<x-tabs.panel tabs-id="task-{{ $task->id }}-tabs" name="notes" class="space-y-3">
|
||||
<livewire:jobs::task-checklist :job-id="$job->id" :task-id="$task->id" :task-title="$task->title" :wire:key="'checklist-'.$task->id" />
|
||||
<livewire:jobs::task-comments :job-id="$job->id" :task-id="$task->id" :task-title="$task->title" :wire:key="'comments-'.$task->id" />
|
||||
</x-tabs.panel>
|
||||
|
||||
<x-tabs.panel tabs-id="task-{{ $task->id }}-tabs" name="images">
|
||||
<livewire:jobs::task-images :job-id="$job->id" :task-id="$task->id" :task-title="$task->title" :wire:key="'images-'.$task->id" />
|
||||
</x-tabs.panel>
|
||||
|
||||
{{-- The sections mark themselves data-task-section when they have something to show. --}}
|
||||
<x-tabs.panel tabs-id="task-{{ $task->id }}-tabs" name="materials" class="group space-y-3">
|
||||
<livewire:inventory::task-materials :job-id="$job->id" :task-id="$task->id" :task-title="$task->title" :wire:key="'materials-'.$task->id" />
|
||||
<livewire:machines::task-machine :job-id="$job->id" :task-id="$task->id" :task-title="$task->title" :wire:key="'machine-'.$task->id" />
|
||||
<p class="group-has-[[data-task-section]]:hidden">{{ __('jobs.tasks.tabs.no_materials') }}</p>
|
||||
</x-tabs.panel>
|
||||
</x-tabs>
|
||||
</div>
|
||||
</article>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user