@php $isConnected = $integration && $integration->isConnected(); @endphp @php $trelloIcon = ''; @endphp @if (!$isConnected) {{-- ═══════════════ NOT CONNECTED ═══════════════ --}}
{{ __('Integrations') }}/{{ __('Trello') }}

{{ __('Connect') }} {{ __('Trello') }}

{{ __('When a card is assigned (or added, changed, or deleted) on your board, the right person gets a WhatsApp message — so tasks never sit unseen.') }}

@if (session('error') || $errors->any())
{{ session('error') ?: $errors->first() }}
@endif @if (!$enabled)
{{ __("Trello isn't enabled yet") }}

{{ __('An administrator must enable the Trello integration before your workspace can connect.') }}

@else
{{ __('Step 3') }}

{{ __('Board credentials') }}

@csrf
@if ($senders->isNotEmpty())
{{ __('The connected number card notifications send through. You run more than one — pick the right one.') }}
@endif
{{ __('Webhook callback · auto-registered on connect') }}
{{ $callbackUrl }}
@endif
@else {{-- ═══════════════ CONNECTED — redesigned ═══════════════ --}} @php $total = $logs->count(); $okCount = $logs->filter(fn ($l) => $l->status === 'ok')->count(); $failCount = $total - $okCount; $lastLog = $logs->first(); $ev = $integration->enabledEvents(); @endphp @if (session('status'))
{{ session('status') }}
@endif
{{ __('Integrations') }}/{{ __('Trello') }}
{{-- HERO BANNER --}}
{!! $trelloIcon !!}

{{ $integration->board_name ?: __('Trello board') }}

{{ __('Connected') }}
{{ __('Card activity on this board notifies the right person on WhatsApp.') }}
@unless ($integration->webhook_id)
@csrf
@endunless {{ __('Manage') }}
{{-- KPI ROW --}}
{{ __('Events') }}
{{ number_format($total) }}
{{ __('recent total') }}
{{ __('Notified') }}
{{ number_format($okCount) }}
{{ __('sent to WhatsApp') }}
{{ __('Failed') }}
{{ number_format($failCount) }}
{{ __('no match / error') }}
{{ __('Webhook') }}
{{ $integration->webhook_id ? __('Active') : __('Missing') }}
{{ $integration->webhook_id ? __('delivering events') : __('re-register it') }}
{{-- ACTIVITY + TRIGGERS --}}

{{ __('Recent activity') }}

{{ $total }}
@forelse ($logs as $log) @empty @endforelse
{{ __('Event') }}{{ __('When') }}{{ __('Status') }}
{{ $log->detail ?: $log->event }} {{ $log->created_at?->diffForHumans() }} {{ $log->status }}
{{ __('No card events yet.') }}
{{-- SETTINGS (events + notify) --}}
@csrf

{{ __('Notification settings') }}

{{ __('Notify on') }}
@foreach (['addMemberToCard' => __('Card assigned'), 'createCard' => __('Card added'), 'updateCard' => __('Card updated'), 'deleteCard' => __('Card deleted')] as $key => $label) @endforeach
@if ($senders->isNotEmpty())
{{ __('Send from') }} ({{ __('which WhatsApp number') }})
{{ __('You run more than one number — pick which one card notifications send through.') }}
@endif
@unless ($integration->webhook_id) {{ __('Webhook not registered — re-register it above to receive events.') }} @endunless
{{-- Disconnect (separate card — never nest forms) --}}
{{ __('Disconnect this board') }}

{{ __('Removes the registered Trello webhook and clears the stored credentials.') }}

@csrf
@endif