diff --git a/Modules/Helpdesk/Resources/views/attachments/source-preview.blade.php b/Modules/Helpdesk/Resources/views/attachments/source-preview.blade.php index 57c7d365..9df5952e 100644 --- a/Modules/Helpdesk/Resources/views/attachments/source-preview.blade.php +++ b/Modules/Helpdesk/Resources/views/attachments/source-preview.blade.php @@ -1,6 +1,11 @@ @php $lines = preg_split('/\r\n|\r|\n/', $contents); - $downloadUrl = route('helpdesk.attachments.download', $attachment->id); + $attachmentId = data_get($attachment, 'id'); + $attachmentName = (string) data_get($attachment, 'original_name', 'Attachment'); + $attachmentSize = (int) data_get($attachment, 'size', 0); + $ticketId = data_get($attachment, 'ticket_id'); + $downloadUrl = route('helpdesk.attachments.download', $attachmentId); + $backUrl = is_numeric($ticketId) ? route('helpdesk.tickets.show', ['ticket' => $ticketId]) : route('helpdesk.index'); @endphp @extends('helpdesk::layouts.master') @@ -12,15 +17,25 @@

Read-only source viewer

-

{{ $attachment->original_name ?? 'Attachment' }}

+

{{ $attachmentName }}

Language: {{ strtoupper($language) }} • - Size: {{ Number::fileSize($attachment->size) }} + Size: {{ Number::fileSize($attachmentSize) }}

+ + + Back to ticket + + + + Dashboard + diff --git a/Modules/Helpdesk/Resources/views/index.blade.php b/Modules/Helpdesk/Resources/views/index.blade.php index e43990eb..cee4a217 100644 --- a/Modules/Helpdesk/Resources/views/index.blade.php +++ b/Modules/Helpdesk/Resources/views/index.blade.php @@ -205,16 +205,45 @@
-
-
- @foreach (range(1, 9) as $cell) -
- @endforeach -
-
-
-
-
+
+
+
+ +
+
+
+
+
+
+
+ + + +
+
+ +
+ @foreach ([72, 54, 88, 46, 68, 58] as $height) +
+
+
+ @endforeach +
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Modules/Helpdesk/Resources/views/livewire/ticket-show.blade.php b/Modules/Helpdesk/Resources/views/livewire/ticket-show.blade.php index fb4aaa71..59d7701d 100644 --- a/Modules/Helpdesk/Resources/views/livewire/ticket-show.blade.php +++ b/Modules/Helpdesk/Resources/views/livewire/ticket-show.blade.php @@ -43,10 +43,10 @@
- - - Back + + Dashboard @can('update', $ticket) syncRichEditor(editor)); updateCommentToggleButtons(); + initialiseHelpdeskSidebarCards(); }); + + + function initialiseHelpdeskSidebarCards() { + const sidebar = document.querySelector('[data-helpdesk-sidebar-cards]'); + + if (!sidebar || sidebar.dataset.helpdeskSidebarInitialised === 'true') { + return; + } + + sidebar.dataset.helpdeskSidebarInitialised = 'true'; + + Array.from(sidebar.children).forEach((card) => { + if (!(card instanceof HTMLElement) || card.tagName.toLowerCase() === 'details') { + return; + } + + const header = card.firstElementChild; + + if (!(header instanceof HTMLElement)) { + return; + } + + const details = document.createElement('details'); + details.className = card.className; + details.dataset.helpdeskSidebarCard = 'true'; + + const summary = document.createElement('summary'); + summary.className = 'cursor-pointer list-none marker:hidden'; + summary.appendChild(header); + + const body = document.createElement('div'); + body.className = 'pt-4'; + + while (card.firstChild) { + body.appendChild(card.firstChild); + } + + details.appendChild(summary); + details.appendChild(body); + card.replaceWith(details); + }); + } + function wrapSelection(textarea, before, after) { const start = textarea.selectionStart || 0; const end = textarea.selectionEnd || 0; @@ -880,7 +924,7 @@
-