Support ticket system
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<Page>
|
||||
<TopBar :breadcrumbs="breadcrumbs"/>
|
||||
<TopBar :breadcrumbs="breadcrumbs" />
|
||||
|
||||
<Content>
|
||||
<Container>
|
||||
@@ -16,23 +16,23 @@
|
||||
<li class="p-6 rounded shadow bg-surface-3">
|
||||
<div class="flex space-x-4">
|
||||
<div>
|
||||
<img :src="ticket.user.avatar" class="w-8 h-8 rounded-avatar bg-surface-2"/>
|
||||
<img :src="ticket.user.avatar" class="w-8 h-8 rounded-avatar bg-surface-2" />
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="font-semibold text-small text-body">{{ ticket.user.name }}</h3>
|
||||
<p class="text-medium-emphasis">{{ ticket.content }}</p>
|
||||
<p class="text-medium-emphasis">{{ ticket.content_html }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="p-6 rounded shadow bg-surface-3" v-for="reply in replies.data">
|
||||
<div class="flex space-x-4">
|
||||
<div>
|
||||
<img :src="reply.user.avatar" class="w-8 h-8 rounded-avatar bg-surface-2"/>
|
||||
<img :src="reply.user.avatar" class="w-8 h-8 rounded-avatar bg-surface-2" />
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="font-semibold text-small text-body">{{ reply.user.name }}</h3>
|
||||
<p class="text-medium-emphasis">
|
||||
{{ reply.content }}
|
||||
{{ reply.content_html }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
<form class="space-y-4" @submit.prevent="reply" v-if="ticket.status !== 'closed'">
|
||||
<FormTextarea :label="__('Reply')" :errors="$page.props.errors.reply"
|
||||
v-model="form.content"/>
|
||||
v-model="form.content" />
|
||||
|
||||
<FormActions>
|
||||
<Button>{{ __('Save') }}</Button>
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
@php use App\Models\SupportTicket;use App\Models\SupportTicketReply; @endphp
|
||||
@php
|
||||
/** @var SupportTicket $record */
|
||||
$messages = $record->replies->collect()->prepend($record);
|
||||
@endphp
|
||||
|
||||
<x-filament::page>
|
||||
<div class="w-full space-y-4">
|
||||
@foreach($messages as $message)
|
||||
<div class="flex flex-row flex-nowrap gap-x-4 bg-white rounded-md px-4 py-4">
|
||||
<div class="flex-grow-0 flex-shrink-0">
|
||||
<img src="{{ $message->user->avatar }}" alt="{{ $message->user->name }}" class="w-8 h-8 rounded-full">
|
||||
</div>
|
||||
<div class="">
|
||||
<h3 class="font-semibold">
|
||||
{{ $message->user->name }}
|
||||
</h3>
|
||||
<p>
|
||||
{!! $message->contentHtml !!}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<div>
|
||||
@if($record->status === SupportTicket::STATUS_CLOSED)
|
||||
<p>{{ __('Ticket closed.') }}</p>
|
||||
@else
|
||||
<form wire:submit.prevent="reply">
|
||||
{{ $this->form }}
|
||||
|
||||
<x-filament-support::button type="submit" class="mt-4">
|
||||
{{ __('Reply') }}
|
||||
</x-filament-support::button>
|
||||
</form>
|
||||
@endif
|
||||
</div>
|
||||
</x-filament::page>
|
||||
Reference in New Issue
Block a user