{{-- Contacts table shared by the organisation's Contacts tab and the Contacts list. Expects: $contacts (iterable of Contact, with opportunities_count), $showOrganisation (bool). --}} @php $consentColours = ['granted' => 'emerald', 'withdrawn' => 'rose', 'unknown' => 'slate']; $columns = $showOrganisation ? 6 : 5; @endphp
@if ($showOrganisation) @endif @forelse ($contacts as $person) @if ($showOrganisation) @endif @empty @endforelse
{{ __('Name') }}{{ __('Organisation') }}{{ __('Role') }} {{ __('How to reach') }} {{ __('Marketing') }} {{ __('Actions') }}
{{ $person->name }} @if ($person->is_primary) {{ __('Main contact') }} @endif @if ($person->title || $person->department)

{{ collect([$person->title, $person->department])->filter()->implode(', ') }}

@endif
@if ($person->customer) {{ $person->customer->name }} @else {{ __('Not available') }} @endif {{ $person->decision_role ? __(\App\Models\Crm\Contact::DECISION_ROLES[$person->decision_role] ?? $person->decision_role) : __('Not known') }} @if ($person->email) {{ $person->email }} @endif @if ($person->phone) {{ $person->phone }} @endif @if (! $person->email && ! $person->phone) {{ __('No details yet') }} @endif @if ($person->preferred_channel) {{ __('Prefers :channel', ['channel' => __(\App\Models\Crm\Contact::CHANNELS[$person->preferred_channel] ?? $person->preferred_channel)]) }} @endif {{ __(\App\Models\Crm\Contact::CONSENTS[$person->marketing_consent] ?? 'Not recorded') }}
@can('update', $person) @endcan @can('delete', $person) @endcan