Files
symfonycast.local/resources/views/chapter/index.blade.php

55 lines
2.5 KiB
PHP

<x-layout>
<h1>
<a href="/" class="text-decoration-none">List</a> &raquo; <a class="text-decoration-none"
href="{{ route('course.index', ['course' => $chapter->course_id]) }}">{{ $chapter->course->name }}</a>
<br>
<small class="text-muted">{{ $chapter->title }}</small>
</h1>
<div>
<div class="container-fluid">
<div class="row">
<div class="col">
@if($prev)
<div class="float-start m-2"><a
href="{{ route('course.chapter', ['course' => $chapter->course_id, 'chapter' => $prev->order]) }}"
class="btn btn-primary">Prev</a>
</div>
@endif
</div>
<div class="col">
<div class="d-flex justify-content-center">
<video class="mx-auto" width="500" controls>
<source src="{{ $videoUrl }}" type="video/mp4"/>
</video>
</div>
@if($chapter->is_video_file)
@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)
<div class="float-end m-2"><a
href="{{ route('course.chapter', ['course' => $chapter->course_id, 'chapter' => $next->order]) }}"
class="btn btn-primary">Next</a>
</div>
@endif
</div>
</div>
</div>
</div>
</x-layout>