@extends('layouts.portal') @php $maxVideo = min($limits['video'], $limits['server']); $maxFile = min($limits['file'], $limits['server']); $kindIcons = ['video' => 'video', 'pdf' => 'file-text', 'file' => 'paperclip', 'link' => 'link']; $kindLabels = ['video' => 'Video', 'pdf' => 'PDF', 'file' => 'Other file', 'link' => 'Web link']; $hasFilters = ! empty(array_filter($filters)); $bytes = collect($stats)->sum('bytes'); $humanBytes = function ($b) { if ($b <= 0) { return '0 MB'; } $u = ['B', 'KB', 'MB', 'GB', 'TB']; $i = min((int) floor(log($b, 1024)), 4); return round($b / (1024 ** $i), $i > 1 ? 1 : 0).' '.$u[$i]; }; $openUpload = $errors->any() && old('_from') === 'upload'; @endphp @section('title', 'Learning materials') @section('subtitle', 'Lecture recordings, PDFs, lab guides and links for every course and batch.') @section('actions') @endsection @section('content') @if($limits['server'] < max($limits['video'], $limits['file']))
| Material | Course and audience | Size | Uploaded | Status | Actions |
|---|---|---|---|---|---|
{{ $r->title }} {{ $kindLabels[$r->kind] ?? strtoupper($r->kind) }}@if($r->lesson) · {{ \Illuminate\Support\Str::limit($r->lesson->title, 34) }}@endif |
{{ \Illuminate\Support\Str::limit($r->course?->title ?? '—', 44) }}{{ $r->batch?->batch_code ? 'Only batch '.$r->batch->batch_code : 'All course learners' }} | {{ $r->humanSize() ?: '—' }} | {{ $r->created_at->format('d M Y') }}{{ $r->uploader?->name ?? 'Unknown' }} |
Change the title or hide it from learners. To replace the file, delete it and upload again.