new ataxchments preview code now with proper code
This commit is contained in:
@@ -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 @@
|
||||
<div class="flex flex-col gap-4 md:flex-row md:items-center md:justify-between">
|
||||
<div class="min-w-0">
|
||||
<p class="text-xs font-black uppercase tracking-[0.18em] text-blue-300">Read-only source viewer</p>
|
||||
<h1 class="mt-1 truncate text-2xl font-black text-white">{{ $attachment->original_name ?? 'Attachment' }}</h1>
|
||||
<h1 class="mt-1 truncate text-2xl font-black text-white">{{ $attachmentName }}</h1>
|
||||
<p class="mt-2 text-sm text-zinc-400">
|
||||
Language: <span class="font-semibold text-zinc-200">{{ strtoupper($language) }}</span>
|
||||
<span class="mx-2 text-zinc-600">•</span>
|
||||
Size: <span class="font-semibold text-zinc-200">{{ Number::fileSize($attachment->size) }}</span>
|
||||
Size: <span class="font-semibold text-zinc-200">{{ Number::fileSize($attachmentSize) }}</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap gap-2">
|
||||
<a href="{{ $backUrl }}"
|
||||
class="inline-flex items-center gap-2 rounded-xl bg-zinc-700 px-4 py-2 text-sm font-bold text-white hover:bg-zinc-600">
|
||||
<i class="fa-solid fa-arrow-left" aria-hidden="true"></i>
|
||||
Back to ticket
|
||||
</a>
|
||||
<a href="{{ route('helpdesk.index') }}"
|
||||
class="inline-flex items-center gap-2 rounded-xl bg-blue-700 px-4 py-2 text-sm font-bold text-white hover:bg-blue-800">
|
||||
<i class="fa-solid fa-gauge-high" aria-hidden="true"></i>
|
||||
Dashboard
|
||||
</a>
|
||||
<a href="{{ $downloadUrl }}"
|
||||
class="inline-flex items-center gap-2 rounded-xl bg-blue-600 px-4 py-2 text-sm font-bold text-white hover:bg-blue-700">
|
||||
<i class="fa-solid fa-download" aria-hidden="true"></i>
|
||||
|
||||
@@ -205,16 +205,45 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="rounded-2xl border border-white/10 bg-white/10 p-5 shadow-2xl backdrop-blur">
|
||||
<div class="grid grid-cols-3 gap-2">
|
||||
@foreach (range(1, 9) as $cell)
|
||||
<div class="h-14 rounded-xl bg-white/15"></div>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="mt-4 rounded-xl bg-white/10 p-4">
|
||||
<div class="h-2 rounded-full bg-blue-300/80"></div>
|
||||
<div class="mt-3 h-2 w-3/4 rounded-full bg-emerald-300/80"></div>
|
||||
<div class="mt-3 h-2 w-1/2 rounded-full bg-rose-300/80"></div>
|
||||
<div class="relative overflow-hidden rounded-3xl border border-white/15 bg-slate-900/75 p-5 shadow-2xl ring-1 ring-blue-400/10 backdrop-blur">
|
||||
<div class="absolute -right-12 -top-12 h-36 w-36 rounded-full bg-blue-500/20 blur-3xl"></div>
|
||||
<div class="absolute -bottom-16 left-8 h-40 w-40 rounded-full bg-emerald-400/10 blur-3xl"></div>
|
||||
|
||||
<div class="relative rounded-2xl border border-white/10 bg-white/[0.06] p-4 shadow-inner">
|
||||
<div class="mb-4 flex items-center justify-between gap-3">
|
||||
<div>
|
||||
<div class="h-2.5 w-24 rounded-full bg-blue-200/80"></div>
|
||||
<div class="mt-2 h-2 w-16 rounded-full bg-white/25"></div>
|
||||
</div>
|
||||
<div class="flex gap-1.5">
|
||||
<span class="h-2.5 w-2.5 rounded-full bg-emerald-300"></span>
|
||||
<span class="h-2.5 w-2.5 rounded-full bg-amber-300"></span>
|
||||
<span class="h-2.5 w-2.5 rounded-full bg-rose-300"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-3 gap-2.5">
|
||||
@foreach ([72, 54, 88, 46, 68, 58] as $height)
|
||||
<div class="rounded-xl border border-white/10 bg-slate-800/80 p-2">
|
||||
<div class="rounded-lg bg-blue-400/20" style="height: {{ $height }}px"></div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
<div class="mt-4 grid gap-3 sm:grid-cols-3">
|
||||
<div class="rounded-xl border border-blue-300/20 bg-blue-500/15 p-3">
|
||||
<div class="h-2 w-10 rounded-full bg-blue-200"></div>
|
||||
<div class="mt-3 h-6 w-14 rounded-lg bg-white/20"></div>
|
||||
</div>
|
||||
<div class="rounded-xl border border-emerald-300/20 bg-emerald-500/15 p-3">
|
||||
<div class="h-2 w-10 rounded-full bg-emerald-200"></div>
|
||||
<div class="mt-3 h-6 w-14 rounded-lg bg-white/20"></div>
|
||||
</div>
|
||||
<div class="rounded-xl border border-violet-300/20 bg-violet-500/15 p-3">
|
||||
<div class="h-2 w-10 rounded-full bg-violet-200"></div>
|
||||
<div class="mt-3 h-6 w-14 rounded-lg bg-white/20"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -43,10 +43,10 @@
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap gap-2">
|
||||
<a href="{{ route('helpdesk.tickets.index') }}" wire:navigate
|
||||
<a href="{{ route('helpdesk.index') }}" wire:navigate
|
||||
class="inline-flex items-center rounded-lg bg-blue-600 px-3 py-2 text-xs font-bold text-white shadow-sm hover:bg-blue-700">
|
||||
<i class="fa-solid fa-arrow-left mr-2" aria-hidden="true"></i>
|
||||
Back
|
||||
<i class="fa-solid fa-list-check mr-2" aria-hidden="true"></i>
|
||||
Dashboard
|
||||
</a>
|
||||
@can('update', $ticket)
|
||||
<a href="{{ route('helpdesk.tickets.edit', $ticket) }}" wire:navigate
|
||||
@@ -864,8 +864,52 @@
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
document.querySelectorAll('[data-helpdesk-rich-editor]').forEach((editor) => 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 @@
|
||||
</script>
|
||||
</div>
|
||||
|
||||
<aside class="space-y-4">
|
||||
<aside class="space-y-4" data-helpdesk-sidebar-cards>
|
||||
<div
|
||||
class="rounded-xl border border-zinc-200 bg-white p-4 shadow-sm dark:border-zinc-700 dark:bg-zinc-900">
|
||||
<div class="-mx-4 -mt-4 mb-4 rounded-t-xl bg-blue-700 px-4 py-4 text-white">
|
||||
|
||||
@@ -316,3 +316,24 @@
|
||||
- Fixed source attachment preview rendering to use the Helpdesk module layout instead of the root component layout directly.
|
||||
- Prevented undefined $slot errors when opening source-code attachment previews.
|
||||
- Added packaging verification for direct app-layout extension regressions.
|
||||
|
||||
- version: 1.10.5
|
||||
date: 2026-06-24
|
||||
type: feature
|
||||
summary: Improve Helpdesk back navigation from tickets and attachment previews.
|
||||
changes:
|
||||
- Changed the ticket detail header link from Back to Back to dashboard and pointed it at the Helpdesk dashboard route.
|
||||
- Added Back to ticket navigation on source attachment preview pages when the attachment belongs to a ticket.
|
||||
- Added a direct Dashboard button on source attachment preview pages.
|
||||
- Preserved append-only changelog history.
|
||||
|
||||
- version: 1.10.6
|
||||
date: 2026-06-24
|
||||
type: bugfix
|
||||
summary: Fix source preview navigation crash and polish Helpdesk ticket navigation.
|
||||
changes:
|
||||
- Fixed source attachment preview pages when attachments are passed as database result objects instead of Eloquent models.
|
||||
- Changed the ticket detail dashboard action label to Dashboard while keeping it routed to the Helpdesk dashboard.
|
||||
- Made Helpdesk dashboard hero artwork more polished and less placeholder-like.
|
||||
- Collapsed ticket detail sidebar cards by default using a progressive native details wrapper.
|
||||
- Preserved append-only changelog history.
|
||||
|
||||
@@ -22,5 +22,5 @@
|
||||
"Modules\\Helpdesk\\Providers\\HelpdeskServiceProvider"
|
||||
],
|
||||
"files": [],
|
||||
"version": "1.10.4"
|
||||
"version": "1.10.6"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user