fixe duploads and attachments now with colors tab

This commit is contained in:
Mark Gregory
2026-06-16 18:32:15 +01:00
parent bcd133e27a
commit c19497efc2
2 changed files with 60 additions and 21 deletions
@@ -336,27 +336,34 @@
</div>
<div class="lg:col-span-3 xl:col-span-6">
<div class="rounded-2xl border border-zinc-700 bg-zinc-950/70 p-4">
<div class="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
<div>
<label class="block text-sm font-semibold text-zinc-200" for="attachments">
Attachments
<div class="overflow-hidden rounded-2xl border border-blue-500/30 bg-zinc-950/70 shadow-sm shadow-blue-950/30">
<div class="bg-gradient-to-r from-blue-700 via-sky-600 to-emerald-600 px-5 py-4 text-white">
<div class="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
<div>
<label class="flex items-center gap-2 text-base font-extrabold text-white drop-shadow-sm" for="attachments">
<span class="inline-flex h-9 w-9 items-center justify-center rounded-xl bg-white/15 ring-1 ring-white/25">
<i class="fa-solid fa-paperclip" aria-hidden="true"></i>
</span>
Attachments
</label>
<p class="mt-2 max-w-2xl text-sm font-medium text-blue-50/90">
Add screenshots, documents, logs or supporting files to help resolve the ticket.
</p>
</div>
<label
for="attachments"
class="inline-flex cursor-pointer items-center justify-center gap-2 rounded-xl bg-white px-4 py-2.5 text-sm font-bold text-blue-700 shadow-sm transition hover:bg-blue-50 focus:outline-none focus:ring-2 focus:ring-white/80 focus:ring-offset-2 focus:ring-offset-blue-700"
>
<i class="fa-solid fa-plus" aria-hidden="true"></i>
<span>Add attachments</span>
</label>
<p class="mt-1 text-sm text-zinc-500">
Add screenshots, documents, logs or supporting files to help resolve the ticket.
</p>
</div>
<label
for="attachments"
class="inline-flex cursor-pointer items-center justify-center gap-2 rounded-xl bg-blue-600 px-4 py-2.5 text-sm font-semibold text-white shadow-sm transition hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:ring-offset-zinc-950"
>
<i class="fa-solid fa-paperclip" aria-hidden="true"></i>
<span>Add attachments</span>
</label>
</div>
<div class="p-4">
<input
id="attachments"
type="file"
@@ -375,7 +382,19 @@
</div>
<div class="mt-4 space-y-3">
<h3 class="text-sm font-semibold text-zinc-200">Existing attachments</h3>
<div class="flex flex-wrap items-center justify-between gap-3 rounded-xl border border-emerald-500/30 bg-emerald-500/10 px-4 py-3">
<h3 class="inline-flex items-center gap-2 text-sm font-extrabold text-emerald-200">
<span class="inline-flex h-7 w-7 items-center justify-center rounded-lg bg-emerald-500 text-white shadow-sm">
<i class="fa-solid fa-folder-open" aria-hidden="true"></i>
</span>
Existing attachments
</h3>
<span class="inline-flex items-center gap-2 rounded-full bg-emerald-100 px-3 py-1 text-xs font-extrabold text-emerald-800 shadow-sm ring-1 ring-emerald-300/70">
<span class="inline-flex h-2 w-2 rounded-full bg-emerald-500"></span>
{{ $ticket->attachments->count() }} file(s)
</span>
</div>
@forelse ($ticket->attachments as $attachment)
<div class="flex flex-col gap-3 rounded-xl border border-zinc-700 bg-zinc-900 p-3 text-sm sm:flex-row sm:items-center sm:justify-between">
@@ -417,6 +436,7 @@
@error('attachments.*')
<p class="mt-3 text-sm text-red-500">{{ $message }}</p>
@enderror
</div>
</div>
</div>
</div>
@@ -37,9 +37,28 @@
</div>
</article>
<div class="rounded-2xl border border-zinc-200 bg-white p-6 shadow-sm dark:border-zinc-700 dark:bg-zinc-900">
<h2 class="mb-4 text-base font-semibold text-zinc-900 dark:text-white">Ticket attachments</h2>
<div class="grid gap-3 sm:grid-cols-2">
<div class="overflow-hidden rounded-2xl border border-blue-200 bg-white shadow-sm dark:border-blue-900/60 dark:bg-zinc-900">
<div class="bg-gradient-to-r from-blue-700 via-sky-600 to-emerald-600 px-6 py-4 text-white">
<div class="flex items-center justify-between gap-4">
<div>
<h2 class="flex items-center gap-2 text-base font-extrabold text-white drop-shadow-sm">
<span class="inline-flex h-9 w-9 items-center justify-center rounded-xl bg-white/15 ring-1 ring-white/25">
<i class="fa-solid fa-paperclip" aria-hidden="true"></i>
</span>
Ticket attachments
</h2>
<p class="mt-1 text-sm font-medium text-blue-50/90">
Supporting screenshots, documents and logs linked to this ticket.
</p>
</div>
<span class="inline-flex items-center gap-2 rounded-full bg-emerald-100 px-3 py-1 text-xs font-extrabold text-emerald-800 shadow-sm ring-1 ring-white/70">
<span class="inline-flex h-2 w-2 rounded-full bg-emerald-500"></span>{{ $ticket->attachments->count() }} file(s)
</span>
</div>
</div>
<div class="grid gap-3 p-6 sm:grid-cols-2">
@forelse ($ticket->attachments as $attachment)
<a href="{{ method_exists($attachment, 'url') ? $attachment->url() : Storage::disk($attachment->disk ?? 'public')->url($attachment->path ?? $attachment->file_path) }}" target="_blank" class="rounded-xl border border-zinc-200 p-3 text-sm hover:bg-zinc-50 dark:border-zinc-700 dark:hover:bg-zinc-800">
<div class="font-medium text-zinc-900 dark:text-zinc-100">{{ $attachment->original_name ?? $attachment->original_filename ?? $attachment->filename ?? $attachment->file_name ?? basename($attachment->path ?? $attachment->file_path ?? '') }}</div>