@extends('layouts.app') @section('title', $project->name . ' — 文件') @section('content') @include('projects._nav')
@if(session('success'))
{{ session('success') }}
@endif

{{ $project->name }} — 文件

{{-- 文件列表 --}}
文件列表 ({{ $files->count() }})
@if($files->isEmpty())
尚未上傳任何文件。
@else
@foreach($files as $file) @php $ext = strtolower(pathinfo($file->filename, PATHINFO_EXTENSION)); $icon = match(true) { in_array($ext, ['jpg','jpeg','png','gif','webp']) => 'bi-file-image text-success', $ext === 'pdf' => 'bi-file-pdf text-danger', in_array($ext, ['doc','docx']) => 'bi-file-word text-primary', in_array($ext, ['xls','xlsx']) => 'bi-file-excel text-success', in_array($ext, ['zip','rar','7z','gz','tar']) => 'bi-file-zip text-warning', default => 'bi-file-earmark text-secondary', }; @endphp
{{ $file->filename }} @can('update', $project)
@csrf @method('DELETE')
@endcan
{{-- 說明(靜態) --}}
{{ $file->description ?: '(無說明)' }}
{{-- 說明(編輯表單,預設隱藏) --}} @can('update', $project)
@csrf @method('PATCH')
@endcan
{{ $file->uploader ?? '—' }} · {{ $file->created_at->format('Y-m-d') }}
@endforeach
@endif
{{-- 上傳區 --}} @can('update', $project)
上傳文件
@csrf
@error('file')
{{ $message }}
@enderror
@endcan
@push('scripts') @endpush @endsection