|
1 | 1 | <x-layout-three-columns>
|
| 2 | + <div x-data="{ showReplyModal: false }"> |
2 | 3 | {{-- Desktop Buttons - Hidden on Mobile --}}
|
3 | 4 | <div class="hidden md:flex justify-between items-center mb-4">
|
4 | 5 | <a href="/support/tickets" class="inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 dark:bg-gray-800 dark:text-gray-300 dark:border-gray-600 dark:hover:bg-gray-700">
|
|
9 | 10 | </a>
|
10 | 11 | <div class="flex space-x-3">
|
11 | 12 | @if($supportTicket->status !== \App\SupportTicket\Status::CLOSED)
|
12 |
| - <button type="button" class="inline-flex items-center px-4 py-2 text-sm font-medium text-violet-700 bg-violet-100 border border-violet-200 rounded-lg hover:bg-violet-200 dark:bg-violet-900/30 dark:text-violet-300 dark:border-violet-800 dark:hover:bg-violet-900/50"> |
| 13 | + <button |
| 14 | + type="button" |
| 15 | + @click="showReplyModal = true" |
| 16 | + class="inline-flex items-center px-4 py-2 text-sm font-medium text-violet-700 bg-violet-100 border border-violet-200 rounded-lg hover:bg-violet-200 dark:bg-violet-900/30 dark:text-violet-300 dark:border-violet-800 dark:hover:bg-violet-900/50" |
| 17 | + > |
13 | 18 | <svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
14 | 19 | <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6"/>
|
15 | 20 | </svg>
|
|
48 | 53 | <div class="flex flex-col w-full mb-6">
|
49 | 54 | <div class="relative w-full">
|
50 | 55 | <div class="{{ $reply->is_from_user ? 'bg-blue-100/50 dark:bg-blue-900/20 border-blue-200/50 dark:border-blue-800/30 mr-10' : 'bg-gray-100/70 dark:bg-gray-700/20 border-gray-200/50 dark:border-gray-700/30 ml-10' }} p-4 rounded-lg border">
|
51 |
| - <p class="font-medium text-gray-900 dark:text-gray-100">{{ $reply->user->name }}</p> |
| 56 | + <p class="font-medium text-gray-900 dark:text-gray-100"> |
| 57 | + {{ $reply->user->name }} |
| 58 | + @if($reply->is_from_user) |
| 59 | + <span class="text-sm text-gray-500 dark:text-gray-400">(You)</span> |
| 60 | + @elseif($reply->is_from_admin) |
| 61 | + <span class="text-sm text-gray-500 dark:text-gray-400">(Staff)</span> |
| 62 | + @endif |
| 63 | + </p> |
52 | 64 | <p class="mt-1 text-gray-800 dark:text-gray-200">{{ $reply->message }}</p>
|
53 | 65 | </div>
|
54 | 66 | </div>
|
|
77 | 89 | </svg>
|
78 | 90 | Back
|
79 | 91 | </a>
|
80 |
| - <button type="button" class="flex-1 inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-violet-700 bg-violet-100 border border-violet-200 rounded-lg hover:bg-violet-200 dark:bg-violet-900/30 dark:text-violet-300 dark:border-violet-800 dark:hover:bg-violet-900/50 mx-1"> |
| 92 | + <button |
| 93 | + type="button" |
| 94 | + @click="showReplyModal = true" |
| 95 | + class="flex-1 inline-flex items-center justify-center px-3 py-2 text-sm font-medium text-violet-700 bg-violet-100 border border-violet-200 rounded-lg hover:bg-violet-200 dark:bg-violet-900/30 dark:text-violet-300 dark:border-violet-800 dark:hover:bg-violet-900/50 mx-1" |
| 96 | + > |
81 | 97 | <svg class="w-4 h-4 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
82 | 98 | <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6"/>
|
83 | 99 | </svg>
|
|
98 | 114 | <form action="{{ route('support.tickets.close', $supportTicket) }}" method="POST" id="closeTicketForm">
|
99 | 115 | @csrf
|
100 | 116 | </form>
|
| 117 | + |
| 118 | + {{-- Reply Modal --}} |
| 119 | + <div |
| 120 | + x-show="showReplyModal" |
| 121 | + x-cloak |
| 122 | + class="fixed inset-0 z-50 overflow-y-auto" |
| 123 | + aria-labelledby="modal-title" |
| 124 | + role="dialog" |
| 125 | + aria-modal="true" |
| 126 | + > |
| 127 | + <div |
| 128 | + class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0" |
| 129 | + x-transition:enter="ease-out duration-300" |
| 130 | + x-transition:enter-start="opacity-0" |
| 131 | + x-transition:enter-end="opacity-100" |
| 132 | + x-transition:leave="ease-in duration-200" |
| 133 | + x-transition:leave-start="opacity-100" |
| 134 | + x-transition:leave-end="opacity-0" |
| 135 | + > |
| 136 | + {{-- Modal backdrop --}} |
| 137 | + <div |
| 138 | + class="fixed inset-0 bg-gray-500 bg-opacity-75 dark:bg-gray-900 dark:bg-opacity-75 transition-opacity" |
| 139 | + aria-hidden="true" |
| 140 | + @click="showReplyModal = false" |
| 141 | + ></div> |
| 142 | + |
| 143 | + {{-- Modal positioning trick --}} |
| 144 | + <span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">​</span> |
| 145 | + |
| 146 | + {{-- Modal content --}} |
| 147 | + <div |
| 148 | + class="inline-block align-bottom bg-white dark:bg-gray-800 rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full" |
| 149 | + x-transition:enter="ease-out duration-300" |
| 150 | + x-transition:enter-start="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95" |
| 151 | + x-transition:enter-end="opacity-100 translate-y-0 sm:scale-100" |
| 152 | + x-transition:leave="ease-in duration-200" |
| 153 | + x-transition:leave-start="opacity-100 translate-y-0 sm:scale-100" |
| 154 | + x-transition:leave-end="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95" |
| 155 | + > |
| 156 | + <div class="absolute top-0 right-0 pt-4 pr-4"> |
| 157 | + <button |
| 158 | + type="button" |
| 159 | + class="bg-white dark:bg-gray-800 rounded-md text-gray-400 hover:text-gray-500 dark:hover:text-gray-300 focus:outline-none" |
| 160 | + @click="showReplyModal = false" |
| 161 | + > |
| 162 | + <span class="sr-only">Close</span> |
| 163 | + <svg class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor"> |
| 164 | + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" /> |
| 165 | + </svg> |
| 166 | + </button> |
| 167 | + </div> |
| 168 | + <div class="px-4 pt-5 pb-4 sm:p-6 sm:pb-4"> |
| 169 | + <div class="sm:flex sm:items-start"> |
| 170 | + <div class="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full"> |
| 171 | + <h3 class="text-lg leading-6 font-medium text-gray-900 dark:text-white" id="modal-title"> |
| 172 | + Reply to Ticket #{{ $supportTicket->mask }} |
| 173 | + </h3> |
| 174 | + <div class="mt-4"> |
| 175 | + <form action="#" method="POST"> |
| 176 | + @csrf |
| 177 | + <div class="mb-4"> |
| 178 | + <label for="message" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2"> |
| 179 | + Your message |
| 180 | + </label> |
| 181 | + <textarea |
| 182 | + id="message" |
| 183 | + name="message" |
| 184 | + rows="5" |
| 185 | + class="shadow-sm focus:ring-violet-500 focus:border-violet-500 block w-full sm:text-sm border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-white rounded-md" |
| 186 | + placeholder="Type your reply here..." |
| 187 | + required |
| 188 | + ></textarea> |
| 189 | + </div> |
| 190 | + <div class="mt-5 sm:mt-6 sm:flex sm:flex-row-reverse"> |
| 191 | + <button |
| 192 | + type="submit" |
| 193 | + class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-violet-600 text-base font-medium text-white hover:bg-violet-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-violet-500 sm:ml-3 sm:w-auto sm:text-sm dark:bg-violet-700 dark:hover:bg-violet-600" |
| 194 | + > |
| 195 | + Send Reply |
| 196 | + </button> |
| 197 | + <button |
| 198 | + type="button" |
| 199 | + class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-violet-500 sm:mt-0 sm:w-auto sm:text-sm dark:bg-gray-800 dark:text-gray-300 dark:border-gray-600 dark:hover:bg-gray-700" |
| 200 | + @click="showReplyModal = false" |
| 201 | + > |
| 202 | + Cancel |
| 203 | + </button> |
| 204 | + </div> |
| 205 | + </form> |
| 206 | + </div> |
| 207 | + </div> |
| 208 | + </div> |
| 209 | + </div> |
| 210 | + </div> |
| 211 | + </div> |
| 212 | + </div> |
| 213 | + |
| 214 | + {{-- Add Alpine.js x-cloak style to hide elements with x-cloak before Alpine initializes --}} |
| 215 | + <style> |
| 216 | + [x-cloak] { display: none !important; } |
| 217 | + </style> |
| 218 | + </div> |
101 | 219 | </x-layout-three-columns>
|
0 commit comments