@extends('layouts.master') @section('title', $title) @section('page_css') @endsection @section('content')
Training videos
Short videos showing how to use each part of the system. @unless ($manage) You see the videos for the parts of the system you use. @endunless
@if ($manage) @endif
@if ($videos->isEmpty())
{{ $manage ? 'No videos yet — click "Add video" and paste a YouTube link.' : 'No training videos for you yet.' }}
@endif @foreach ($videos->groupBy(fn ($v) => $v->module ?: 'General') as $module => $group)
{{ $module }} {{ $group->count() }}
@foreach ($group as $v) @php $hidden = $manage && !in_array($v->id, $visibleIds ?? []); $editData = $v->only(['id', 'title', 'description', 'module', 'page', 'roles', 'users', 'sort_order', 'enabled']) + ['link' => $v->watchUrl()]; @endphp
@if ($v->thumbnail()) @else
Playlist
@endif
{{ $v->title }}
@if ($v->description)
{{ $v->description }}
@endif @if ($manage)
@php $who = collect($v->roles ?? [])->map(fn ($id) => $roles[$id] ?? null)->filter() ->merge(collect($v->users ?? [])->map(fn ($id) => $users->firstWhere('id', $id)?->name)->filter()); @endphp Who: {{ $who->isEmpty() ? 'everyone' : $who->implode(', ') }} @if ($v->page)
Page: {{ $v->page }}@endif @unless ($v->enabled)
Hidden@endunless @if ($hidden && $v->enabled)
Not shown to you yourself@endif
@endif
@endforeach
@endforeach @if ($manage) @endif @endsection @section('page_js') @endsection