interim fix for drop downs, BROKEN FIX, interinm fix

This commit is contained in:
Mark Gregory
2026-07-07 12:20:27 +01:00
parent d2c1f744c3
commit a12372963a
6 changed files with 132 additions and 50 deletions
+82 -46
View File
@@ -7,8 +7,6 @@
icon="fa-solid fa-building"
/>
@if (session('status'))
<div class="rounded-2xl bg-green-50 p-4 text-sm font-semibold text-green-700 ring-1 ring-green-200 dark:bg-green-950 dark:text-green-300 dark:ring-green-900">
{{ session('status') }}
@@ -30,47 +28,85 @@
</a>
</div>
<form method="POST" action="{{ route('platform.companies.store') }}" class="mt-5 grid gap-4 md:grid-cols-5">
<form method="POST" action="{{ route('platform.companies.store') }}" class="mt-6">
@csrf
<input
name="name"
value="{{ old('name') }}"
placeholder="Company name"
class="rounded-xl border-zinc-300 dark:border-zinc-700 dark:bg-zinc-950 dark:text-white"
required
>
<div class="grid gap-5 xl:grid-cols-[minmax(0,1.15fr)_minmax(0,1.15fr)_minmax(12rem,.75fr)_minmax(18rem,1.15fr)_auto] xl:items-end">
<div>
<label for="quick_company_name" class="block text-xs font-bold uppercase tracking-wide text-zinc-500 dark:text-zinc-400">Company</label>
<input
id="quick_company_name"
name="name"
value="{{ old('name') }}"
placeholder="Company name"
class="mt-2 h-12 w-full rounded-xl border-zinc-300 bg-white px-4 text-sm text-zinc-900 shadow-sm outline-none transition focus:border-blue-500 focus:ring-2 focus:ring-blue-500/30 dark:border-zinc-700 dark:bg-zinc-950 dark:text-white"
required
>
@error('name')
<p class="mt-1 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
@enderror
</div>
<input
name="billing_email"
value="{{ old('billing_email') }}"
placeholder="billing@example.com"
type="email"
class="rounded-xl border-zinc-300 dark:border-zinc-700 dark:bg-zinc-950 dark:text-white"
>
<div>
<label for="quick_billing_email" class="block text-xs font-bold uppercase tracking-wide text-zinc-500 dark:text-zinc-400">Billing email</label>
<input
id="quick_billing_email"
name="billing_email"
value="{{ old('billing_email') }}"
placeholder="billing@example.com"
type="email"
class="mt-2 h-12 w-full rounded-xl border-zinc-300 bg-white px-4 text-sm text-zinc-900 shadow-sm outline-none transition focus:border-blue-500 focus:ring-2 focus:ring-blue-500/30 dark:border-zinc-700 dark:bg-zinc-950 dark:text-white"
>
@error('billing_email')
<p class="mt-1 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
@enderror
</div>
<select name="status" class="rounded-xl border-zinc-300 dark:border-zinc-700 dark:bg-zinc-950 dark:text-white" required>
<option value="active" @selected(old('status', 'active') === 'active')>Active</option>
<option value="suspended" @selected(old('status') === 'suspended')>Suspended</option>
<option value="inactive" @selected(old('status') === 'inactive')>Inactive</option>
</select>
<div>
<label for="quick_status" class="block text-xs font-bold uppercase tracking-wide text-zinc-500 dark:text-zinc-400">Status</label>
<select
id="quick_status"
name="status"
class="mt-2 h-12 w-full rounded-xl border-zinc-300 bg-white px-4 text-sm text-zinc-900 shadow-sm outline-none transition focus:border-blue-500 focus:ring-2 focus:ring-blue-500/30 dark:border-zinc-700 dark:bg-zinc-950 dark:text-white"
required
>
<option value="active" @selected(old('status', 'active') === 'active')>Active</option>
<option value="suspended" @selected(old('status') === 'suspended')>Suspended</option>
<option value="inactive" @selected(old('status') === 'inactive')>Inactive</option>
</select>
@error('status')
<p class="mt-1 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
@enderror
</div>
<div class="wms-select2-field">
<select name="country_id" data-wms-select2 data-placeholder="Search country" class="rounded-xl border-zinc-300 dark:border-zinc-700 dark:bg-zinc-950 dark:text-white">
<option value="">Search country</option>
@foreach ($countries as $country)
<option value="{{ $country->id }}" @selected((int) old('country_id') === $country->id)>
{{ $country->effective_name ?? $country->name }}
</option>
@endforeach
</select>
<div class="wms-select2-field">
<label for="quick_country_id" class="block text-xs font-bold uppercase tracking-wide text-zinc-500 dark:text-zinc-400">Country</label>
<select
id="quick_country_id"
name="country_id"
data-wms-select2
data-placeholder="Search and select country"
class="mt-2 w-full"
>
<option value="">Search and select country</option>
@foreach ($countries as $country)
<option value="{{ $country->id }}" @selected((int) old('country_id') === $country->id)>
{{ $country->display_name ?: $country->common_name ?: $country->name }}
</option>
@endforeach
</select>
@error('country_id')
<p class="mt-1 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
@enderror
</div>
<button class="h-12 rounded-xl bg-green-600 px-6 text-sm font-bold text-white shadow-sm shadow-green-950/20 transition hover:bg-green-500 focus:outline-none focus:ring-2 focus:ring-green-500/40">
Create
</button>
</div>
<button class="rounded-xl bg-zinc-900 px-4 py-2 font-semibold text-white dark:bg-white dark:text-zinc-900">
Create
</button>
</form>
</div>
<div class="overflow-x-auto rounded-2xl bg-white shadow-sm ring-1 ring-zinc-200 dark:bg-zinc-900 dark:ring-zinc-800">
<table class="min-w-full text-sm">
<thead>
@@ -109,17 +145,17 @@
</td>
<td class="p-4">
<span class="inline-flex rounded-full px-2.5 py-1 text-xs font-semibold
@if ($company->is_system_company)
bg-blue-100 text-blue-700 dark:bg-blue-950 dark:text-blue-300
@elseif ($company->status === 'active')
bg-green-100 text-green-700 dark:bg-green-950 dark:text-green-300
@else
bg-red-100 text-red-700 dark:bg-red-950 dark:text-red-300
@endif
">
{{ $company->is_system_company ? 'System' : ucfirst($company->status) }}
</span>
<span class="inline-flex rounded-full px-2.5 py-1 text-xs font-semibold
@if ($company->is_system_company)
bg-blue-100 text-blue-700 dark:bg-blue-950 dark:text-blue-300
@elseif ($company->status === 'active')
bg-green-100 text-green-700 dark:bg-green-950 dark:text-green-300
@else
bg-red-100 text-red-700 dark:bg-red-950 dark:text-red-300
@endif
">
{{ $company->is_system_company ? 'System' : ucfirst($company->status) }}
</span>
</td>
<td class="p-4">