- Time entries store who approved them and when. Approved hours are locked: cells, task page edits and removals are refused. - "Hyväksy viikko" in the weekly view approves the user's own week; subcontractors' hours are approved by management. - Management gets an approval page (unapproved weeks by person, recently approved weeks) and can open anyone's week read-only to approve it or cancel its approval, which only management may do. - Only management may move a done job back to an earlier status, which opens the lock on its hours and expenses; the history marks it. - The Clock contract gets now() for approval times. Co-Authored-By: Claude Opus 5.5 <[email protected]>
116 lines
6.1 KiB
PHP
116 lines
6.1 KiB
PHP
<!DOCTYPE html>
|
|
<html
|
|
lang="{{ str_replace('_', '-', app()->getLocale()) }}"
|
|
x-data="tallstackui_darkTheme({ default: 'system' })"
|
|
x-bind:class="{ 'dark': darkTheme }"
|
|
>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
<title>{{ $title ?? config('app.name') }}</title>
|
|
|
|
{{--
|
|
Apply the stored theme before the first paint. TallStackUI's
|
|
tallstackui_darkTheme() keeps it in localStorage ("dark-theme"),
|
|
but only runs once Alpine starts, which would flash the light theme.
|
|
Like the package, any value other than dark/light (true/false) means "system".
|
|
wire:navigate replaces the <html> attributes with the server's, which
|
|
drops the class, so it is applied again on every page swap.
|
|
--}}
|
|
<script>
|
|
(() => {
|
|
const applyStoredTheme = () => {
|
|
const stored = localStorage.getItem('dark-theme');
|
|
const dark = stored === 'dark' || stored === 'true'
|
|
|| (stored !== 'light' && stored !== 'false' && window.matchMedia('(prefers-color-scheme: dark)').matches);
|
|
document.documentElement.classList.toggle('dark', dark);
|
|
};
|
|
|
|
applyStoredTheme();
|
|
document.addEventListener('livewire:navigating', (event) => event.detail.onSwap(applyStoredTheme));
|
|
})();
|
|
</script>
|
|
|
|
<link rel="preconnect" href="https://fonts.bunny.net">
|
|
<link href="https://fonts.bunny.net/css?family=inter:400,500,600&display=swap" rel="stylesheet" />
|
|
|
|
@include('partials.tallstackui-script')
|
|
@livewireStyles
|
|
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
|
</head>
|
|
<body class="min-h-screen bg-white text-zinc-900 antialiased dark:bg-zinc-800 dark:text-zinc-100">
|
|
<a
|
|
href="#main-content"
|
|
class="sr-only focus:not-sr-only focus:fixed focus:start-4 focus:top-4 focus:z-50 focus:rounded-md focus:bg-white focus:px-4 focus:py-2 focus:text-zinc-900 focus:shadow-lg focus:outline-2 focus:outline-offset-2 focus:outline-blue-700"
|
|
>
|
|
{{ __('layout.skip_to_content') }}
|
|
</a>
|
|
|
|
@auth
|
|
<header class="border-b border-zinc-200 dark:border-zinc-700">
|
|
<div class="mx-auto flex max-w-5xl flex-wrap items-center gap-x-6 gap-y-2 px-4 py-3 sm:px-6">
|
|
<a href="{{ route('home') }}" wire:navigate class="rounded font-semibold text-zinc-700 hover:text-zinc-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-700 dark:text-zinc-200 dark:hover:text-white">
|
|
{{ config('app.name') }}
|
|
</a>
|
|
|
|
<nav aria-label="{{ __('layout.main_menu') }}" class="flex flex-1 flex-wrap items-center gap-1">
|
|
@include('partials.nav-item', ['route' => 'jobs.index', 'pattern' => ['jobs.index', 'jobs.show', 'jobs.create', 'jobs.edit'], 'label' => __('layout.jobs')])
|
|
|
|
@include('partials.nav-item', ['route' => 'jobs.board', 'pattern' => 'jobs.board', 'label' => __('layout.board')])
|
|
|
|
@include('partials.nav-item', ['route' => 'time.week', 'pattern' => ['time.week', 'time.task'], 'label' => __('layout.time')])
|
|
|
|
@include('partials.nav-item', ['route' => 'expenses.mine', 'pattern' => 'expenses.*', 'label' => __('layout.expenses')])
|
|
|
|
@can('jobs.manage')
|
|
@include('partials.nav-item', ['route' => 'jobs.quick', 'pattern' => 'jobs.quick', 'label' => __('layout.quick_intake')])
|
|
@endcan
|
|
|
|
@can('time.approve-others')
|
|
@include('partials.nav-item', ['route' => 'time.approvals', 'pattern' => 'time.approvals', 'label' => __('layout.approvals')])
|
|
@endcan
|
|
|
|
@can('customers.use')
|
|
@include('partials.nav-item', ['route' => 'customers.index', 'pattern' => 'customers.*', 'label' => __('layout.customers')])
|
|
@endcan
|
|
|
|
@can('catalog.manage')
|
|
@include('partials.nav-item', ['route' => 'catalog.index', 'pattern' => ['catalog.index', 'catalog.service-units.*', 'catalog.services.*', 'catalog.work-types.*'], 'label' => __('layout.catalog')])
|
|
|
|
@include('partials.nav-item', ['route' => 'catalog.prices', 'pattern' => ['catalog.prices', 'catalog.products.*', 'catalog.vat-rates.*', 'catalog.price-list'], 'label' => __('layout.prices')])
|
|
@elsecan('catalog.view-prices')
|
|
@include('partials.nav-item', ['route' => 'catalog.price-list', 'pattern' => 'catalog.price-list', 'label' => __('layout.prices')])
|
|
@endcan
|
|
|
|
@can('users.manage')
|
|
@include('partials.nav-item', ['route' => 'users.index', 'pattern' => 'users.*', 'label' => __('layout.users')])
|
|
@endcan
|
|
</nav>
|
|
|
|
<div class="flex flex-wrap items-center gap-3">
|
|
<span class="text-sm text-zinc-600 dark:text-zinc-300">{{ __('layout.signed_in_as', ['name' => auth()->user()->name]) }}</span>
|
|
|
|
@include('partials.theme-toggle')
|
|
|
|
<form method="POST" action="{{ route('logout') }}">
|
|
@csrf
|
|
<x-button submit subtle color="black" sm icon="arrow-right-start-on-rectangle" :text="__('layout.logout')" />
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
@else
|
|
<div class="flex justify-end px-4 pt-3 sm:px-6">
|
|
@include('partials.theme-toggle')
|
|
</div>
|
|
@endauth
|
|
|
|
<main id="main-content" tabindex="-1" class="focus:outline-none">
|
|
{{ $slot }}
|
|
</main>
|
|
|
|
@livewireScripts
|
|
</body>
|
|
</html>
|