@extends('layouts.app') @section('title', $folder?->name ?? (($area ?? 'shared') === 'personal' ? 'File Saya' : 'File')) @section('content') @php($area = $area ?? 'shared') @php($isPersonalArea = $area === 'personal') @php($homeRoute = $isPersonalArea ? 'explorer.myFiles' : 'explorer.index') @php($canPrivate = ! $isPersonalArea && auth()->user()?->can('access private files')) @php($canBulkMove = auth()->user()?->can('update files')) @php($canBulkDelete = auth()->user()?->can('delete files')) @php($canBulkDownload = auth()->user()?->can('download files')) @php($canBulk = $canBulkMove || $canBulkDelete || $canBulkDownload) @if ($errors->any())
@endif @php($upTo = $folder ? ($breadcrumbs->count() >= 2 ? route($homeRoute, $breadcrumbs->slice(-2, 1)->first()) : route($homeRoute)) : null) @if ($canBulkMove) {{-- Clipboard bar: shown when items have been cut from this or another folder. --}} @endif @can('create files')
{{-- New spreadsheet modal — creates a kind="sheet" file opened in the Univer editor. --}} {{-- New link modal — creates a file-tree entry that redirects elsewhere when opened. --}} {{-- New folder modal --}} {{-- Upload modal --}} {{-- Full-page drag overlay --}} @endcan @can('update files') {{-- Shared rename / move modal --}} @endcan @php($search = $search ?? null) @php($searchAction = $folder ? route($homeRoute, $folder) : route($homeRoute)) @include('explorer._search-bar', [ 'action' => $searchAction, 'value' => $search, 'placeholder' => $folder ? 'Cari di “'.$folder->name.'” dan subfoldernya…' : ($isPersonalArea ? 'Cari di File Saya…' : 'Cari file dan folder…'), ]) @if ($search !== null)
{{ $folders->count() + $files->count() }} hasil untuk “{{ $search }}” @if ($folder) di {{ $folder->name }} @endif @if ($searchLimited) · hanya {{ $folders->count() + $files->count() }} pertama yang ditampilkan, perjelas kata kunci @endif Hapus pencarian
@endif @php($storageUsed = $storageUsed ?? \App\Models\File::storageUsed()) @php($storageLimit = $storageLimit ?? \App\Models\File::storageLimitBytes())
Penyimpanan {{ \App\Models\File::humanBytes($storageUsed) }} @if ($storageLimit > 0) dari {{ \App\Models\File::humanBytes($storageLimit) }} terpakai @else tersimpan · tidak ada batas total @endif
@if ($storageLimit > 0) @php($storagePct = min(100, (int) round($storageUsed / $storageLimit * 100)))

{{ $storagePct }}% terpakai · {{ \App\Models\File::humanBytes(max(0, $storageLimit - $storageUsed)) }} tersisa

@endif
@if ($canBulk) @endif @forelse ($folders as $subfolder) @if ($canBulk) @endif @php($subfolderSize = $folderSizes[$subfolder->id] ?? 0) @empty @endforelse @forelse ($files as $file) @if ($file->isSheet()) @include('explorer._spreadsheet-row', ['file' => $file]) @continue @endif @if ($file->isLink()) @include('explorer._link-row', ['file' => $file]) @continue @endif @if ($canBulk) @endif @empty @endforelse @if ($folders->isEmpty() && $files->isEmpty()) @endif
Nama Ukuran Pemilik Diubah
{{ $subfolder->name }} @include('explorer._visibility-badge', ['item' => $subfolder]) @include('explorer._search-location', ['key' => 'folder:'.$subfolder->id]) {{ $subfolderSize > 0 ? \App\Models\File::humanBytes($subfolderSize) : '—' }} {{ $subfolder->user?->name ?? '—' }} {{ $subfolder->updated_at->format('Y-m-d') }}
@can('download files') {{ $file->name }} @else {{ $file->name }} @endcan @if ($file->effectiveVisibility()->value !== 'shared') @include('explorer._visibility-badge', ['item' => $file]) @elseif ($file->isPublic()) Publik @endif @include('explorer._search-location', ['key' => 'file:'.$file->id]) {{ number_format($file->size / 1024, 1) }} KB {{ $file->user?->name ?? '—' }} {{ $file->updated_at->format('Y-m-d') }}
{{ $search !== null ? 'Tidak ada file atau folder yang cocok.' : 'Folder ini kosong.' }}
@can('delete files') @endcan @if ($canBulk) {{-- Floating action bar — appears while one or more rows are selected. --}} @endif @can('update files') {{-- Bulk move modal --}} @endcan @can('delete files') {{-- Bulk delete modal --}} @endcan @can('download files') {{-- Folder/bulk download — shared by the per-folder "Download" button and the bulk selection bar. Always a compressed zip, streamed and built on the fly server-side. --}} @endcan @canany(['create files', 'update files']) @endcan @if ($canBulk) @endif @can('download files') {{-- File preview --}} {{-- Version history — previous copies archived when an upload replaced a file. --}} {{-- Activity — the audit-trail entries recorded against this one file. --}} @endcan @endsection