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>
|
||||
|
||||
Reference in New Issue
Block a user