Info and filtering by course tracks, table of content on chapter view with links and previous and next buttons.

This commit is contained in:
Krzysztof Płaczek
2023-01-23 13:23:57 +01:00
parent d4d8330d83
commit 5902bf7c2b
9 changed files with 1024 additions and 477 deletions

View File

@@ -25,6 +25,19 @@
</div>
@endif
<div>
<table class="table table-sm">
@foreach($chapters as $courseChapter)
<tr class="@if($courseChapter->id === $chapter->id)table-dark @endif">
<td>
<a href="{{ route('course.chapter', ['course' => $courseChapter->course_id, 'chapter' => $courseChapter->order ]) }}" class="text-decoration-none">{{ $courseChapter->title }}</a>
</td>
<td class="text-end">{{ $courseChapter->duration }}</td>
</tr>
@endforeach
</table>
</div>
</div>
<div class="col">
@if($next)
@@ -35,6 +48,7 @@
@endif
</div>
</div>
</div>
</div>
</x-layout>

View File

@@ -7,6 +7,7 @@
<th></th>
<th>Name</th>
<th>Status</th>
<th>Tracks</th>
<th>Sync</th>
<th>Chapters</th>
<th>Published at</th>
@@ -23,6 +24,11 @@
href="{{ route('course.index', ['course' => $course->id]) }}">{{ $course->name }}</a>
</td>
<td class="align-middle">{{ $course->status }}</td>
<td class="align-middle">
@foreach( explode(',', $course->tracks) as $track)
<a href="/track/{{ $track }}" class="badge rounded-pill bg-secondary">{{ $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>
@@ -41,6 +47,7 @@
<td></td>
<td></td>
<td></td>
<td></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>