60 lines
3.9 KiB
PHP
60 lines
3.9 KiB
PHP
<x-filament-panels::page>
|
|
<div class="space-y-4">
|
|
<div class="rounded-xl border bg-white p-4">
|
|
<div class="flex flex-wrap items-center justify-between gap-3">
|
|
<div>
|
|
<div class="text-lg font-semibold">Posta stabile</div>
|
|
<div class="text-sm text-gray-600">
|
|
@if($stabile)
|
|
Caselle email e PEC collegate a {{ $stabile->denominazione ?: ('Stabile #' . $stabile->id) }}.
|
|
@endif
|
|
</div>
|
|
</div>
|
|
<a href="{{ \App\Filament\Pages\Condomini\StabilePage::getUrl(['stabile_id' => (int) ($stabile?->id ?? 0)], panel: 'admin-filament') }}" class="inline-flex items-center rounded-md bg-gray-800 px-3 py-1.5 text-xs font-medium text-white hover:bg-gray-700">Torna allo stabile</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="rounded-xl border border-sky-200 bg-sky-50 p-4">
|
|
<div class="flex flex-wrap items-start justify-between gap-3">
|
|
<div>
|
|
<div class="text-sm font-semibold text-sky-900">Account Google disponibili per posta stabile</div>
|
|
<div class="mt-1 text-xs text-sky-800">Collega qui un account di prova e un account dedicato allo stabile. Dopo il collegamento lo puoi selezionare nella casella Gmail qui sotto.</div>
|
|
</div>
|
|
<div class="flex flex-wrap gap-2">
|
|
<a href="{{ $this->getTestGoogleConnectUrl() }}" class="inline-flex items-center rounded-md bg-indigo-600 px-3 py-1.5 text-xs font-medium text-white hover:bg-indigo-500">Collega account Google test</a>
|
|
<a href="{{ $this->getStableGoogleConnectUrl() }}" class="inline-flex items-center rounded-md bg-emerald-600 px-3 py-1.5 text-xs font-medium text-white hover:bg-emerald-500">Collega account per questo stabile</a>
|
|
</div>
|
|
</div>
|
|
|
|
@if(count($this->getGoogleAccountsSummary()) > 0)
|
|
<div class="mt-3 grid gap-3 md:grid-cols-2">
|
|
@foreach($this->getGoogleAccountsSummary() as $account)
|
|
<div class="rounded-xl border bg-white p-3 text-xs shadow-sm">
|
|
<div class="flex items-start justify-between gap-2">
|
|
<div>
|
|
<div class="font-semibold text-slate-900">{{ $account['label'] ?: $account['key'] }}</div>
|
|
<div class="mt-1 text-slate-600">{{ $account['email'] ?: 'Email non disponibile' }}</div>
|
|
<div class="mt-1 text-[11px] {{ !empty($account['connected']) ? 'text-emerald-700' : 'text-rose-700' }}">{{ !empty($account['connected']) ? 'Collegato' : 'Non collegato' }}@if(!empty($account['is_default'])) · predefinito @endif</div>
|
|
</div>
|
|
<form method="POST" action="{{ route('oauth.google.disconnect') }}">
|
|
@csrf
|
|
<input type="hidden" name="account_key" value="{{ $account['key'] }}" />
|
|
<input type="hidden" name="return_to" value="{{ $this->getReturnUrl() }}" />
|
|
<button type="submit" class="rounded-md bg-rose-100 px-2 py-1 text-[11px] font-medium text-rose-700 hover:bg-rose-200">Disconnetti</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
@endif
|
|
</div>
|
|
|
|
<form wire:submit="save" class="space-y-4">
|
|
{{ $this->getSchema('form') }}
|
|
|
|
<div class="flex flex-wrap items-center gap-3">
|
|
<x-filament::button type="submit">Salva configurazione</x-filament::button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</x-filament-panels::page> |