@php $editPermission = user()->permission('edit_notice'); $deletePermission = user()->permission('delete_notice'); @endphp

@lang('app.noticeDetails')

@if (!in_array('client', user_roles()) && (($editPermission == 'all' || ($editPermission == 'added' && $notice->added_by == user()->id) || ($editPermission == 'owned' && in_array($notice->to, user_roles())) || ($editPermission == 'both' && (in_array($notice->to, user_roles()) || $notice->added_by == user()->id))) || ($deletePermission == 'all' || ($deletePermission == 'added' && $notice->added_by == user()->id) || ($deletePermission == 'owned' && in_array($notice->to, user_roles())) || ($deletePermission == 'both' && (in_array($notice->to, user_roles()) || $notice->added_by == user()->id))))) @endif

{{$notice->to == 'employee' ? __('app.employee') : __('app.client')}}

@if (count($noticeEmployees) > 0)
@foreach ($noticeEmployees->take(3) as $item)
{{ $item->name }} @if($item->status == 'deactive') Inactive @endif
@endforeach
@if (count($noticeEmployees) > 3) @else
{{ count($noticeEmployees) }} {{ count($noticeEmployees) == 1 ? 'person' : 'people' }} assigned
@endif
@elseif (count($noticeClients) > 0)
@foreach ($noticeClients->take(3) as $item)
{{ $item->name }}
@endforeach
@if (count($noticeClients) > 3) @else
{{ count($noticeClients) }} {{ count($noticeClients) == 1 ? 'person' : 'people' }} assigned
@endif
@else -- @endif
@if (!is_null($notice->attachment)) @lang('app.viewAttachment') '/> @endif @if (in_array('admin', user_roles()))

@lang('app.readBy')

@if (count($readMembers) > 0)
@foreach ($readMembers->take(3) as $item) @if($notice->to == 'employee')
{{ $item->user->name }}
@else
{{ $item->name }}
@endif @endforeach
@if (count($readMembers) > 3) @else
{{ count($readMembers) }} {{ count($readMembers) == 1 ? 'person' : 'people' }} assigned
@endif
@else -- @endif
@endif

@lang('app.file')

@php $filesShowCount = 0; @endphp @forelse($notice->files as $file) @php $filesShowCount++; @endphp @empty @endforelse