@extends('layouts/client') @section('title', $ticket->subject) @section('styles') @endsection @section('scripts') @endsection @section('content') {{-- Banner --}}

{{ __('helpdesk.support.index') }}

{{ $ticket->subject }}

@include('shared/alerts')
{{-- Main: messages + reply --}}

{{ $ticket->subject }}

{{ __('helpdesk.support.show.index_description') }}

{{-- Messages timeline --}}
@foreach ($ticket->messages->groupBy(fn($msg) => $msg->created_at->translatedFormat('d M, Y')) as $date => $messages)

{{ $date }}

@foreach ($messages as $i => $message)
{{-- Avatar --}}
{{-- Content --}}

{!! $message->replyText($i, 'customer') !!}

@if($message->isCustomer() && $message->canEdit()) @endif
{!! $message->formattedMessage() !!}
@if ($message->hasAttachments($ticket->attachments))
@foreach ($message->getAttachments($ticket->attachments) as $attachment) {{ Str::limit($attachment->filename, 25) }} @endforeach
@endif
@if ($message->isStaff()) {{ $message->staffUsername() }} @elseif($message->isCustomer()) {{ $message->customer->excerptFullName() }} @endif ยท {{ $message->edited_at ? __('helpdesk.support.show.edited_at', ['date' => $message->edited_at->format('H:i')]) : $message->created_at->format('H:i') }}
@if($message->isCustomer() && $message->canEdit()) @endif @endforeach @endforeach
{{-- Reply or closed notice --}} @if ($ticket->isOpen())

{{ __('helpdesk.support.show.replyinticket') }}

@csrf @if ($errors->has('content')) @foreach ($errors->get('content') as $error)

{{ $error }}

@endforeach @endif @if (setting('helpdesk_allow_attachments'))
@include('shared/file2', ['name' => 'attachments', 'label' => __('helpdesk.support.attachments'), 'help' => __('helpdesk.support.attachments_help', ['size' => setting('helpdesk_attachments_max_size'), 'types' => formatted_extension_list(setting('helpdesk_attachments_allowed_types'))])])
@endif
@else

{{ $ticket->close_reason ? __('helpdesk.support.show.closed2', ['reason' => $ticket->close_reason]) : __('helpdesk.support.show.closed3') }}

@endif
{{-- Sidebar --}}
{{-- Users involved --}} @if (!empty($ticket->attachedUsers()))

Participants

@foreach ($ticket->attachedUsers() as $initials => $username)
{{ $initials }}
@endforeach
@endif {{-- Ticket info --}}

Informations

{{ __('helpdesk.department') }}

{{ $ticket->department->name }}

@if ($ticket->isValidRelated())

Service

{{ $ticket->related->relatedName() }}

@endif

{{ __('helpdesk.priority') }}

{{ __('global.created') }}

{{ $ticket->created_at->format('d/m/y H:i') }}

@if ($ticket->closed_at)

{{ __('helpdesk.support.show.closed_on', ['date' => '']) }}

{{ $ticket->closed_at->format('d/m/y H:i') }}

@endif
{{-- Attachments --}} @if ($ticket->attachments->isNotEmpty())

{{ __('helpdesk.support.attachments') }}

@foreach ($ticket->attachments as $attachment)
{{ Str::limit($attachment->filename, 22) }}
@endforeach
@endif {{-- Close / Reopen --}} @if ($ticket->isOpen())
@csrf @method('DELETE')
@else
@csrf
@endif
@endsection