Files
ladill-woo-manager/resources/views/woo/stores/index.blade.php
T
isaaccladandCursor 916538887f
Deploy Ladill Woo Manager / deploy (push) Successful in 43s
Hide plugin download panel once a store is connected.
The install/connect guide only shows on the Stores page when no stores exist.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 13:55:44 +00:00

76 lines
5.1 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>
@if($stores->isEmpty())
<div class="rounded-2xl border border-indigo-100 bg-indigo-50/60 p-6">
<div class="flex flex-wrap items-start justify-between gap-4">
<div class="max-w-xl">
<h2 class="text-sm font-semibold text-slate-900">Connect a WooCommerce store</h2>
<ol class="mt-2 list-decimal space-y-1 pl-5 text-sm text-slate-600">
<li>Download the Ladill plugin and upload it in WordPress under <strong>Plugins Add New Upload Plugin</strong>.</li>
<li>Activate <strong>Ladill Woo Manager</strong>, then open <strong>WooCommerce Ladill Woo</strong>.</li>
<li>Click <strong>Connect with Ladill</strong> and sign in to link your store.</li>
</ol>
</div>
<a href="{{ asset('downloads/ladill-woo-plugin.zip') }}?v={{ @filemtime(public_path('downloads/ladill-woo-plugin.zip')) ?: '1' }}" download
class="inline-flex shrink-0 items-center gap-2 rounded-xl bg-indigo-600 px-4 py-2.5 text-sm font-semibold text-white hover:bg-indigo-700">
<svg class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M4 16v2a2 2 0 002 2h12a2 2 0 002-2v-2M7 10l5 5 5-5M12 15V3"/></svg>
Download plugin (.zip)
</a>
</div>
</div>
@endif
<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>