46 lines
2.4 KiB
PHP
46 lines
2.4 KiB
PHP
<x-layout>
|
|
<h1><a class="text-decoration-none" href="{{route('index')}}">List of Courses</a> <small class="text-muted">{{ request()->has('track')?:request()->track }}</small></h1>
|
|
<table class="table table-sm">
|
|
<thead>
|
|
<tr>
|
|
<th></th>
|
|
<th>Name</th>
|
|
<th>Tracks</th>
|
|
<th>Sync</th>
|
|
<th>Estimate file size</th>
|
|
<th>Actual size</th>
|
|
</tr>
|
|
</thead>
|
|
@foreach($courses as $course)
|
|
<tr>
|
|
<td><img src="{{ $course->thumbnail }}" alt="{{ $course->name }}" class="img-thumbnail"
|
|
style="width: 70px;"></td>
|
|
<td class="align-middle">
|
|
<a class="text-decoration-none" href="{{ route('course.index', ['course' => $course->id]) }}">{{ $course->name }}</a>
|
|
<p class="text-muted">
|
|
course status: <span class="fw-lighter">{{ $course->status }}</span>
|
|
published: <span class="fw-lighter"><abbr title="{{ $course->published_at?->format('Y-m-d') }}">{{ $course->published_at?->diffForHumans() }}</abbr></span>
|
|
synced chapters: <span class="fw-lighter">{{ $course->chapters_to_sync }} of {{ $course->numberofchapters }}</span>
|
|
</p>
|
|
</td>
|
|
<td class="align-middle">
|
|
@foreach($course->tracks as $track)
|
|
|
|
<a href="{{ route('index.track', ['track' => $track]) }}" class="badge rounded-pill bg-secondary text-decoration-none">{{ $track }}</a>
|
|
@endforeach
|
|
</td>
|
|
<td class="align-middle"><a class="btn btn-outline-primary"
|
|
href="{{ route('course.sync', ['course' => $course->id]) }}">Sync all
|
|
chapters offline</a></td>
|
|
<td class="align-middle text-end pe-4">{{ $course->total_size_human }}</td>
|
|
<td class="align-middle text-end pe-4">{{formatFileSize(folderSize(public_path('videos'.DIRECTORY_SEPARATOR.$course->id)))}}</td>
|
|
</tr>
|
|
@endforeach
|
|
<tr>
|
|
<td colspan="4"></td>
|
|
<td class="align-middle text-end pe-4">{{ formatFileSize($courses->sum('total_size')) }}</td>
|
|
<td class="align-middle text-end pe-4">{{formatFileSize(folderSize(public_path()))}}</td>
|
|
</tr>
|
|
</table>
|
|
</x-layout>
|