- Dark indigo header and tinted page background; the mobile main menu gets its own row, in the same order as the keyboard reaches it. - Page titles with an icon chip (x-page-title, x-page, x-page-header) and card sections (x-panel, the card utility); x-table styled as a card with an indigo header row in AppServiceProvider::styleTables(). - Job and task statuses, late work, unapproved hours and stock states as badges with icon and text (x-status-badge, x-jobs.status, x-jobs.task-status), never colour alone. - Empty lists as x-empty-state; dashboard quick link tiles, week hour bars and trend arrows; Kanban columns and task cards edged by status; calendar today column and bar accents; quick sale, reports and machine console restyled; signed-out pages show the app name. - Focus rings use the primary colour in both themes (white in the header). - Document the components in CLAUDE.md; test the status badges. Co-Authored-By: Claude Opus 5.5 <[email protected]>
82 lines
3.2 KiB
PHP
82 lines
3.2 KiB
PHP
<?php
|
|
|
|
use App\Modules\Users\Application\UseCases\CheckLoginAllowed;
|
|
use App\Modules\Users\Application\UseCases\LoginPins;
|
|
use App\Modules\Users\Presentation\Livewire\Concerns\SignsInWithPassword;
|
|
use App\Modules\Users\Presentation\Livewire\Concerns\SignsInWithPin;
|
|
use Livewire\Attributes\Layout;
|
|
use Livewire\Component;
|
|
|
|
/**
|
|
* Signing in to the machine console's own session (spec 19.6), e.g. on a
|
|
* tablet next to the machine: with the user's own PIN code or with email
|
|
* and password. Returns to the console page that asked for it.
|
|
*/
|
|
new #[Layout('layouts.console')] class extends Component
|
|
{
|
|
use SignsInWithPassword;
|
|
use SignsInWithPin;
|
|
|
|
public bool $accessEnded = false;
|
|
|
|
public function mount(): void
|
|
{
|
|
$this->accessEnded = request()->query('access') === 'ended';
|
|
}
|
|
|
|
public function loginWithPin(LoginPins $pins): void
|
|
{
|
|
if ($this->signInWithPin($pins)) {
|
|
$this->redirectIntended(route('machines.console-picker'));
|
|
}
|
|
}
|
|
|
|
public function loginWithPassword(CheckLoginAllowed $checkLoginAllowed): void
|
|
{
|
|
$this->signInWithPassword($checkLoginAllowed);
|
|
|
|
$this->redirectIntended(route('machines.console-picker'));
|
|
}
|
|
|
|
public function render(): mixed
|
|
{
|
|
return $this->view()->title(__('users.console_login.title'));
|
|
}
|
|
};
|
|
?>
|
|
|
|
<div class="mx-auto max-w-3xl space-y-6 p-3 sm:p-6">
|
|
<h1 class="text-2xl font-semibold">{{ __('users.console_login.title') }}</h1>
|
|
|
|
<p>{{ __('users.console_login.intro') }}</p>
|
|
|
|
@if ($accessEnded)
|
|
<x-alert role="status" color="yellow" light icon="exclamation-triangle" :text="__('auth.account_disabled')" />
|
|
@elseif (session('status'))
|
|
<x-alert role="status" color="green" light icon="information-circle" :text="session('status')" />
|
|
@endif
|
|
|
|
<div class="grid gap-6 md:grid-cols-2">
|
|
<section aria-labelledby="console-login-pin" class="card space-y-4">
|
|
<h2 id="console-login-pin" class="text-xl font-semibold">{{ __('users.console_login.with_pin') }}</h2>
|
|
@if ($this->pinUsers === [])
|
|
<p>{{ __('users.pin_switch.no_users') }}</p>
|
|
@else
|
|
<form wire:submit="loginWithPin" class="space-y-4" novalidate>
|
|
<x-users.pin-fields :users="$this->pinUsers" />
|
|
<x-button submit icon="arrow-right-end-on-rectangle" :text="__('users.pin_switch.submit')" class="w-full" />
|
|
</form>
|
|
@endif
|
|
</section>
|
|
|
|
<section aria-labelledby="console-login-password" class="card space-y-4">
|
|
<h2 id="console-login-password" class="text-xl font-semibold">{{ __('users.console_login.with_password') }}</h2>
|
|
<form wire:submit="loginWithPassword" class="space-y-4" novalidate>
|
|
<x-input id="console-login-email" wire:model="email" type="email" :label="__('auth.email')" autocomplete="username" required />
|
|
<x-password-field id="console-login-password-field" wire:model="password" :label="__('auth.password_label')" autocomplete="current-password" required />
|
|
<x-button submit :text="__('auth.login')" class="w-full" />
|
|
</form>
|
|
</section>
|
|
</div>
|
|
</div>
|