Working interface and parsed symfony cast data to a database.

This commit is contained in:
Krzysztof Płaczek
2022-08-23 08:09:14 +02:00
parent 119b94470f
commit a92c75c1dd
22 changed files with 488 additions and 224 deletions

View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<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">
</head>
<body>
{{ $slot }}
</body>
</html>

View File

@@ -0,0 +1,14 @@
<x-layout>
<h1>
{{ $course->name }}
</h1>
<table class="table">
@foreach($course->chapters()->get() as $chapter)
<tr>
<td><a href="{{ route('course.chapter', ['chapter' => $chapter->id]) }}">{{ $chapter->title }}</a></td>
<td>{{ $chapter->duration }}</td>
</tr>
@endforeach
</table>
</x-layout>

View File

@@ -0,0 +1,24 @@
<x-layout>
<table class="table table-sm">
<thead>
<tr>
<th>Id</th>
<th></th>
<th>Name</th>
<th>status</th>
<th>Chapters</th>
<th>Published at</th>
</tr>
</thead>
@foreach($courses as $course)
<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">{{ $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>
</tr>
@endforeach
</table>
</x-layout>