phases one of time logged now with log display

This commit is contained in:
Mark Gregory
2026-06-22 12:53:56 +01:00
parent c1a9d0de27
commit 052bae718e
231 changed files with 15113 additions and 12891 deletions
@@ -1,23 +1,31 @@
<x-layouts.app>
<div class="mx-auto max-w-[1400px] space-y-6" dusk="countries-show">
<div class="overflow-hidden rounded-3xl border border-zinc-200 bg-white shadow-sm dark:border-zinc-700 dark:bg-zinc-900">
<div
class="overflow-hidden rounded-3xl border border-zinc-200 bg-white shadow-sm dark:border-zinc-700 dark:bg-zinc-900">
<div class="bg-gradient-to-br from-slate-950 via-slate-900 to-blue-950 px-6 py-7 text-white">
<div class="flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between">
<div>
<p class="text-xs font-semibold uppercase tracking-[0.28em] text-blue-200">ISO 3166 country</p>
<h1 class="mt-2 text-3xl font-semibold tracking-tight">{{ $country->flag_emoji }} {{ $country->effective_name }}</h1>
<p class="mt-2 max-w-3xl text-sm text-blue-100/90">{{ $country->official_name ?: $country->name }}</p>
<h1 class="mt-2 text-3xl font-semibold tracking-tight">{{ $country->flag_emoji }}
{{ $country->effective_name }}</h1>
<p class="mt-2 max-w-3xl text-sm text-blue-100/90">
{{ $country->official_name ?: $country->name }}</p>
</div>
<div class="flex flex-wrap gap-2">
<a href="{{ route('countries.edit', $country) }}" wire:navigate class="rounded-xl bg-blue-600 px-4 py-2.5 text-sm font-semibold text-white hover:bg-blue-700">Edit country</a>
<a href="{{ route('countries.index') }}" wire:navigate class="rounded-xl bg-white/10 px-4 py-2.5 text-sm font-semibold text-white ring-1 ring-white/20 hover:bg-white/20">Back</a>
<a href="{{ route('countries.edit', $country) }}" wire:navigate
class="rounded-xl bg-blue-600 px-4 py-2.5 text-sm font-semibold text-white hover:bg-blue-700">Edit
country</a>
<a href="{{ route('countries.index') }}" wire:navigate
class="rounded-xl bg-white/10 px-4 py-2.5 text-sm font-semibold text-white ring-1 ring-white/20 hover:bg-white/20">Back</a>
</div>
</div>
</div>
</div>
@if (session('success'))
<div class="rounded-2xl border border-emerald-200 bg-emerald-50 px-4 py-3 text-sm font-medium text-emerald-800 dark:border-emerald-900 dark:bg-emerald-950 dark:text-emerald-200">{{ session('success') }}</div>
<div
class="rounded-2xl border border-emerald-200 bg-emerald-50 px-4 py-3 text-sm font-medium text-emerald-800 dark:border-emerald-900 dark:bg-emerald-950 dark:text-emerald-200">
{{ session('success') }}</div>
@endif
@php
@@ -31,7 +39,9 @@
'Display override' => $country->display_name ?: '—',
'Native name' => $country->native_name ?: '—',
'Capital' => $country->capital ?: '—',
'ISO status' => str($country->iso_status ?? 'official')->replace('_', ' ')->title(),
'ISO status' => str($country->iso_status ?? 'official')
->replace('_', ' ')
->title(),
'Sovereignty status' => $country->sovereignty_status ?: '—',
'Independent' => is_null($country->independent) ? '—' : ($country->independent ? 'Yes' : 'No'),
'UN member' => is_null($country->un_member) ? '—' : ($country->un_member ? 'Yes' : 'No'),
@@ -59,16 +69,19 @@
<div class="grid gap-4 md:grid-cols-2 xl:grid-cols-4">
@foreach ($fields as $label => $value)
<div class="rounded-2xl border border-zinc-200 bg-white p-5 shadow-sm dark:border-zinc-700 dark:bg-zinc-900">
<div
class="rounded-2xl border border-zinc-200 bg-white p-5 shadow-sm dark:border-zinc-700 dark:bg-zinc-900">
<div class="text-xs font-bold uppercase tracking-wide text-zinc-500">{{ $label }}</div>
<div class="mt-2 break-words text-base font-semibold text-zinc-900 dark:text-zinc-100">{{ $value }}</div>
<div class="mt-2 break-words text-base font-semibold text-zinc-900 dark:text-zinc-100">
{{ $value }}</div>
</div>
@endforeach
</div>
<div class="grid gap-4 lg:grid-cols-3">
@foreach (['Languages' => $country->languages, 'Timezones' => $country->timezones, 'Metadata' => $country->metadata] as $label => $value)
<div class="rounded-2xl border border-zinc-200 bg-white p-5 shadow-sm dark:border-zinc-700 dark:bg-zinc-900">
<div
class="rounded-2xl border border-zinc-200 bg-white p-5 shadow-sm dark:border-zinc-700 dark:bg-zinc-900">
<h2 class="text-sm font-semibold text-zinc-900 dark:text-zinc-100">{{ $label }}</h2>
<pre class="mt-3 max-h-80 overflow-auto rounded-xl bg-zinc-950 p-4 text-xs text-zinc-100">{{ $value ? json_encode($value, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) : '—' }}</pre>
</div>
@@ -77,11 +90,14 @@
@if ($country->address_format || $country->flag_svg_url || $country->flag_png_url)
<div class="grid gap-4 lg:grid-cols-3">
<div class="rounded-2xl border border-zinc-200 bg-white p-5 shadow-sm dark:border-zinc-700 dark:bg-zinc-900 lg:col-span-2">
<div
class="rounded-2xl border border-zinc-200 bg-white p-5 shadow-sm dark:border-zinc-700 dark:bg-zinc-900 lg:col-span-2">
<h2 class="text-sm font-semibold text-zinc-900 dark:text-zinc-100">Address format</h2>
<pre class="mt-3 whitespace-pre-wrap rounded-xl bg-zinc-100 p-4 text-sm text-zinc-700 dark:bg-zinc-950 dark:text-zinc-200">{{ $country->address_format ?: '—' }}</pre>
<pre
class="mt-3 whitespace-pre-wrap rounded-xl bg-zinc-100 p-4 text-sm text-zinc-700 dark:bg-zinc-950 dark:text-zinc-200">{{ $country->address_format ?: '—' }}</pre>
</div>
<div class="rounded-2xl border border-zinc-200 bg-white p-5 shadow-sm dark:border-zinc-700 dark:bg-zinc-900">
<div
class="rounded-2xl border border-zinc-200 bg-white p-5 shadow-sm dark:border-zinc-700 dark:bg-zinc-900">
<h2 class="text-sm font-semibold text-zinc-900 dark:text-zinc-100">Flag assets</h2>
<div class="mt-3 space-y-2 text-sm text-zinc-600 dark:text-zinc-300">
<div>SVG: {{ $country->flag_svg_url ?: '—' }}</div>
@@ -92,38 +108,51 @@
@endif
<div class="overflow-hidden rounded-2xl border border-zinc-200 bg-white shadow-sm dark:border-zinc-700 dark:bg-zinc-900">
<div
class="overflow-hidden rounded-2xl border border-zinc-200 bg-white shadow-sm dark:border-zinc-700 dark:bg-zinc-900">
<div class="border-b border-zinc-200 px-5 py-4 dark:border-zinc-800">
<h2 class="text-sm font-semibold text-zinc-900 dark:text-zinc-100">WMS usage report</h2>
<p class="text-xs text-zinc-500">Best-effort counts across known WMS tables. Missing optional tables are skipped safely.</p>
<p class="text-xs text-zinc-500">Best-effort counts across known WMS tables. Missing optional tables are
skipped safely.</p>
</div>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-zinc-200 dark:divide-zinc-800">
<thead class="bg-zinc-50 dark:bg-zinc-950">
<tr>
<th class="px-4 py-3 text-left text-xs font-bold uppercase tracking-wide text-zinc-500">Area</th>
<th class="px-4 py-3 text-left text-xs font-bold uppercase tracking-wide text-zinc-500">Table</th>
<th class="px-4 py-3 text-left text-xs font-bold uppercase tracking-wide text-zinc-500">Column</th>
<th class="px-4 py-3 text-right text-xs font-bold uppercase tracking-wide text-zinc-500">References</th>
<th class="px-4 py-3 text-left text-xs font-bold uppercase tracking-wide text-zinc-500">Area
</th>
<th class="px-4 py-3 text-left text-xs font-bold uppercase tracking-wide text-zinc-500">
Table</th>
<th class="px-4 py-3 text-left text-xs font-bold uppercase tracking-wide text-zinc-500">
Column</th>
<th class="px-4 py-3 text-right text-xs font-bold uppercase tracking-wide text-zinc-500">
References</th>
</tr>
</thead>
<tbody class="divide-y divide-zinc-100 dark:divide-zinc-800">
@forelse ($usageRows ?? [] as $row)
<tr>
<td class="px-4 py-3 text-sm font-semibold text-zinc-900 dark:text-zinc-100">{{ $row['label'] }}</td>
<td class="px-4 py-3 text-sm font-semibold text-zinc-900 dark:text-zinc-100">
{{ $row['label'] }}</td>
<td class="px-4 py-3 font-mono text-xs text-zinc-500">{{ $row['table'] }}</td>
<td class="px-4 py-3 font-mono text-xs text-blue-700 dark:text-blue-300">{{ $row['column'] }}</td>
<td class="px-4 py-3 text-right text-sm font-semibold text-zinc-900 dark:text-zinc-100">{{ number_format($row['count']) }}</td>
<td class="px-4 py-3 font-mono text-xs text-blue-700 dark:text-blue-300">
{{ $row['column'] }}</td>
<td class="px-4 py-3 text-right text-sm font-semibold text-zinc-900 dark:text-zinc-100">
{{ number_format($row['count']) }}</td>
</tr>
@empty
<tr><td colspan="4" class="px-4 py-8 text-center text-sm text-zinc-500">No country-aware WMS usage tables were detected yet.</td></tr>
<tr>
<td colspan="4" class="px-4 py-8 text-center text-sm text-zinc-500">No country-aware
WMS usage tables were detected yet.</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</div>
<div class="overflow-hidden rounded-2xl border border-zinc-200 bg-white shadow-sm dark:border-zinc-700 dark:bg-zinc-900">
<div
class="overflow-hidden rounded-2xl border border-zinc-200 bg-white shadow-sm dark:border-zinc-700 dark:bg-zinc-900">
<div class="border-b border-zinc-200 px-5 py-4 dark:border-zinc-800">
<h2 class="text-sm font-semibold text-zinc-900 dark:text-zinc-100">ISO 3166-2 subdivisions</h2>
<p class="text-xs text-zinc-500">Subdivisions support address, compliance and shipping workflows.</p>
@@ -132,37 +161,51 @@
<table class="min-w-full divide-y divide-zinc-200 dark:divide-zinc-800">
<thead class="bg-zinc-50 dark:bg-zinc-950">
<tr>
<th class="px-4 py-3 text-left text-xs font-bold uppercase tracking-wide text-zinc-500">Code</th>
<th class="px-4 py-3 text-left text-xs font-bold uppercase tracking-wide text-zinc-500">Name</th>
<th class="px-4 py-3 text-left text-xs font-bold uppercase tracking-wide text-zinc-500">Type</th>
<th class="px-4 py-3 text-left text-xs font-bold uppercase tracking-wide text-zinc-500">Status</th>
<th class="px-4 py-3 text-left text-xs font-bold uppercase tracking-wide text-zinc-500">Code
</th>
<th class="px-4 py-3 text-left text-xs font-bold uppercase tracking-wide text-zinc-500">Name
</th>
<th class="px-4 py-3 text-left text-xs font-bold uppercase tracking-wide text-zinc-500">Type
</th>
<th class="px-4 py-3 text-left text-xs font-bold uppercase tracking-wide text-zinc-500">
Status</th>
</tr>
</thead>
<tbody class="divide-y divide-zinc-100 dark:divide-zinc-800">
@forelse ($country->subdivisions as $subdivision)
<tr>
<td class="px-4 py-3 font-mono text-sm text-blue-700 dark:text-blue-300">{{ $subdivision->code }}</td>
<td class="px-4 py-3 text-sm font-semibold text-zinc-900 dark:text-zinc-100">{{ $subdivision->name }}</td>
<td class="px-4 py-3 font-mono text-sm text-blue-700 dark:text-blue-300">
{{ $subdivision->code }}</td>
<td class="px-4 py-3 text-sm font-semibold text-zinc-900 dark:text-zinc-100">
{{ $subdivision->name }}</td>
<td class="px-4 py-3 text-sm text-zinc-500">{{ $subdivision->type ?: '—' }}</td>
<td class="px-4 py-3 text-sm text-zinc-500">{{ str($subdivision->iso_status)->replace('_', ' ')->title() }}</td>
<td class="px-4 py-3 text-sm text-zinc-500">
{{ str($subdivision->iso_status)->replace('_', ' ')->title() }}</td>
</tr>
@empty
<tr><td colspan="4" class="px-4 py-8 text-center text-sm text-zinc-500">No subdivisions have been imported for this country yet.</td></tr>
<tr>
<td colspan="4" class="px-4 py-8 text-center text-sm text-zinc-500">No subdivisions
have been imported for this country yet.</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</div>
<form method="POST" action="{{ route('countries.destroy', $country) }}" class="rounded-2xl border border-red-200 bg-red-50 p-5 dark:border-red-900 dark:bg-red-950">
<form method="POST" action="{{ route('countries.destroy', $country) }}"
class="rounded-2xl border border-red-200 bg-red-50 p-5 dark:border-red-900 dark:bg-red-950">
@csrf
@method('DELETE')
<div class="flex flex-col gap-3 md:flex-row md:items-center md:justify-between">
<div>
<h2 class="text-sm font-semibold text-red-900 dark:text-red-100">Archive country</h2>
<p class="text-sm text-red-700 dark:text-red-200">Soft-deletes the record for administration. Do not archive countries referenced by active business data.</p>
<p class="text-sm text-red-700 dark:text-red-200">Soft-deletes the record for administration. Do not
archive countries referenced by active business data.</p>
</div>
<button type="submit" class="rounded-xl bg-red-600 px-4 py-2.5 text-sm font-semibold text-white hover:bg-red-700" onclick="return confirm('Archive this country?')">Archive</button>
<button type="submit"
class="rounded-xl bg-red-600 px-4 py-2.5 text-sm font-semibold text-white hover:bg-red-700"
onclick="return confirm('Archive this country?')">Archive</button>
</div>
</form>
</div>