Initial Ladill Transfer app — file sharing with QR links.
Scaffolded from the Ladill mini/events extraction pattern: multi-file transfers, retention controls, public landing pages, analytics, and Gitea deploy workflow. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<x-user-layout>
|
||||
<x-slot name="title">Files</x-slot>
|
||||
@php
|
||||
$fmtBytes = function (int $bytes) {
|
||||
if ($bytes >= 1073741824) return number_format($bytes / 1073741824, 2).' GB';
|
||||
if ($bytes >= 1048576) return number_format($bytes / 1048576, 1).' MB';
|
||||
return number_format($bytes / 1024, 0).' KB';
|
||||
};
|
||||
@endphp
|
||||
<div class="space-y-6">
|
||||
<div>
|
||||
<h1 class="text-xl font-semibold text-slate-900">Files</h1>
|
||||
<p class="mt-1 text-sm text-slate-500">{{ $fmtBytes($storageBytes) }} stored across active transfers (~GHS {{ number_format($storageGb * $pricePerGb, 2) }}/month).</p>
|
||||
</div>
|
||||
|
||||
@if($files->isEmpty())
|
||||
<div class="rounded-2xl border border-dashed border-slate-200 bg-white px-6 py-12 text-center text-sm text-slate-500">
|
||||
No stored files yet.
|
||||
</div>
|
||||
@else
|
||||
<div class="overflow-hidden rounded-2xl border border-slate-200 bg-white">
|
||||
<table class="min-w-full divide-y divide-slate-100 text-sm">
|
||||
<thead class="bg-slate-50 text-left text-xs font-semibold uppercase tracking-wide text-slate-500">
|
||||
<tr>
|
||||
<th class="px-6 py-3">File</th>
|
||||
<th class="px-6 py-3">Transfer</th>
|
||||
<th class="px-6 py-3">Size</th>
|
||||
<th class="px-6 py-3">Downloads</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-slate-100">
|
||||
@foreach($files as $file)
|
||||
<tr>
|
||||
<td class="px-6 py-4 font-medium text-slate-900">{{ $file->original_name }}</td>
|
||||
<td class="px-6 py-4">
|
||||
<a href="{{ route('transfer.transfers.show', $file->transfer) }}" class="text-indigo-600 hover:text-indigo-800">{{ $file->transfer->title }}</a>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-slate-600">{{ $file->humanSize() }}</td>
|
||||
<td class="px-6 py-4 text-slate-600">{{ number_format($file->downloads_total) }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>{{ $files->links() }}</div>
|
||||
@endif
|
||||
</div>
|
||||
</x-user-layout>
|
||||
Reference in New Issue
Block a user