@extends('layouts.app') @section('page-title', __('app.nav.tickets')) @section('content')
@foreach (['mine' => __('app.ticket.my_open_tickets'), 'active' => __('app.ticket.status.new').' / '.__('app.ticket.status.open'), 'new' => __('app.ticket.status.new'), 'open' => __('app.ticket.status.open'), 'pending_customer' => __('app.ticket.status.pending_customer'), 'resolved' => __('app.ticket.status.resolved'), 'closed' => __('app.ticket.status.closed')] as $key => $label) {{ $label }} @endforeach
@if ($categories->isNotEmpty())
{{ __('app.ticket.all_categories') }} @foreach ($categories as $category) {{ $category->name() }} @endforeach
@endif
@foreach ($availableColumns as $key => $labelKey) @if (in_array($key, $visibleColumns, true)) @endif @endforeach @forelse ($tickets as $ticket) @if (in_array('reference', $visibleColumns, true)) @endif @if (in_array('subject', $visibleColumns, true)) @endif @if (in_array('customer', $visibleColumns, true)) @endif @if (in_array('category', $visibleColumns, true)) @endif @if (in_array('status', $visibleColumns, true)) @endif @if (in_array('priority', $visibleColumns, true)) @endif @if (in_array('created_at', $visibleColumns, true)) @endif @if (in_array('last_communication_at', $visibleColumns, true)) @endif @if (in_array('last_communication_by', $visibleColumns, true)) @endif @if (in_array('assigned_to', $visibleColumns, true)) @endif @empty @endforelse
@if (in_array($key, $sortableColumns, true)) @php $nextDirection = ($currentSort === $key && $currentDirection === 'asc') ? 'desc' : 'asc'; $sortUrl = route('tickets.index', array_merge(request()->except(['sort', 'direction', 'page']), ['sort' => $key, 'direction' => $nextDirection])); @endphp {{ __($labelKey) }} @if ($currentSort === $key) {{ $currentDirection === 'asc' ? '▲' : '▼' }} @endif @else {{ __($labelKey) }} @endif
{{ $ticket->reference }}{{ \Illuminate\Support\Str::limit($ticket->subject, 40) }}{{ $ticket->customer?->name ?? '—' }} @if ($ticket->category) {{ $ticket->category->name() }} @else — @endif {{ __('app.ticket.status.'.$ticket->status) }}{{ __('app.ticket.priority.'.$ticket->priority) }}{{ $ticket->created_at->format('d.m.Y H:i') }}{{ $ticket->last_activity_at?->format('d.m.Y H:i') ?? '—' }}{{ $ticket->latestCommunicatorName() ?? '—' }}{{ $ticket->assignedUser?->name ?? '—' }}
{{ __('app.ticket.none_found') }}
{{ $tickets->links() }}
@endsection