Make some place on tickets.index
This commit is contained in:
parent
01edc8a2ae
commit
c8554b3d32
4 changed files with 278 additions and 197 deletions
|
|
@ -21,6 +21,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
|
|||
*/
|
||||
class TicketStatus extends BaseEnumRoutable
|
||||
{
|
||||
/**
|
||||
* Enum values
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected static function values(): array
|
||||
{
|
||||
return [
|
||||
|
|
@ -40,6 +45,11 @@ class TicketStatus extends BaseEnumRoutable
|
|||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Enum labels
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected static function labels(): array
|
||||
{
|
||||
return [
|
||||
|
|
@ -58,4 +68,40 @@ class TicketStatus extends BaseEnumRoutable
|
|||
'archived' => trans('Archivé'),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Enum classes
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected static function classes(): array
|
||||
{
|
||||
return [
|
||||
'new' => 'text-danger',
|
||||
'estimateTodo' => 'text-info',
|
||||
'estimateValidated' => 'text-info',
|
||||
'estimateDone' => 'text-info',
|
||||
'toPlan' => 'text-info',
|
||||
'planned' => 'text-info',
|
||||
'inprogress' => 'text-dark',
|
||||
'waiting' => 'text-white bg-danger',
|
||||
'waitingValidation' => 'text-warning bg-danger',
|
||||
'processed' => trans('Traité'),
|
||||
'recette' => 'text-primary',
|
||||
'production' => 'text-success',
|
||||
'archived' => 'text-secondary',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $attribute
|
||||
* @return integer|string
|
||||
*/
|
||||
public function __get(string $attribute)
|
||||
{
|
||||
if ($attribute === 'class') {
|
||||
return $this->classes()[$this->getDefinition()];
|
||||
}
|
||||
return parent::__get($attribute);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,11 @@ use Kwaadpepper\Enum\BaseEnumRoutable;
|
|||
*/
|
||||
class TicketType extends BaseEnumRoutable
|
||||
{
|
||||
/**
|
||||
* Enum values
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected static function values(): array
|
||||
{
|
||||
return [
|
||||
|
|
@ -22,6 +27,11 @@ class TicketType extends BaseEnumRoutable
|
|||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Enum labels
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected static function labels(): array
|
||||
{
|
||||
return [
|
||||
|
|
@ -31,4 +41,31 @@ class TicketType extends BaseEnumRoutable
|
|||
'newsletter' => trans('Demande newsletter')
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Enum classes
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected static function classes(): array
|
||||
{
|
||||
return [
|
||||
'bug' => 'bg-danger',
|
||||
'evolution' => 'bg-success',
|
||||
'br' => 'bg-primary',
|
||||
'newsletter' => 'bg-warning'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $attribute
|
||||
* @return integer|string
|
||||
*/
|
||||
public function __get(string $attribute)
|
||||
{
|
||||
if ($attribute === 'class') {
|
||||
return $this->classes()[$this->getDefinition()];
|
||||
}
|
||||
return parent::__get($attribute);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
7
resources/sass/bootstrap.scss
vendored
7
resources/sass/bootstrap.scss
vendored
|
|
@ -1,3 +1,10 @@
|
|||
@import 'variables';
|
||||
@import '~bootstrap/scss/bootstrap';
|
||||
@import 'bootswatch';
|
||||
|
||||
// OVERLOAD BOOTSTRAP
|
||||
.btn-xs, .btn-group-xs > .btn {
|
||||
padding: 0.1rem 0.4rem;
|
||||
font-size: 0.8rem;
|
||||
border-radius: 0.3rem;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,208 +5,199 @@
|
|||
$userPr = Auth::user()->sites ?? collect([]);
|
||||
@endphp
|
||||
<div class="container container-xxl">
|
||||
<h2>
|
||||
Gestion des tickets @if(request()->status) (Archivés) @endif
|
||||
<div class="float-end">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="btn-group float-end">
|
||||
<a href="{{ route('ticket.create') }}" class="btn btn-primary">{{ __('Créer un ticket') }}</a>
|
||||
@if(session('tickets.st') == TicketStatus::archived())
|
||||
<a href="{{ route('ticket.index', ['sts' => -1 ]) }}" class="btn btn-success">{{ __('Tickets Actifs') }}</a>
|
||||
@else
|
||||
<a href="{{ route('ticket.index', ['st' => TicketStatus::archived()]) }}" class="float-end btn btn-secondary">{{ __('Tickets Archivés') }}</a>
|
||||
@endif
|
||||
<a href="{{ route('ticket.index', ['rst' => 1]) }}" class="btn btn-dark">{{ __('Réinitialiser le tri') }}</a>
|
||||
</div>
|
||||
<div class="float-end me-2">
|
||||
<select class="form-select" onchange="window.location='{{ route('ticket.index') }}?'+(this.value == -1 ? 'prs=-1' : 'pr='+this.value);">
|
||||
<option value="-1">{{ __('Tous') }}</option>
|
||||
@foreach($sites as $site)
|
||||
@if (Auth::user()->isAdmin())
|
||||
<option value="{{ $site->id }}" @if(intval(session('tickets.pr'))==$site->id)selected="selected" @endif>{{ $site->name }}</option>
|
||||
@elseif ($userPr->filter(function($pr) use($site) { return $pr->id === $site->id; })->count())
|
||||
<option value="{{ $site->id }}" @if(intval(session('tickets.pr'))==$site->id)selected="selected" @endif>{{ $site->name }}</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="float-end me-2">
|
||||
<select class="form-select" onchange="window.location='{{ route('ticket.index') }}?'+(this.value == -1 ? 'sts=-1' : 'st='+this.value);">
|
||||
<option value="-1">{{ __('Tous') }}</option>
|
||||
@foreach($status as $statut)
|
||||
<option value="{{ $statut->value }}" @if(intval(session('tickets.st'))==$statut->value)selected="selected" @endif>{{ $statut->label }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="float-end mt-3 me-2">
|
||||
<select class="form-select" onchange="window.location='{{ route('ticket.index') }}?'+(this.value == -1 ? 'assr=-1' : 'ass='+this.value);">
|
||||
<option value="-1">{{ __('Tous') }}</option>
|
||||
@foreach(\App\Models\User::adminUsers() as $user)
|
||||
<option value="{{ $user->id }}" @if(intval(session('tickets.ass'))==$user->id)selected="selected" @endif>{{ $user->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<form id="searchTicketForm" class="float-end mt-3 w-75" action="{{ request()->fullUrlWithQuery(['search' => '']) }}">
|
||||
<div class="input-group mb-3">
|
||||
<input id="searchTicket" type="text" name="search" class="form-control" placeholder="{{ __('Recherche de ticket..') }}" aria-label="{{ __('Recherche de ticket..') }}" aria-describedby="searchTicket" value="{{ session()->get('tickets.search') }}">
|
||||
<button class="btn btn-outline-danger" type="button" onclick="document.getElementById('searchTicket').value = '';document.getElementById('searchTicketForm').submit();">⌫</button>
|
||||
<button class="btn btn-outline-primary" type="submit">🔍</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</h2>
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">
|
||||
#
|
||||
@include('modules.sorter', ['colname' => 'id'])
|
||||
</th>
|
||||
<th scope="col">
|
||||
{{__('Type') }}
|
||||
@include('modules.sorter', ['colname' => 'type'])
|
||||
</th>
|
||||
<th scope="col">{{__('Fichiers') }}</th>
|
||||
<th scope="col">
|
||||
{{__('Crée le') }}
|
||||
@include('modules.sorter', ['colname' => 'created_at'])
|
||||
</th>
|
||||
@if(Auth::user()->isAdmin())
|
||||
<th scope="col">
|
||||
{{__('Assigné à') }}
|
||||
@include('modules.sorter', ['colname' => 'assigned_to'])
|
||||
</th>
|
||||
@endif
|
||||
<th scope="col">
|
||||
{{__('Créé par') }}
|
||||
@include('modules.sorter', ['colname' => 'created_by'])
|
||||
</th>
|
||||
<th scope="col">
|
||||
{{__('Statut') }}
|
||||
@include('modules.sorter', ['colname' => 'status'])
|
||||
</th>
|
||||
<th scope="col">{{__('Contenu') }}</th>
|
||||
<th>{{__('Actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if(!count($tickets))
|
||||
<tr>
|
||||
<td colspan="10" class="text-center">
|
||||
<h2>{{ __('Aucun ticket') }}</h2>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@foreach ($tickets as $ticket)
|
||||
@php
|
||||
$cls = $ticket->status == TicketStatus::archived() ? 'text-secondary' : null;
|
||||
$cls = (!$cls && $ticket->status == TicketStatus::new()) ? 'text-danger' : $cls;
|
||||
$cls = (!$cls && $ticket->status == TicketStatus::processed()) ? 'text-info' : $cls;
|
||||
$cls = (!$cls && $ticket->status == TicketStatus::recette()) ? 'text-primary' : $cls;
|
||||
$cls = (!$cls && $ticket->status == TicketStatus::production()) ? 'text-success' : $cls;
|
||||
$cls = (!$cls && $ticket->status == TicketStatus::inprogress()) ? 'text-dark' : $cls;
|
||||
$cls = (!$cls && $ticket->status == TicketStatus::waiting()) ? 'text-white bg-danger' : $cls;
|
||||
$ticketClass = 'bg-primary';
|
||||
switch($ticket->type) {
|
||||
case TicketType::bug():
|
||||
$ticketClass = 'bg-danger';
|
||||
break;
|
||||
case TicketType::evolution():
|
||||
$ticketClass = 'bg-success';
|
||||
break;
|
||||
case TicketType::newsletter():
|
||||
$ticketClass = 'bg-warning';
|
||||
break;
|
||||
}
|
||||
@endphp
|
||||
<tr>
|
||||
<td scope="row">
|
||||
<div class="d-flex justify-content-between">
|
||||
<span class="me-1">{{ $ticket->id }} @if($ticket->is_internal)🔒@endif</span>
|
||||
<span class="text-end">{{ $ticket->site->name }}</span>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<span class="badge {{ $ticketClass }}">{{ $ticket->type->label }}</span>
|
||||
</td>
|
||||
<td>
|
||||
@if ($ticket->file !== null)
|
||||
<a data-fslightbox="gallery" href="{{ asset($ticket->file) }}" class="btn btn-sm btn-outline-primary" target="_blank">Fichier</a>
|
||||
@endif
|
||||
@if ($ticket->file2 !== null)
|
||||
<a data-fslightbox="gallery" href="{{ asset($ticket->file2) }}" class="btn btn-sm btn-outline-primary" target="_blank">Fichier 2</a>
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ Carbon\Carbon::parse($ticket->created_at)->format('d/m/Y à H:i') }}</td>
|
||||
@if(Auth::user()->isAdmin())
|
||||
<td>{{ $ticket->assignedUser ? $ticket->assignedUser->name : __('Personne') }}</td>
|
||||
@endif
|
||||
<td>{{ $ticket->user ? $ticket->user->name : __('Utilisateur supprimé') }}</td>
|
||||
<td><span class="rounded {{ $cls }}">{{ $ticket->status->label }}</span></td>
|
||||
<td>
|
||||
{{-- Modal du ticket --}}
|
||||
<!-- Button trigger modal -->
|
||||
<button type="button" class="btn btn-sm btn-outline-primary" data-bs-toggle="modal" data-bs-target="#ticket{{ $ticket->id }}Modal">
|
||||
{{ __('Aperçu') }}
|
||||
</button>
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="ticket{{ $ticket->id }}Modal" tabindex="-1" aria-labelledby="ticket{{ $ticket->id }}ModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="ticket{{ $ticket->id }}ModalLabel">
|
||||
<b>{{ $ticket->site->name }}</b> -
|
||||
<u>
|
||||
{{__('Ticket n°') }} {{ $ticket->id }}
|
||||
@if ($ticket->is_internal)
|
||||
🔒
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2 class="d-inline">Gestion des tickets @if(request()->status) (Archivés) @endif</h2>
|
||||
<div class="float-end">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="btn-group float-end">
|
||||
<a href="{{ route('ticket.create') }}" class="btn btn-primary">{{ __('Créer un ticket') }}</a>
|
||||
@if(session('tickets.st') == TicketStatus::archived())
|
||||
<a href="{{ route('ticket.index', ['sts' => -1 ]) }}" class="btn btn-success">{{ __('Tickets Actifs') }}</a>
|
||||
@else
|
||||
<a href="{{ route('ticket.index', ['st' => TicketStatus::archived()]) }}" class="float-end btn btn-secondary">{{ __('Tickets Archivés') }}</a>
|
||||
@endif
|
||||
<a href="{{ route('ticket.index', ['rst' => 1]) }}" class="btn btn-dark">{{ __('Réinitialiser le tri') }}</a>
|
||||
</div>
|
||||
<div class="float-end me-2">
|
||||
<div class="input-group">
|
||||
<label class="input-group-text" for="selectProject"><i class="fa-solid fa-diagram-project"></i></label>
|
||||
<select id="selectProject" class="form-select" onchange="window.location='{{ route('ticket.index') }}?'+(this.value == -1 ? 'prs=-1' : 'pr='+this.value);">
|
||||
<option value="-1">{{ __('Tous') }}</option>
|
||||
@foreach($sites as $site)
|
||||
@if (Auth::user()->isAdmin())
|
||||
<option value="{{ $site->id }}" @if(intval(session('tickets.pr'))==$site->id)selected="selected" @endif>{{ $site->name }}</option>
|
||||
@elseif ($userPr->filter(function($pr) use($site) { return $pr->id === $site->id; })->count())
|
||||
<option value="{{ $site->id }}" @if(intval(session('tickets.pr'))==$site->id)selected="selected" @endif>{{ $site->name }}</option>
|
||||
@endif
|
||||
</u> -
|
||||
<span class="badge {{ $ticketClass }}">
|
||||
{{$ticket->type->label}}
|
||||
</span>
|
||||
</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="{{ __('Fermer') }}"></button>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>{!! clean(nl2br($ticket->text)) !!}</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-primary" data-bs-dismiss="modal">{{ __('Fermer') }}</button>
|
||||
<div class="float-end me-2">
|
||||
<div class="input-group">
|
||||
<label class="input-group-text" for="selectStatus"><i class="fa-solid fa-sign-hanging"></i></label>
|
||||
<select id="selectStatus" class="form-select" onchange="window.location='{{ route('ticket.index') }}?'+(this.value == -1 ? 'sts=-1' : 'st='+this.value);">
|
||||
<option value="-1">{{ __('Tous') }}</option>
|
||||
@foreach($status as $statut)
|
||||
<option value="{{ $statut->value }}" @if(intval(session('tickets.st'))==$statut->value)selected="selected" @endif>{{ $statut->label }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="float-end mt-3 me-2">
|
||||
<div class="input-group">
|
||||
<label class="input-group-text" for="selectAssign"><i class="fa-solid fa-hat-wizard"></i></label>
|
||||
<select id="selectAssign" class="form-select" onchange="window.location='{{ route('ticket.index') }}?'+(this.value == -1 ? 'assr=-1' : 'ass='+this.value);">
|
||||
<option value="-1">{{ __('Tous') }}</option>
|
||||
@foreach(\App\Models\User::adminUsers() as $user)
|
||||
<option value="{{ $user->id }}" @if(intval(session('tickets.ass'))==$user->id)selected="selected" @endif>{{ $user->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<form id="searchTicketForm" class="float-end mt-3 w-75" action="{{ request()->fullUrlWithQuery(['search' => '']) }}">
|
||||
<div class="input-group mb-3">
|
||||
<input id="searchTicket" type="text" name="search" class="form-control" placeholder="{{ __('Recherche de ticket..') }}" aria-label="{{ __('Recherche de ticket..') }}" aria-describedby="searchTicket" value="{{ session()->get('tickets.search') }}">
|
||||
<button class="btn btn-outline-danger" type="button" onclick="document.getElementById('searchTicket').value = '';document.getElementById('searchTicketForm').submit();"><i class="fa-solid fa-delete-left"></i></button>
|
||||
<button class="btn btn-outline-primary" type="submit"><i class="fa-solid fa-magnifying-glass"></i></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ route('ticket.show', $ticket->id) }}" class="btn btn-sm btn-outline-success">{{ __('Messages') }}</a>
|
||||
@if(auth()->user()->isAdmin())
|
||||
<a href="{{ route('ticket.edit', $ticket) }}" class="btn btn-sm btn-outline-primary">{{ __('Modifier') }}</a>
|
||||
@endif
|
||||
@can('delete', $ticket)
|
||||
@if(!$ticket->status->equals(TicketStatus::archived()))
|
||||
<form method="POST" action="{{ route('ticket.archive', $ticket) }}">
|
||||
@method('PUT')
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-sm btn-outline-danger" onclick="return confirm('Êtes-vous sûr(e) ?')">{{ __('Archiver') }}</button>
|
||||
</form>
|
||||
@endif
|
||||
@endcan
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
{{ $tickets->withQueryString()->links() }}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">
|
||||
<span># </span>
|
||||
<span>@include('modules.sorter', ['colname' => 'id'])</span>
|
||||
</th>
|
||||
<th scope="col">
|
||||
<span>{{__('Type') }} </span>
|
||||
<span>@include('modules.sorter', ['colname' => 'type'])</span>
|
||||
</th>
|
||||
@if(Auth::user()->isAdmin())
|
||||
<th scope="col">
|
||||
<span>{{__('Assigné à') }} </span>
|
||||
<span>@include('modules.sorter', ['colname' => 'assigned_to'])</span>
|
||||
</th>
|
||||
@endif
|
||||
<th scope="col">
|
||||
<span>{{__('Créé par') }} </span>
|
||||
<span>@include('modules.sorter', ['colname' => 'created_by'])</span>
|
||||
</th>
|
||||
<th scope="col">
|
||||
<span>{{__('Le') }} </span>
|
||||
<span>@include('modules.sorter', ['colname' => 'created_at'])</span>
|
||||
</th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if(!count($tickets))
|
||||
<tr>
|
||||
<td colspan="@if(Auth::user()->isAdmin()) 6 @else 5 @endif" class="text-center">
|
||||
<h2>{{ __('Aucun ticket') }}</h2>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@foreach ($tickets as $ticket)
|
||||
<tr>
|
||||
<td scope="row">
|
||||
<div class="d-flex justify-content-between">
|
||||
<span class="me-1">{{ $ticket->id }} @if($ticket->is_internal)🔒@endif</span>
|
||||
<span class="d-flex flex-column text-end">
|
||||
<span class="text-decoration-underline">{{ $ticket->site->name }}</span>
|
||||
<span class="rounded text-center {{ $ticket->status->class }}">{{ $ticket->status->label }}</span>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span class="badge {{ $ticket->type->class }}">{{ $ticket->type->label }}</span>
|
||||
</td>
|
||||
@if(Auth::user()->isAdmin())
|
||||
<td>{{ $ticket->assignedUser ? $ticket->assignedUser->name : __('Personne') }}</td>
|
||||
@endif
|
||||
<td>{{ $ticket->user ? $ticket->user->name : __('Utilisateur supprimé') }}</td>
|
||||
<td>{{ Carbon\Carbon::parse($ticket->created_at)->format('d/m/Y à H:i') }}</td>
|
||||
<td>
|
||||
<div class="d-flex flex-column">
|
||||
<div>
|
||||
<div class="btn-group" role="group">
|
||||
@if ($ticket->file !== null)
|
||||
<a data-fslightbox="gallery{{ $ticket->id }}" href="{{ asset($ticket->file) }}" class="btn btn-outline-dark" target="_blank"><i class="fa-solid fa-file-image"></i></a>
|
||||
@endif
|
||||
@if ($ticket->file2 !== null)
|
||||
<a data-fslightbox="gallery{{ $ticket->id }}" href="{{ asset($ticket->file2) }}" class="btn btn-outline-dark {{ $ticket->file !== null ? 'd-none' : '' }}" target="_blank"></a>
|
||||
@endif
|
||||
{{-- Modal du ticket --}}
|
||||
<!-- Button trigger modal -->
|
||||
<button type="button" class="btn btn-outline-info" data-bs-toggle="modal" data-bs-target="#ticket{{ $ticket->id }}Modal"><i class="fa-solid fa-eye"></i></button>
|
||||
<a href="{{ route('ticket.show', $ticket->id) }}" class="btn btn-outline-success"><i class="fa-solid fa-comment"></i></a>
|
||||
@if(auth()->user()->isAdmin())
|
||||
<a href="{{ route('ticket.edit', $ticket) }}" class="btn btn-outline-primary"><i class="fa-solid fa-pen"></i></a>
|
||||
@endif
|
||||
@can('delete', $ticket)
|
||||
@if(!$ticket->status->equals(TicketStatus::archived()))
|
||||
<form method="POST" action="{{ route('ticket.archive', $ticket) }}">
|
||||
@method('PUT')
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-outline-danger" onclick="return confirm('Êtes-vous sûr(e) ?')"><i class="fa-solid fa-box-archive"></i></button>
|
||||
</form>
|
||||
@endif
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="ticket{{ $ticket->id }}Modal" tabindex="-1" aria-labelledby="ticket{{ $ticket->id }}ModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="ticket{{ $ticket->id }}ModalLabel">
|
||||
<b>{{ $ticket->site->name }}</b> -
|
||||
<u>
|
||||
{{__('Ticket n°') }} {{ $ticket->id }}
|
||||
@if ($ticket->is_internal)
|
||||
🔒
|
||||
@endif
|
||||
</u> -
|
||||
<span class="badge {{ $ticket->type->class }}">
|
||||
{{$ticket->type->label}}
|
||||
</span>
|
||||
</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="{{ __('Fermer') }}"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>{!! clean(nl2br($ticket->text)) !!}</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-primary" data-bs-dismiss="modal">{{ __('Fermer') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
{{ $tickets->withQueryString()->links() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue