allow sorting by course name and published date, link to manually update course details,

This commit is contained in:
Krzysztof Płaczek
2023-04-07 14:43:51 +02:00
parent 32ead90121
commit a15c6a1a44
6 changed files with 51 additions and 11 deletions

View File

@@ -1,10 +1,13 @@
<x-layout>
<h1><a class="text-decoration-none" href="{{route('index')}}">List of Courses</a> <small class="text-muted">{{ request()->has('track')?:request()->track }}</small></h1>
<h1><a class="text-decoration-none" href="{{route('index')}}">List of Courses</a> <small
class="text-muted">{{ request()->has('track')?:request()->track }}</small></h1>
<table class="table table-sm">
<thead>
<tr>
<th></th>
<th>Name</th>
<th>
<a href="?order=name&dir={{ request()->has('dir')? ['asc'=>'desc', 'desc'=>'asc'][request()->dir]: 'desc'}}">Name</a>
</th>
<th>Tracks</th>
<th>Sync</th>
<th>Estimate file size</th>
@@ -16,17 +19,22 @@
<td><img src="{{ $course->thumbnail }}" alt="{{ $course->name }}" class="img-thumbnail"
style="width: 70px;"></td>
<td class="align-middle">
<a class="text-decoration-none" href="{{ route('course.index', ['course' => $course->id]) }}">{{ $course->name }}</a>
<a class="text-decoration-none"
href="{{ route('course.index', ['course' => $course->id]) }}">{{ $course->name }}</a>
<p class="text-muted">
course status: <span class="fw-lighter">{{ $course->status }}</span>
published: <span class="fw-lighter"><abbr title="{{ $course->published_at?->format('Y-m-d') }}">{{ $course->published_at?->diffForHumans() }}</abbr></span>
synced chapters: <span class="fw-lighter">{{ $course->chapters_to_sync }} of {{ $course->numberofchapters }}</span>
published: <span class="fw-lighter"><a
href="?order=published_at&dir={{ request()->has('dir')? ['asc'=>'desc', 'desc'=>'asc'][request()->dir]: 'desc'}}"><abbr
title="{{ $course->published_at?->format('Y-m-d') }}">{{ $course->published_at?->diffForHumans() }}</abbr></a></span>
synced chapters: <span
class="fw-lighter">{{ $course->chapters_to_sync }} of {{ $course->numberofchapters }}</span>
</p>
</td>
<td class="align-middle">
@foreach($course->tracks as $track)
<a href="{{ route('index.track', ['track' => $track]) }}" class="badge rounded-pill bg-secondary text-decoration-none">{{ $track }}</a>
<a href="{{ route('index.track', ['track' => $track]) }}"
class="badge rounded-pill bg-secondary text-decoration-none">{{ $track }}</a>
@endforeach
</td>
<td class="align-middle"><a class="btn btn-outline-primary"