@extends('layouts.simple.master') @section('title', trans(app()->getLocale() . '.file_manager')) @section('css') @endsection @section('main_content')

{{ trans(app()->getLocale() . '.file_manager') }}

@if($type == 'all') {{ trans(app()->getLocale() . '.all_files') }} @elseif($type == 'pdf') {{ trans(app()->getLocale() . '.pdf_files') }} @elseif($type == 'image') {{ trans(app()->getLocale() . '.image_files') }} @elseif($type == 'video') {{ trans(app()->getLocale() . '.video_files') }} @endif

{{ trans(app()->getLocale() . '.total') }}: {{ $files->count() }} {{ $files->count() == 1 ? trans(app()->getLocale() . '.file') : trans(app()->getLocale() . '.files') }}, {{ count($folders) }} {{ count($folders) == 1 ? trans(app()->getLocale() . '.folder') : trans(app()->getLocale() . '.folders') }}

{{-- Navigation Controls --}}
{{-- Show Folders First --}} @foreach($folders as $folderItem)

{{ $folderItem['name'] }}

{{ $folderItem['size'] }} MB {{ $folderItem['file_count'] }} {{ $folderItem['file_count'] == 1 ? trans(app()->getLocale() . '.file') : trans(app()->getLocale() . '.files') }}
@endforeach {{-- Show Files (only if not at root) --}} @if($folder) @foreach($files as $file) @php $sizeInMB = is_numeric($file->size) ? round((float)$file->size / (1024 * 1024), 2) : 0; $isImage = in_array($file->mime_type, ['image/jpeg', 'image/png', 'image/gif', 'image/webp']); $isPdf = $file->mime_type == 'application/pdf'; $isVideo = in_array($file->mime_type, ['video/mp4', 'video/quicktime', 'video/x-msvideo', 'video/x-ms-wmv']); @endphp
@if($isImage)
{{ $file->name }}
@elseif($isPdf)

PDF

@elseif($isVideo)

VID

@else

{{ strtoupper($file->ext ?? 'FILE') }}

@endif

{{ Str::limit($file->name, 20) }}

{{ $sizeInMB }} MB {{ $file->created_at }}
@endforeach @endif
{{ trans(app()->getLocale() . '.this_folder_is_empty') }}

@if(!$folder) {{ trans(app()->getLocale() . '.there_are_no_folders_here') }} @else {{ trans(app()->getLocale() . '.there_are_no_files_or_folders_here') }} @endif

@endsection @section('scripts') @endsection