@php // Every "reason" resources/js/pwa.js can return, in the words a person can // act on. A bare "subscribe-failed" told nobody anything. $reasons = [ 'unsupported' => __('This browser cannot do notifications. Chrome, Edge, Firefox and Safari all can.'), 'not-configured' => __('Notifications are not switched on for this installation yet. An administrator has to set them up.'), 'ios-needs-install' => __('On iPhone and iPad, notifications only work once BillPro is installed. Add it to your home screen first, then come back here and try again.'), 'blocked' => __('Your browser is blocking notifications for this site. Open the padlock in the address bar and allow notifications, then try again.'), 'dismissed' => __('You closed the permission box without choosing. Try again when you are ready.'), 'no-worker' => __('BillPro could not start its background helper. This normally means the site is not on a secure (https) address.'), 'subscribe-failed' => __('Your browser refused to register for notifications. Try again, or restart the browser.'), 'server-refused' => __('The server would not record this device. Try again in a moment.'), 'unavailable' => __('Your browser is not offering to install right now. Use its own menu — look for "Install" or "Add to Home screen".'), 'ios-manual' => __('On iPhone and iPad: tap Share, then "Add to Home Screen".'), ]; @endphp
{{ __('Send a test') }} {{ __('Sending…') }} {{-- Browser-side feedback. Server-side actions use the usual banner. --}} {{-- Server not set up. Only worth saying to somebody who can fix it. --}} @if (! $pushConfigured)

{{ __('Notifications are not set up on this server yet.') }}

@if ($isAdmin)

{{ __('Run') }} php artisan billpro:push-keys {{ __('on the server, paste the two lines it prints into .env, then clear the config cache. Everything else on this page will start working straight away.') }}

@else

{{ __('You can still install BillPro on your phone. Ask an administrator to finish setting up alerts.') }}

@endif
@endif {{-- The two decisions, side by side. --}}
{{-- 1 · Alerts on this device --}}

{{ __('This device') }}

{{ __('Alerts on this device') }}

{{ __('An approval waiting on you, a job due today, a cash-up that does not balance — sent to this device the moment it happens, whether BillPro is open or not.') }}

{{-- State line. Says what is true right now, in one sentence. --}}
{{-- Sound is a browser-side preference for the in-app chime, so it is a switch rather than an action: nothing is submitted and there is nothing to wait for. The per-device switch in the table below is the other half — it governs a push that arrives with the app closed. --}}
{{ __('Sound in the app') }} {{ __('Chime when something arrives while you are looking at BillPro.') }}
{{-- iPhone dead end, stated before they hit it. --}}
{{-- 2 · Install --}}

{{ __('Home screen') }}

{{ __('Install BillPro') }}

{{ __('Put BillPro on your phone or desktop with its own icon. It opens full-screen with no address bar, starts faster, and on iPhone it is the only way notifications can work at all.') }}

{{-- No install event to offer, so tell them where their own browser hides it. This is the normal case on iOS and on Firefox, and on Chrome for a site already installed once. --}}
{{-- Devices --}}

{{ __('Your devices') }}

{{ __('Everywhere BillPro can reach you. Turning a device off here does not affect the others.') }}

@forelse ($devices as $device) @empty @endforelse
{{ __('Device') }} {{ __('Added') }} {{ __('Last alert') }} {{ __('Sound') }} {{ __('Actions') }}
@if ($renamingId === $device->id)
@else
{{ $device->device_label }} {{-- "this one" is the single most useful thing this table can say, and the server cannot know it. --}} {{ __('This device') }}
@endif
{{ $device->created_at?->timezone(config('app.display_timezone'))->format('j M Y') }} {{ $device->last_used_at?->timezone(config('app.display_timezone'))->diffForHumans() ?? __('Never') }}
{{ $device->sound ? __('On') : __('Silent') }}
{{-- What actually gets sent. Worth stating: the commonest reason people turn notifications off is not knowing what they signed up for. --}}

{{ __('What you will be told about') }}

{{ __('The same things that already appear in the bell — nothing extra, and never anything promotional. What reaches you depends on your role.') }}

{{-- Chip colours are spelled out rather than built from a tone name: Tailwind scans these files as plain text, so a class it never literally sees is a class it never emits. --}} @foreach ([ ['icon' => 'check-circle', 'chip' => 'bg-emerald-50 text-emerald-600', 'title' => __('Things waiting on your decision'), 'body' => __('Leave, staff loans, purchase orders, an invoice somebody wants voided.')], ['icon' => 'banknotes', 'chip' => 'bg-sky-50 text-sky-600', 'title' => __('Money'), 'body' => __('A customer has paid, a cash-up does not balance, a supplier bill is falling due.')], ['icon' => 'briefcase', 'chip' => 'bg-amber-50 text-amber-600', 'title' => __('Work'), 'body' => __('A job is due today, a walk-in is waiting at the counter, a quote is about to expire.')], ['icon' => 'users', 'chip' => 'bg-rose-50 text-rose-600', 'title' => __('People'), 'body' => __('Who has not clocked in, leave decisions, and your own payslip.')], ['icon' => 'calendar', 'chip' => 'bg-indigo-50 text-indigo-600', 'title' => __('The month end'), 'body' => __('Targets to set, a period to close, and Friday\'s week in review.')], ['icon' => 'sparkles', 'chip' => 'bg-violet-50 text-violet-600', 'title' => __('Nothing else'), 'body' => __('No marketing, no digests you did not ask for, no alerts from other workspaces.')], ] as $group)

{{ $group['title'] }}

{{ $group['body'] }}

@endforeach