Files
ladill-woo-manager/resources/views/woo/stores/index.blade.php
T
isaaccladandCursor 93bfc3e2d2
Deploy Ladill Woo Manager / deploy (push) Successful in 1m7s
Reorganize Woo Manager mobile header and store switcher placement.
Desktop store switcher now sits after search; mobile shows route-based page titles, bottom nav, and store switching inside the profile sheet.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 02:45:14 +00:00

56 lines
3.5 KiB
PHP

<x-user-layout>
<x-slot name="title">Stores</x-slot>
<div class="space-y-6">
<div class="flex flex-wrap items-start justify-between gap-4">
<div>
<h1 class="hidden text-xl font-semibold text-slate-900 lg:block">Stores</h1>
<p class="mt-1 text-sm text-slate-500">WooCommerce sites connected via the Ladill plugin.</p>
@if(! $hasPaidPlan)
<p class="mt-1 text-xs text-slate-500">{{ $storeCount }}/{{ min($storeLimit, 1) }} store(s) on free plan</p>
@endif
</div>
@if(! $hasPaidPlan && ! $canConnectMore)
<a href="{{ route('woo.pro.index') }}" class="rounded-xl bg-indigo-600 px-4 py-2 text-sm font-semibold text-white hover:bg-indigo-700">Upgrade for more stores</a>
@endif
</div>
<div class="overflow-hidden rounded-2xl border border-slate-200 bg-white">
@if($stores->isEmpty())
<p class="px-6 py-10 text-sm text-slate-500">No stores connected yet. Install the Ladill plugin on WordPress and click Connect with Ladill.</p>
@else
<div class="divide-y divide-slate-100">
@foreach($stores as $store)
<div class="flex flex-wrap items-center justify-between gap-4 px-6 py-5">
<div>
<p class="font-semibold text-slate-900">{{ $store->site_name ?? parse_url($store->site_url, PHP_URL_HOST) }}</p>
<p class="text-sm text-slate-500">{{ $store->site_url }}</p>
<p class="mt-1 text-xs text-slate-400">
Status: {{ ucfirst($store->status) }}
@if($store->connected_at)· Connected {{ $store->connected_at->diffForHumans() }}@endif
</p>
</div>
<div class="flex items-center gap-3">
@if($store->status === \App\Models\WooStore::STATUS_ACTIVE)
@if($currentStore?->id === $store->id)
<span class="rounded-lg bg-indigo-50 px-3 py-1.5 text-xs font-semibold text-indigo-700">Managing now</span>
@else
<form method="post" action="{{ route('woo.stores.switch') }}">
@csrf
<input type="hidden" name="store" value="{{ $store->id }}">
<button type="submit" class="rounded-lg border border-slate-200 px-3 py-1.5 text-xs font-semibold text-slate-700 hover:bg-slate-50">Switch to this store</button>
</form>
@endif
<form method="post" action="{{ route('woo.stores.destroy', $store) }}" onsubmit="return confirm('Disconnect this store?')">
@csrf @method('delete')
<button type="submit" class="rounded-lg border border-red-200 px-3 py-1.5 text-xs font-semibold text-red-600 hover:bg-red-50">Disconnect</button>
</form>
@endif
</div>
</div>
@endforeach
</div>
@endif
</div>
</div>
</x-user-layout>