🤩 File Manager - Mr.X
PHP:
8.3.33
Server:
Apache
OS:
Linux 5.14.0-611.49.1.el9_7.x86_64
User:
websparkit
Navigate
Upload:
Upload
New File
New Folder
Editing:resources.blade.php
<x-app-layout> <x-slot name="header"> <h2 class="font-semibold text-xl text-navy leading-tight"> {{ __('Project Resources: ') }} {{ $project->name }} </h2> </x-slot> <div class="py-12"> <div class="max-w-7xl mx-auto sm:px-6 lg:px-8 space-y-8"> @if(session('success')) <div class="bg-green-50 border-l-4 border-green-400 p-4 rounded-r-lg shadow-sm"> <span class="text-green-700 font-medium">{{ session('success') }}</span> </div> @endif @if(session('error')) <div class="bg-red-50 border-l-4 border-red-400 p-4 rounded-r-lg shadow-sm"> <span class="text-red-700 font-medium">{{ session('error') }}</span> </div> @endif <div class="bg-white overflow-hidden shadow-sm sm:rounded-lg"> <div class="border-b border-gray-200 bg-gradient-to-r from-navy to-navy-dark px-6 py-4 flex justify-between items-center"> <h3 class="text-lg font-bold text-white flex items-center gap-2"> <svg class="h-5 w-5" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" d="M3.75 9.776c.112-.017.227-.026.344-.026h15.812c.117 0 .232.009.344.026m-16.5 0a2.25 2.25 0 00-1.883 2.542l.857 6a2.25 2.25 0 002.227 1.932H19.05a2.25 2.25 0 002.227-1.932l.857-6a2.25 2.25 0 00-1.883-2.542m-16.5 0V6A2.25 2.25 0 016 3.75h3.879a1.5 1.5 0 011.06.44l2.122 2.12a1.5 1.5 0 001.06.44H18A2.25 2.25 0 0120.25 9v.776"/> </svg> Uploaded Resources </h3> <span class="text-sm text-white/60">{{ $project->resources->count() }} file(s)</span> </div> <div class="p-6"> @if($project->resources->isEmpty()) <div class="text-center py-12"> <svg class="mx-auto h-12 w-12 text-gray-300" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"/> </svg> <p class="mt-4 text-sm text-gray-500">No resources uploaded yet.</p> </div> @else <div class="space-y-3"> @foreach($project->resources as $resource) <div class="flex items-center justify-between p-4 bg-gray-50 rounded-lg border border-gray-200 hover:border-orange/30 transition-colors"> <div class="flex items-center gap-4 min-w-0"> <div class="flex-shrink-0 w-10 h-10 rounded-lg bg-orange/10 flex items-center justify-center"> <svg class="w-5 h-5 text-orange" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"/> </svg> </div> <div class="min-w-0"> <p class="font-semibold text-navy truncate">{{ $resource->title }}</p> @if($resource->description) <p class="text-sm text-gray-500 truncate">{{ $resource->description }}</p> @endif <p class="text-xs text-gray-400 mt-1"> {{ number_format($resource->file_size / 1024, 1) }} KB · by {{ $resource->uploader->name ?? 'N/A' }} · {{ $resource->created_at->format('M d, Y') }} @if($resource->is_downloadable) · <span class="text-green-600 font-medium">Downloadable by client</span> @endif </p> </div> </div> <div class="flex items-center gap-2 flex-shrink-0 ml-4"> <a href="{{ route('resources.download', $resource) }}" class="inline-flex items-center px-3 py-2 bg-navy hover:bg-navy-dark text-white text-sm rounded-lg transition-colors"> <svg class="w-4 h-4 mr-1" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"/> </svg> Download </a> <form action="{{ route('techlead.resource.delete', $resource) }}" method="POST" onsubmit="return confirm('Delete this resource?')"> @csrf @method('DELETE') <button type="submit" class="inline-flex items-center px-3 py-2 bg-red-500 hover:bg-red-600 text-white text-sm rounded-lg transition-colors"> <svg class="w-4 h-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"/> </svg> </button> </form> </div> </div> @endforeach </div> @endif </div> </div> <div class="bg-white overflow-hidden shadow-sm sm:rounded-lg"> <div class="border-b border-gray-200 bg-gradient-to-r from-orange to-orange-dark px-6 py-4"> <h3 class="text-lg font-bold text-white flex items-center gap-2"> <svg class="h-5 w-5" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" d="M12 16.5V9.75m0 0l3 3m-3-3l-3 3M6.75 19.5a4.5 4.5 0 01-1.41-8.775 5.25 5.25 0 0110.233-2.33 3 3 0 013.758 3.848A3.752 3.752 0 0118 19.5H6.75z"/> </svg> Upload New Resource </h3> </div> <div class="p-6"> <form action="{{ route('techlead.resource.store', $project) }}" method="POST" enctype="multipart/form-data" class="space-y-4 max-w-2xl"> @csrf <div> <label class="block text-sm font-medium text-gray-700">Title <span class="text-red-500">*</span></label> <input type="text" name="title" class="mt-1 block w-full border-gray-300 rounded-md shadow-sm focus:ring-orange focus:border-orange" required placeholder="e.g. Style Guide, API Documentation, Assets"> </div> <div> <label class="block text-sm font-medium text-gray-700">Description</label> <textarea name="description" rows="2" class="mt-1 block w-full border-gray-300 rounded-md shadow-sm focus:ring-orange focus:border-orange" placeholder="Optional description of this resource"></textarea> </div> <div> <label class="block text-sm font-medium text-gray-700">File <span class="text-red-500">*</span></label> <input type="file" name="file" class="mt-1 block w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0 file:text-sm file:font-semibold file:bg-orange file:text-white hover:file:bg-orange-dark" required> <p class="text-xs text-gray-400 mt-1">Max 500MB per file.</p> </div> <div class="flex items-center gap-2"> <input type="checkbox" name="is_downloadable" id="is_downloadable" value="1" class="rounded border-gray-300 text-orange focus:ring-orange"> <label for="is_downloadable" class="text-sm text-gray-700">Make downloadable by client after project completion</label> </div> <button type="submit" class="bg-orange hover:bg-orange-dark text-white font-bold py-2 px-6 rounded-lg transition-colors"> Upload Resource </button> </form> </div> </div> </div> </div> </x-app-layout>
Save Changes
Cancel
Create New File
Create New Folder