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]>
This commit is contained in:
@@ -72,3 +72,29 @@ html {
|
||||
@utility card {
|
||||
@apply rounded-xl border border-zinc-200 bg-white p-4 shadow-sm sm:p-5 dark:border-zinc-700 dark:bg-zinc-900;
|
||||
}
|
||||
|
||||
/* The Kanban board's horizontal scrollbar (docs/kanban-prototyyppi.html). */
|
||||
.kanban-scroll::-webkit-scrollbar {
|
||||
height: 10px;
|
||||
width: 8px;
|
||||
}
|
||||
|
||||
.kanban-scroll::-webkit-scrollbar-track {
|
||||
background: rgb(0 0 0 / 0.18);
|
||||
border-radius: 9999px;
|
||||
}
|
||||
|
||||
.kanban-scroll::-webkit-scrollbar-thumb {
|
||||
background: rgb(255 255 255 / 0.4);
|
||||
border-radius: 9999px;
|
||||
}
|
||||
|
||||
/* The card being dragged on the board, and the drop place. */
|
||||
[wire\:sort\:item].sortable-ghost {
|
||||
opacity: 0.45;
|
||||
}
|
||||
|
||||
[wire\:sort\:item].sortable-ghost > article {
|
||||
outline: 3px solid var(--color-indigo-400);
|
||||
outline-offset: 1px;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
{{--
|
||||
The customer-coloured top bar of a job card: the drag handle
|
||||
(wire:sort:handle) and a click target that opens the job editor. The
|
||||
keyboard opens the job from the title button below; the palette button
|
||||
changes the customer's colour for every card and the time sheet.
|
||||
--}}
|
||||
@props(['card', 'canMove' => false, 'canColor' => false])
|
||||
|
||||
@php
|
||||
$color = new \App\Modules\Shared\Domain\ValueObjects\HexColor($card->customerHeaderColor ?? '#23476a');
|
||||
$light = $color->isLight();
|
||||
@endphp
|
||||
|
||||
<div
|
||||
@if ($canMove) wire:sort:handle @endif
|
||||
wire:click="openJob({{ $card->jobId }})"
|
||||
title="{{ __('jobs.board.drag_hint') }}"
|
||||
style="background-color: {{ $color->value }}; color: {{ $color->textColor() }}"
|
||||
@class(['flex items-center justify-between gap-1 px-2 py-1 select-none', 'cursor-grab active:cursor-grabbing' => $canMove, 'cursor-pointer' => ! $canMove])
|
||||
>
|
||||
<div class="flex min-w-0 items-center gap-1">
|
||||
@if ($canMove)
|
||||
<x-icon name="ellipsis-vertical" class="size-3 shrink-0 opacity-80" aria-hidden="true" />
|
||||
@endif
|
||||
<span class="truncate text-[11px] font-extrabold tracking-tight">{{ $card->customerName }}</span>
|
||||
</div>
|
||||
<div class="flex shrink-0 items-center gap-1">
|
||||
<span @class(['rounded px-1.5 text-[10px] font-bold', 'bg-black/10' => $light, 'bg-white/20' => ! $light])>{{ $card->number }}</span>
|
||||
@if ($canColor)
|
||||
<button
|
||||
type="button"
|
||||
x-on:click.stop="$dispatch('color-picker:open', {{ Js::from([
|
||||
'id' => 'colour-picker',
|
||||
'title' => __('jobs.board.customer_color_title', ['customer' => $card->customerName]),
|
||||
'color' => $color->value,
|
||||
'method' => 'setCustomerColor',
|
||||
'args' => [$card->customerId],
|
||||
'resettable' => $card->customerHeaderColor !== null,
|
||||
]) }})"
|
||||
aria-label="{{ __('jobs.board.customer_color_button', ['customer' => $card->customerName]) }}"
|
||||
class="inline-flex size-6 items-center justify-center rounded hover:bg-black/15 focus-visible:outline-2 focus-visible:outline-current dark:hover:bg-white/15"
|
||||
>
|
||||
<x-icon name="swatch" class="size-3.5" aria-hidden="true" />
|
||||
</button>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,99 @@
|
||||
{{--
|
||||
A customer job card (docs/ui-kanban-board.md 4.1): customer bar, title
|
||||
that opens the job editor, responsible person, service unit, priority,
|
||||
due date, hours and the job's tasks, which open inside the card and can
|
||||
be marked done. Compact cards have three rows.
|
||||
--}}
|
||||
@props(['card', 'compact' => false, 'canMove' => false, 'canColor' => false, 'canCheck' => false])
|
||||
|
||||
@use('App\Modules\Jobs\Presentation\Support\BoardFormat')
|
||||
|
||||
@php
|
||||
$total = count($card->tasks);
|
||||
$done = $card->doneTaskCount();
|
||||
@endphp
|
||||
|
||||
<article
|
||||
aria-labelledby="card-{{ $card->key() }}-title"
|
||||
x-data="{ expanded: false }"
|
||||
class="overflow-hidden rounded-xl border border-neutral-300 bg-white shadow-sm transition dark:border-[#36393f] dark:bg-[#282a2e]"
|
||||
>
|
||||
<x-jobs.board.card-header :card="$card" :can-move="$canMove" :can-color="$canColor" />
|
||||
|
||||
<div @class(['space-y-1.5 p-1.5' => $compact, 'space-y-2 p-2.5' => ! $compact])>
|
||||
<h3 class="m-0" id="card-{{ $card->key() }}-title">
|
||||
<button
|
||||
type="button"
|
||||
id="card-{{ $card->key() }}-open"
|
||||
wire:click="openJob({{ $card->jobId }})"
|
||||
title="{{ $card->title }}"
|
||||
class="block w-full truncate rounded text-left text-[13px] font-bold text-neutral-900 hover:underline focus-visible:outline-2 focus-visible:outline-primary-600 dark:text-white dark:focus-visible:outline-primary-300"
|
||||
><span class="sr-only">{{ $card->number }} </span>{{ $card->title }}</button>
|
||||
</h3>
|
||||
|
||||
@if ($compact)
|
||||
<div class="flex items-center justify-between gap-1 text-[10px]">
|
||||
<div class="flex min-w-0 items-center gap-1">
|
||||
<x-jobs.board.person :initials="$card->responsibleInitials()" :name="$card->responsibleFirstName()" />
|
||||
<x-jobs.board.priority-badge :priority="$card->priority" />
|
||||
</div>
|
||||
@if ($total > 0)
|
||||
<button
|
||||
type="button"
|
||||
x-on:click="expanded = ! expanded"
|
||||
x-bind:aria-expanded="expanded.toString()"
|
||||
aria-controls="tasks-{{ $card->key() }}"
|
||||
aria-label="{{ __('jobs.board.tasks_compact', ['done' => $done, 'total' => $total]) }}"
|
||||
class="inline-flex min-h-6 shrink-0 items-center gap-0.5 rounded bg-neutral-100 px-1.5 text-[10px] font-bold text-neutral-800 transition hover:bg-neutral-200 focus-visible:outline-2 focus-visible:outline-primary-600 dark:bg-[#1e2023] dark:text-neutral-100 dark:hover:bg-[#32353b] dark:focus-visible:outline-primary-300"
|
||||
>
|
||||
{{ $done }}/{{ $total }}
|
||||
<x-icon name="chevron-down" class="size-3 transition" x-bind:class="expanded && 'rotate-180'" aria-hidden="true" />
|
||||
</button>
|
||||
@endif
|
||||
</div>
|
||||
@else
|
||||
<div class="flex items-center justify-between gap-1 text-[10px]">
|
||||
<x-jobs.board.person :initials="$card->responsibleInitials()" :name="$card->responsibleFirstName()" />
|
||||
<div class="flex min-w-0 items-center gap-1">
|
||||
@if ($card->serviceUnitName !== null)
|
||||
<span class="truncate rounded bg-neutral-100 px-1.5 py-0.5 font-medium text-neutral-700 dark:bg-[#1e2023] dark:text-neutral-200" title="{{ $card->serviceUnitName }}">{{ $card->serviceUnitName }}</span>
|
||||
@endif
|
||||
<x-jobs.board.priority-badge :priority="$card->priority" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="flex flex-wrap items-center gap-1.5 text-[10px] text-neutral-700 dark:text-neutral-200">
|
||||
@if ($card->isLate)
|
||||
<span class="inline-flex items-center gap-0.5 font-bold text-red-700 dark:text-red-200">
|
||||
<x-icon name="exclamation-triangle" class="size-3" aria-hidden="true" />{{ __('jobs.board.late', ['date' => BoardFormat::shortDate($card->dueOn)]) }}
|
||||
</span>
|
||||
@else
|
||||
<span class="font-medium">{{ __('jobs.board.due', ['date' => BoardFormat::shortDate($card->dueOn)]) }}</span>
|
||||
@endif
|
||||
<span aria-hidden="true">•</span>
|
||||
<span>{{ BoardFormat::cardHours($card) }}</span>
|
||||
</p>
|
||||
|
||||
@if ($total > 0)
|
||||
<div class="border-t border-neutral-200 pt-1 dark:border-[#36393f]">
|
||||
<button
|
||||
type="button"
|
||||
x-on:click="expanded = ! expanded"
|
||||
x-bind:aria-expanded="expanded.toString()"
|
||||
aria-controls="tasks-{{ $card->key() }}"
|
||||
class="flex min-h-6 w-full items-center justify-between rounded px-1.5 text-[11px] font-semibold text-neutral-800 transition hover:bg-neutral-100 focus-visible:outline-2 focus-visible:outline-primary-600 dark:text-neutral-100 dark:hover:bg-[#32353b] dark:focus-visible:outline-primary-300"
|
||||
>
|
||||
<span>{{ __('jobs.board.tasks_toggle', ['done' => $done, 'total' => $total]) }}</span>
|
||||
<x-icon name="chevron-down" class="size-3.5 transition" x-bind:class="expanded && 'rotate-180'" aria-hidden="true" />
|
||||
</button>
|
||||
</div>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@if ($total > 0)
|
||||
<div id="tasks-{{ $card->key() }}" x-show="expanded" x-cloak @class(['border-t border-neutral-200 pt-1 dark:border-[#36393f]' => $compact, 'mt-1.5' => ! $compact])>
|
||||
<x-jobs.board.task-list :card="$card" :can-check="$canCheck" :compact="$compact" />
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</article>
|
||||
@@ -0,0 +1,59 @@
|
||||
{{--
|
||||
A small header button that opens a list of choices (menuitemradio):
|
||||
the urgent threshold and a column's order. Escape and a click outside
|
||||
close it; focus returns to the button.
|
||||
|
||||
Props: `label` (the button's name), `heading`, `options` (value => text),
|
||||
`current` (value), `method` and `args` (the Livewire call, with the
|
||||
chosen value last), `active` (highlights the button).
|
||||
--}}
|
||||
@props(['id', 'label', 'heading', 'options', 'current', 'method', 'args' => [], 'active' => false])
|
||||
|
||||
<div class="relative" x-data="{ open: false }" x-on:keydown.escape.stop="if (open) { open = false; $refs.button.focus(); }" x-on:click.outside="open = false">
|
||||
<button
|
||||
type="button"
|
||||
x-ref="button"
|
||||
x-on:click="open = ! open; if (open) { $nextTick(() => $refs.menu.querySelector('[aria-checked=true]')?.focus()) }"
|
||||
x-bind:aria-expanded="open.toString()"
|
||||
aria-haspopup="menu"
|
||||
aria-controls="{{ $id }}"
|
||||
aria-label="{{ $label }}"
|
||||
title="{{ $label }}"
|
||||
@class([
|
||||
'inline-flex size-6 items-center justify-center rounded transition focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-current',
|
||||
'bg-black/20 ring-1 ring-current/40 dark:bg-white/25' => $active,
|
||||
'hover:bg-black/15 dark:hover:bg-white/15' => ! $active,
|
||||
])
|
||||
>
|
||||
{{ $slot }}
|
||||
</button>
|
||||
|
||||
<div
|
||||
id="{{ $id }}"
|
||||
x-ref="menu"
|
||||
x-show="open"
|
||||
x-cloak
|
||||
role="menu"
|
||||
aria-label="{{ $heading }}"
|
||||
class="absolute top-8 right-0 z-50 w-56 space-y-0.5 rounded-xl border border-neutral-300 bg-white p-1.5 text-neutral-900 shadow-2xl dark:border-[#3e4249] dark:bg-[#282a2e] dark:text-neutral-100"
|
||||
>
|
||||
<div class="px-2 py-1 text-[10px] font-bold tracking-wider text-neutral-600 uppercase dark:text-neutral-300" aria-hidden="true">{{ $heading }}</div>
|
||||
@foreach ($options as $value => $text)
|
||||
<button
|
||||
type="button"
|
||||
role="menuitemradio"
|
||||
aria-checked="{{ $value === $current ? 'true' : 'false' }}"
|
||||
wire:click="{{ $method }}({{ collect([...$args, $value])->map(fn ($arg) => Js::from($arg))->join(', ') }})"
|
||||
x-on:click="open = false; $refs.button.focus()"
|
||||
x-on:keydown.arrow-down.prevent="$el.nextElementSibling?.focus()"
|
||||
x-on:keydown.arrow-up.prevent="$el.previousElementSibling?.matches('button') && $el.previousElementSibling.focus()"
|
||||
class="flex w-full items-center justify-between rounded-lg px-2.5 py-1.5 text-left text-xs font-medium transition hover:bg-neutral-100 focus-visible:outline-2 focus-visible:outline-primary-600 dark:hover:bg-[#34373d] dark:focus-visible:outline-primary-300"
|
||||
>
|
||||
<span>{{ $text }}</span>
|
||||
@if ($value === $current)
|
||||
<x-icon name="check" class="size-4 text-primary-700 dark:text-primary-200" aria-hidden="true" />
|
||||
@endif
|
||||
</button>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,105 @@
|
||||
{{--
|
||||
A continuing / season job card (docs/ui-kanban-board.md 4.2): the next
|
||||
open task with a one-click "mark done", lifting tasks into the pipeline
|
||||
(PIN), and all periods and tasks with a quick add.
|
||||
--}}
|
||||
@props(['card', 'compact' => false, 'canMove' => false, 'canColor' => false, 'canCheck' => false, 'canManage' => false])
|
||||
|
||||
@php
|
||||
$total = count($card->tasks);
|
||||
$done = $card->doneTaskCount();
|
||||
$next = $card->nextOpenTask();
|
||||
@endphp
|
||||
|
||||
<article
|
||||
aria-labelledby="card-{{ $card->key() }}-title"
|
||||
x-data="{ expanded: false }"
|
||||
class="overflow-hidden rounded-xl border border-neutral-300 bg-white shadow-sm dark:border-[#36393f] dark:bg-[#282a2e]"
|
||||
>
|
||||
<x-jobs.board.card-header :card="$card" :can-move="$canMove" :can-color="$canColor" />
|
||||
|
||||
<div @class(['space-y-1.5 p-1.5' => $compact, 'space-y-2 p-2.5' => ! $compact])>
|
||||
<h3 class="m-0" id="card-{{ $card->key() }}-title">
|
||||
<button
|
||||
type="button"
|
||||
id="card-{{ $card->key() }}-open"
|
||||
wire:click="openJob({{ $card->jobId }})"
|
||||
title="{{ $card->title }}"
|
||||
class="block w-full truncate rounded text-left text-[13px] font-bold text-neutral-900 hover:underline focus-visible:outline-2 focus-visible:outline-primary-600 dark:text-white dark:focus-visible:outline-primary-300"
|
||||
><span class="sr-only">{{ $card->number }} </span>{{ $card->title }}</button>
|
||||
</h3>
|
||||
|
||||
<div class="flex items-center justify-between gap-1 text-[10px]">
|
||||
<div class="flex min-w-0 items-center gap-1">
|
||||
<x-jobs.board.person :initials="$card->responsibleInitials()" :name="$card->responsibleFirstName()" />
|
||||
<span class="truncate rounded bg-purple-100 px-1.5 py-0.5 font-bold text-purple-900 dark:bg-purple-950/90 dark:text-purple-100">{{ __('jobs.board.periods', ['done' => $done, 'total' => $total]) }}</span>
|
||||
</div>
|
||||
@if ($compact)
|
||||
<button
|
||||
type="button"
|
||||
x-on:click="expanded = ! expanded"
|
||||
x-bind:aria-expanded="expanded.toString()"
|
||||
aria-controls="tasks-{{ $card->key() }}"
|
||||
aria-label="{{ __('jobs.board.all_periods', ['done' => $done, 'total' => $total]) }}"
|
||||
class="inline-flex min-h-6 shrink-0 items-center gap-0.5 rounded bg-neutral-100 px-1.5 text-[10px] font-bold text-neutral-800 transition hover:bg-neutral-200 focus-visible:outline-2 focus-visible:outline-primary-600 dark:bg-[#1e2023] dark:text-neutral-100 dark:hover:bg-[#32353b] dark:focus-visible:outline-primary-300"
|
||||
>
|
||||
{{ $done }}/{{ $total }}
|
||||
<x-icon name="chevron-down" class="size-3 transition" x-bind:class="expanded && 'rotate-180'" aria-hidden="true" />
|
||||
</button>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@if (! $compact && $next !== null)
|
||||
<div class="space-y-1.5 rounded-lg border border-neutral-200 bg-neutral-100 p-2 dark:border-[#36393f] dark:bg-[#1e2023]">
|
||||
<p class="text-[10px] font-bold tracking-wider text-neutral-700 uppercase dark:text-neutral-200">{{ __('jobs.board.next_up') }}</p>
|
||||
<p class="text-xs leading-snug font-semibold text-neutral-900 dark:text-neutral-100">{{ $next->title }}</p>
|
||||
<div class="flex flex-wrap items-center gap-1.5 pt-0.5">
|
||||
@if ($canCheck)
|
||||
<button
|
||||
type="button"
|
||||
wire:click="setTaskDone({{ $card->jobId }}, {{ $next->id }}, true)"
|
||||
aria-label="{{ __('jobs.board.mark_done_label', ['task' => $next->title]) }}"
|
||||
class="inline-flex min-h-6 items-center gap-1 rounded bg-emerald-700 px-2 text-[10px] font-bold text-white transition hover:bg-emerald-800 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary-600 dark:focus-visible:outline-primary-300"
|
||||
>{{ __('jobs.board.mark_done') }} <x-icon name="check" class="size-3" aria-hidden="true" /></button>
|
||||
@endif
|
||||
@if ($canManage)
|
||||
<button
|
||||
type="button"
|
||||
wire:click="pinTask({{ $card->jobId }}, {{ $next->id }}, {{ $next->pinnedToBoard ? 'false' : 'true' }})"
|
||||
aria-label="{{ $next->pinnedToBoard ? __('jobs.board.unpin_label', ['task' => $next->title]) : __('jobs.board.pin_label', ['task' => $next->title]) }}"
|
||||
@class([
|
||||
'inline-flex min-h-6 items-center gap-1 rounded px-2 text-[10px] font-bold text-white transition focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary-600 dark:focus-visible:outline-primary-300',
|
||||
'bg-amber-700 hover:bg-amber-800' => $next->pinnedToBoard,
|
||||
'bg-indigo-600 hover:bg-indigo-700' => ! $next->pinnedToBoard,
|
||||
])
|
||||
>
|
||||
{{ $next->pinnedToBoard ? __('jobs.board.unpin') : __('jobs.board.pin') }}
|
||||
@unless ($next->pinnedToBoard)
|
||||
<x-icon name="arrow-up-right" class="size-3" aria-hidden="true" />
|
||||
@endunless
|
||||
</button>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@unless ($compact)
|
||||
<div class="border-t border-neutral-200 pt-1 dark:border-[#36393f]">
|
||||
<button
|
||||
type="button"
|
||||
x-on:click="expanded = ! expanded"
|
||||
x-bind:aria-expanded="expanded.toString()"
|
||||
aria-controls="tasks-{{ $card->key() }}"
|
||||
class="flex min-h-6 w-full items-center justify-between rounded px-1.5 text-[11px] font-semibold text-neutral-800 transition hover:bg-neutral-100 focus-visible:outline-2 focus-visible:outline-primary-600 dark:text-neutral-100 dark:hover:bg-[#32353b] dark:focus-visible:outline-primary-300"
|
||||
>
|
||||
<span>{{ __('jobs.board.all_periods', ['done' => $done, 'total' => $total]) }}</span>
|
||||
<x-icon name="chevron-down" class="size-3.5 transition" x-bind:class="expanded && 'rotate-180'" aria-hidden="true" />
|
||||
</button>
|
||||
</div>
|
||||
@endunless
|
||||
|
||||
<div id="tasks-{{ $card->key() }}" x-show="expanded" x-cloak class="space-y-1.5 border-t border-neutral-200 pt-1 dark:border-[#36393f]">
|
||||
<x-jobs.board.task-list :card="$card" :can-check="$canCheck" :can-manage="$canManage" ongoing :compact="$compact" />
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
@@ -0,0 +1,7 @@
|
||||
{{-- A person on a Kanban card: initials in a ball and the first name. --}}
|
||||
@props(['initials', 'name' => null])
|
||||
|
||||
<span {{ $attributes->class('inline-flex shrink-0 items-center gap-1 rounded bg-neutral-100 px-1.5 py-0.5 font-semibold text-neutral-800 dark:bg-[#1e2023] dark:text-neutral-100') }}>
|
||||
<span class="flex size-4 items-center justify-center rounded-full bg-primary-600 text-[9px] font-bold text-white" aria-hidden="true">{{ $initials }}</span>
|
||||
<span>{{ $name ?? '–' }}</span>
|
||||
</span>
|
||||
@@ -0,0 +1,22 @@
|
||||
{{--
|
||||
A Kanban card's priority badge: the text carries the meaning, the
|
||||
colour only supports it; "Heti" also gets the striped dot.
|
||||
--}}
|
||||
@props(['priority'])
|
||||
|
||||
@php
|
||||
$classes = match ($priority->value) {
|
||||
'immediate' => 'bg-orange-100 text-red-950 border-orange-400 dark:bg-orange-950 dark:text-orange-100 dark:border-orange-700',
|
||||
'urgent' => 'bg-red-100 text-red-900 border-red-300 dark:bg-red-950 dark:text-red-100 dark:border-red-800',
|
||||
'first' => 'bg-amber-100 text-amber-950 border-amber-300 dark:bg-amber-950 dark:text-amber-100 dark:border-amber-800',
|
||||
'waiting' => 'bg-blue-100 text-blue-900 border-blue-300 dark:bg-blue-950 dark:text-blue-100 dark:border-blue-800',
|
||||
default => 'bg-emerald-100 text-emerald-900 border-emerald-300 dark:bg-emerald-950 dark:text-emerald-100 dark:border-emerald-800',
|
||||
};
|
||||
@endphp
|
||||
|
||||
<span {{ $attributes->class(['inline-flex shrink-0 items-center gap-1 rounded border px-1.5 py-0.5 text-[10px] font-bold', $classes]) }}>
|
||||
@if ($priority->value === 'immediate')
|
||||
<span class="size-2 rounded-full bg-[repeating-linear-gradient(-45deg,#dc2626_0_5px,#ea580c_5px_10px)]" aria-hidden="true"></span>
|
||||
@endif
|
||||
{{ __('jobs.priorities.'.$priority->value) }}
|
||||
</span>
|
||||
@@ -0,0 +1,69 @@
|
||||
{{--
|
||||
A task of a continuing job lifted into the pipeline (docs/ui-kanban-board.md
|
||||
4.3): dashed border, indigo bar with "Vapauta", link to the parent job.
|
||||
Its column follows the task's status.
|
||||
--}}
|
||||
@props(['card', 'compact' => false, 'canMove' => false, 'canManage' => false])
|
||||
|
||||
@use('App\Modules\Jobs\Presentation\Support\BoardFormat')
|
||||
|
||||
|
||||
<article
|
||||
aria-labelledby="card-{{ $card->key() }}-title"
|
||||
class="overflow-hidden rounded-xl border-2 border-dashed border-indigo-400 bg-white shadow-md dark:border-indigo-400/80 dark:bg-[#282a2e]"
|
||||
>
|
||||
<div
|
||||
@if ($canMove) wire:sort:handle @endif
|
||||
wire:click="openJob({{ $card->jobId }})"
|
||||
title="{{ __('jobs.board.drag_hint') }}"
|
||||
@class(['flex items-center justify-between gap-1.5 bg-indigo-700 px-2.5 py-1 text-white select-none', 'cursor-grab active:cursor-grabbing' => $canMove, 'cursor-pointer' => ! $canMove])
|
||||
>
|
||||
<div class="flex min-w-0 items-center gap-1 text-[10px] font-extrabold tracking-wide uppercase">
|
||||
@if ($canMove)
|
||||
<x-icon name="ellipsis-vertical" class="size-3 shrink-0 opacity-80" aria-hidden="true" />
|
||||
@endif
|
||||
<x-icon name="map-pin" class="size-3 shrink-0" aria-hidden="true" />
|
||||
<span class="truncate">{{ __('jobs.board.task_card') }}</span>
|
||||
</div>
|
||||
@if ($canManage)
|
||||
<button
|
||||
type="button"
|
||||
wire:click.stop="pinTask({{ $card->jobId }}, {{ $card->taskId }}, false)"
|
||||
aria-label="{{ __('jobs.board.unpin_label', ['task' => $card->title]) }}"
|
||||
class="inline-flex min-h-6 shrink-0 items-center rounded bg-white/20 px-1.5 text-[10px] font-bold transition hover:bg-white/30 focus-visible:outline-2 focus-visible:outline-white"
|
||||
>{{ __('jobs.board.release') }}</button>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div @class(['space-y-1 p-1.5' => $compact, 'space-y-2 p-2.5' => ! $compact])>
|
||||
<p class="truncate text-[10px] font-semibold text-indigo-800 dark:text-indigo-200" title="{{ $card->customerName }} • {{ $card->jobName }}">
|
||||
<x-icon name="link" class="inline size-3" aria-hidden="true" /> {{ $card->customerName }} • {{ $card->jobName }}
|
||||
</p>
|
||||
|
||||
<h3 class="m-0" id="card-{{ $card->key() }}-title">
|
||||
<button
|
||||
type="button"
|
||||
id="card-{{ $card->key() }}-open"
|
||||
wire:click="openJob({{ $card->jobId }})"
|
||||
title="{{ $card->title }}"
|
||||
class="block w-full truncate rounded text-left text-[13px] font-bold text-neutral-900 hover:underline focus-visible:outline-2 focus-visible:outline-primary-600 dark:text-white dark:focus-visible:outline-primary-300"
|
||||
>{{ $card->title }}</button>
|
||||
</h3>
|
||||
|
||||
<div class="flex items-center justify-between gap-1 text-[10px]">
|
||||
<x-jobs.board.person :initials="$card->responsibleInitials()" :name="$card->responsibleFirstName()" />
|
||||
<div class="flex items-center gap-1">
|
||||
<x-jobs.board.priority-badge :priority="$card->priority" />
|
||||
@if ($compact)
|
||||
<span class="font-semibold text-neutral-700 dark:text-neutral-200">{{ BoardFormat::shortDate($card->dueOn) }}</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@unless ($compact)
|
||||
<p class="border-t border-neutral-200 pt-1.5 text-[10px] font-medium text-neutral-700 dark:border-[#36393f] dark:text-neutral-200">
|
||||
{{ BoardFormat::shortDate($card->dueOn) }} • {{ BoardFormat::cardHours($card) }}
|
||||
</p>
|
||||
@endunless
|
||||
</div>
|
||||
</article>
|
||||
@@ -0,0 +1,83 @@
|
||||
{{--
|
||||
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
|
||||
Reference in New Issue
Block a user