Added total time of a course, marking chapters and courses to sync offline.

This commit is contained in:
Krzysztof Płaczek
2022-09-15 14:35:02 +02:00
parent fc23506f92
commit b158ec6b5d
9 changed files with 43 additions and 14 deletions

View File

@@ -3,12 +3,25 @@
{{ $course->name }}
</h1>
<a href="{{ route('course.sync', ['course' => $course->id]) }}">Sync all chapters offline</a>
<table class="table">
<thead>
<tr>
<th>Title</th>
<th>Duration</th>
<th>Sync offline</th>
</tr>
</thead>
@foreach($course->chapters()->get() as $chapter)
<tr>
<td><a href="{{ route('course.chapter', ['chapter' => $chapter->id]) }}">{{ $chapter->title }}</a></td>
<td>{{ $chapter->sync_offline?'Yes':'No' }}</td>
<td>{{ $chapter->duration }}</td>
</tr>
@endforeach
<tr>
<td></td>
<td>Total: {{ $course->course_duration }}</td>
</tr>
</table>
</x-layout>

View File

@@ -14,7 +14,7 @@
<tr>
<td class="align-middle">{{ $course->id }}</td>
<td><img src="{{ $course->thumbnail }}" alt="{{ $course->name }}" class="img-thumbnail" style="width: 70px;"></td>
<td class="align-middle"><a href="{{ route('course.index', ['0' => $course->id]) }}"> {{ $course->name }}</a></td>
<td class="align-middle"><a href="{{ route('course.index', ['course' => $course->id]) }}">{{ $course->name }}</a></td>
<td class="align-middle">{{ $course->status }}</td>
<td class="align-middle">{{ $course->chapters_count }} / {{ $course->numberofchapters }}</td>
<td class="align-middle"><abbr title="{{ $course->published_at?->format('Y-m-d') }}">{{ $course->published_at?->diffForHumans() }}</abbr></td>