- Dark theme page background is #5a5e60; text on it is lifted to zinc-200 / primary-100 and TallStackUI's dark labels, hints and checkbox labels are lightened so everything stays at 4.5:1. - Shared HexColor picks white or black text by the higher WCAG contrast; a native-dialog colour picker and a large work dialog component. - Customers get a header colour (customers.header_color), set on the customer page. - New job status Jatkuvat / Kausi (ongoing): open, never late, billed monthly like running jobs. - Kanban model: board columns and views, urgent threshold, per-user board preferences (density, column colours and sort), card positions, tasks of continuing jobs pinned to the board, MoveBoardCard and board queries with logged hours from TimeTracking. Co-Authored-By: Claude Opus 5.5 <[email protected]>
82 lines
3.2 KiB
PHP
82 lines
3.2 KiB
PHP
{{--
|
|
Customer choice of a job page using the PicksCustomer trait: a search
|
|
field whose results are buttons, the number of matches announced, and
|
|
"Lisää uusi asiakas" for a name not found. Once chosen, the customer is
|
|
shown as text with a "Vaihda asiakas" button.
|
|
--}}
|
|
@props([
|
|
'customerId',
|
|
'customerName',
|
|
'search',
|
|
'results',
|
|
'errorKey' => 'form.customer_id',
|
|
])
|
|
|
|
<div {{ $attributes->class('space-y-2') }}>
|
|
@if ($customerId !== '')
|
|
<p class="text-sm font-semibold text-gray-700 dark:text-dark-300">{{ __('jobs.fields.customer') }}</p>
|
|
<div class="flex flex-wrap items-center gap-3">
|
|
<span class="font-medium break-words">{{ $customerName }}</span>
|
|
<x-button
|
|
id="change-customer"
|
|
wire:click="clearCustomer"
|
|
subtle
|
|
color="black"
|
|
sm
|
|
:text="__('jobs.customer_picker.change')"
|
|
:aria-label="__('jobs.customer_picker.change').': '.$customerName"
|
|
/>
|
|
</div>
|
|
@else
|
|
<x-input
|
|
id="customer-search"
|
|
wire:model.live.debounce.300ms="customerSearch"
|
|
type="search"
|
|
icon="magnifying-glass"
|
|
:label="__('jobs.customer_picker.search')"
|
|
:hint="__('jobs.customer_picker.search_description')"
|
|
autocomplete="off"
|
|
required
|
|
/>
|
|
|
|
@error($errorKey)
|
|
<p class="text-sm text-red-700 dark:text-red-400">{{ $message }}</p>
|
|
@enderror
|
|
|
|
@if (mb_strlen(trim($search)) >= 2)
|
|
<p role="status" aria-live="polite" class="text-sm text-zinc-600 dark:text-zinc-200">
|
|
{{ trans_choice('jobs.customer_picker.results', count($results), ['count' => count($results)]) }}
|
|
</p>
|
|
|
|
<ul class="space-y-1">
|
|
@foreach ($results as $customer)
|
|
<li wire:key="customer-result-{{ $customer->id }}">
|
|
<button
|
|
type="button"
|
|
wire:click="selectCustomer({{ $customer->id }})"
|
|
class="w-full rounded-md px-3 py-2 text-left text-sm hover:bg-zinc-100 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 dark:focus-visible:outline-primary-300 dark:hover:bg-zinc-700"
|
|
aria-label="{{ __('jobs.customer_picker.choose', ['name' => $customer->name]) }}"
|
|
>
|
|
<span class="font-medium">{{ $customer->name }}</span>
|
|
@if ($customer->businessId !== null)
|
|
<span class="text-zinc-600 dark:text-zinc-200">{{ $customer->businessId }}</span>
|
|
@endif
|
|
</button>
|
|
</li>
|
|
@endforeach
|
|
</ul>
|
|
|
|
@can('customers.use')
|
|
<x-button
|
|
wire:click="createCustomer"
|
|
subtle
|
|
color="black"
|
|
sm
|
|
icon="plus"
|
|
:text="__('jobs.customer_picker.create', ['name' => trim($search)])"
|
|
/>
|
|
@endcan
|
|
@endif
|
|
@endif
|
|
</div>
|