Files
Toiminnanohjaus/resources/views/components/jobs/board/task-list.blade.php
T
petriandClaude Opus 5.5 6332ff0fa9 Rebuild the Kanban board after the prototype, with the job editor and quick intake dialog
- Toolbar: whose board (own, a person, a service line, all), pipeline
  views (daily, sales, full), urgent and late filters with a live count,
  normal and compact density, and the quick intake button.
- Columns side by side with horizontal scrolling on desktop, stacked on
  phones; each user's own column colours and order, the urgent column's
  threshold menu, and the continuing jobs column.
- Cards in customer colours: job cards with their tasks checked off inside
  the card (the status select is gone), continuing job cards with the next
  period, PIN and quick add, and pinned task cards. Dragging moves and
  orders cards; the keyboard opens the job editor from the card title.
- Job editor dialog: every job detail, tasks with checklists and
  templates, quick hours (TimeTracking) and expenses (Expenses), history.
- The quick intake form also adds a contact person, initial status and
  priority, and opens as a dialog on the board.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-30 06:33:28 +02:00

84 lines
5.4 KiB
PHP

{{--
A card's tasks inside the card: each with a checkbox that marks it done
(or open again). On a continuing job's card each task can also be lifted
into the pipeline as a card of its own (PIN), and new tasks are added
straight from the card.
--}}
@props(['card', 'canCheck' => false, 'canManage' => false, 'ongoing' => false, 'compact' => false])
<ul @class(['space-y-1', 'space-y-1.5' => $ongoing && ! $compact])>
@foreach ($card->tasks as $task)
<li wire:key="board-task-{{ $task->id }}" @class([
'rounded border border-neutral-200 bg-neutral-50 text-[11px] dark:border-[#32353b] dark:bg-[#1b1c1f]',
'flex items-center justify-between gap-1.5 px-2 py-1' => ! $ongoing,
'space-y-1 p-1.5' => $ongoing,
])>
<label class="flex min-w-0 flex-1 cursor-pointer items-center gap-1.5">
<input
type="checkbox"
@checked($task->isDone())
@disabled(! $canCheck)
wire:change="setTaskDone({{ $card->jobId }}, {{ $task->id }}, $event.target.checked)"
class="size-4 shrink-0 rounded border-neutral-500 text-emerald-700 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary-600 dark:border-neutral-400 dark:bg-[#16171a] dark:focus-visible:outline-primary-300"
/>
<span @class([
$ongoing ? 'leading-tight' : 'truncate',
'text-neutral-600 line-through dark:text-neutral-300' => $task->isDone(),
'font-medium text-neutral-800 dark:text-neutral-100' => ! $task->isDone(),
]) @if (! $ongoing) title="{{ $task->title }}" @endif>{{ $task->title }}</span>
</label>
@if ($ongoing)
<div class="flex items-center justify-between gap-1 pl-5">
@if ($canManage)
<button
type="button"
wire:click="pinTask({{ $card->jobId }}, {{ $task->id }}, {{ $task->pinnedToBoard ? 'false' : 'true' }})"
aria-label="{{ $task->pinnedToBoard ? __('jobs.board.unpin_label', ['task' => $task->title]) : __('jobs.board.pin_label', ['task' => $task->title]) }}"
@class([
'inline-flex min-h-6 items-center gap-1 rounded border px-2 text-[10px] font-bold transition hover:opacity-90 focus-visible:outline-2 focus-visible:outline-primary-600 dark:focus-visible:outline-primary-300',
'border-amber-500/60 bg-amber-100 text-amber-900 dark:bg-amber-600/20 dark:text-amber-100' => $task->pinnedToBoard,
'border-indigo-500/60 bg-indigo-100 text-indigo-900 dark:bg-indigo-600/20 dark:text-indigo-100' => ! $task->pinnedToBoard,
])
>
<x-icon name="map-pin" class="size-3" aria-hidden="true" />
{{ $task->pinnedToBoard ? __('jobs.board.unpin') : __('jobs.board.pin') }}
</button>
@endif
@if ($task->assigneeFirstName() !== null)
<span class="text-[10px] font-semibold text-neutral-600 dark:text-neutral-200">{{ $task->assigneeFirstName() }}</span>
@endif
</div>
@elseif ($task->assigneeFirstName() !== null)
<span class="shrink-0 text-[10px] font-semibold text-neutral-600 dark:text-neutral-200">{{ $task->assigneeFirstName() }}</span>
@endif
</li>
@endforeach
</ul>
@if ($ongoing && $canManage)
<form wire:submit="addTask({{ $card->jobId }})" class="space-y-1 border-t border-neutral-200 pt-1 dark:border-[#32353b]">
<div class="flex gap-1">
<label for="new-task-{{ $card->jobId }}" class="sr-only">{{ __('jobs.board.new_task_label', ['job' => $card->number.' '.$card->title]) }}</label>
<input
id="new-task-{{ $card->jobId }}"
type="text"
wire:model="newTaskTitles.{{ $card->jobId }}"
maxlength="255"
placeholder="+ {{ __('jobs.board.new_task') }}…"
class="min-w-0 flex-1 rounded border border-neutral-400 bg-white px-2 py-1 text-[11px] text-neutral-900 placeholder:text-neutral-600 dark:border-[#6b7079] dark:bg-[#16171a] dark:text-white dark:placeholder:text-neutral-300"
/>
<button type="submit" class="min-h-6 shrink-0 rounded bg-primary-600 px-2 text-[11px] font-bold text-white hover:bg-primary-700 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary-600 dark:focus-visible:outline-primary-300">
{{ __('jobs.board.add_task') }}
</button>
</div>
@error('newTaskTitles.'.$card->jobId)
<p class="text-[11px] font-semibold text-red-700 dark:text-red-200">{{ $message }}</p>
@enderror
<label class="flex cursor-pointer items-center gap-1.5 text-[10px] text-neutral-700 select-none dark:text-neutral-200">
<input type="checkbox" wire:model="newTaskPins.{{ $card->jobId }}" class="size-4 rounded border-neutral-500 text-indigo-600 dark:border-neutral-400 dark:bg-[#16171a]" />
<span>{{ __('jobs.board.pin_new') }}</span>
</label>
</form>
@endif