Changed links to chapters, button to synchronize chapters from courses list, dark mode.

This commit is contained in:
Krzysztof Płaczek
2022-12-07 19:57:57 +01:00
parent 25e28f8193
commit d4d8330d83
7 changed files with 50 additions and 29 deletions

View File

@@ -1,28 +1,40 @@
<x-layout>
<h1>
<a href="/">List</a> &raquo; <a
href="{{ route('course.index', ['course' => $chapter->course_id]) }}">{{ $chapter->course->name }}</a>
<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="float-none">
@if($prev)
<div class="float-start m-2"><a href="{{ route('course.chapter', ['chapter' => $prev->id]) }}">Prev</a>
<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>
@endif
@if($next)
<div class="float-end m-2"><a href="{{ route('course.chapter', ['chapter' => $next->id]) }}">Next</a>
</div>
@endif
</div>
<div class="col">
@if($chapter->is_video_file)
<div class="d-flex justify-content-center">
<video class="mx-auto" width="500" controls>
<source src="{{ $chapter->video_url }}" type="video/mp4"/>
</video>
</div>
@endif
<div class="mx-auto" style="width: 500px;">
@if($chapter->is_video_file)
<video class="mx-auto" width="500" controls>
<source src="{{ $chapter->video_url }}" type="video/mp4"/>
</video>
@endif
</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>

View File

@@ -2,9 +2,10 @@
<html lang="en">
<head>
<title>{{ $title ?? 'Symfonycast.local' }}</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
crossorigin="anonymous">
<link href="https://cdn.jsdelivr.net/npm/bootstrap-dark-5@1.1.3/dist/css/bootstrap-nightfall.min.css"
rel="stylesheet" media="(prefers-color-scheme: dark)">
</head>
<body>
{{ $slot }}

View File

@@ -1,6 +1,6 @@
<x-layout>
<h1>
<a href="/">List</a> &raquo; {{ $course->name }}
<a href="/" class="text-decoration-none">List</a> &raquo; {{ $course->name }}
</h1>
<a href="{{ route('course.sync', ['course' => $course->id]) }}">Sync all chapters offline</a>
@@ -16,7 +16,7 @@
</thead>
@foreach($course->chapters()->get() as $chapter)
<tr>
<td><a href="{{ route('course.chapter', ['chapter' => $chapter->id]) }}">{{ $chapter->title }}</a></td>
<td><a href="{{ route('course.chapter', ['course' => $course->id, 'chapter' => $chapter->order]) }}" class="text-decoration-none">{{ $chapter->title }}</a></td>
<td>{{ $chapter->duration }}</td>
<td>{{ $chapter->sync_offline?'Yes':'no' }}</td>
<td>{{ $chapter->is_video_file?'Yes':'-' }}</td>

View File

@@ -6,7 +6,8 @@
<th>Id</th>
<th></th>
<th>Name</th>
<th>status</th>
<th>Status</th>
<th>Sync</th>
<th>Chapters</th>
<th>Published at</th>
<th>Estimate file size</th>
@@ -18,9 +19,13 @@
<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', ['course' => $course->id]) }}">{{ $course->name }}</a></td>
<td class="align-middle"><a class="text-decoration-none"
href="{{ route('course.index', ['course' => $course->id]) }}">{{ $course->name }}</a>
</td>
<td class="align-middle">{{ $course->status }}</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">{{ $course->chapters_count }} / {{ $course->numberofchapters }}</td>
<td class="align-middle"><abbr
title="{{ $course->published_at?->format('Y-m-d') }}">{{ $course->published_at?->diffForHumans() }}</abbr>