= $this->extend('_layout') ?>
= $this->section('pageTitle') ?>
= lang('VideoClip.list.title') ?>
= $this->endSection() ?>
= $this->section('headerRight') ?>
= lang('VideoClip.create') ?>
= $this->endSection() ?>
= $this->section('content') ?>
= data_table(
[
[
'header' => lang('VideoClip.list.status.label'),
'cell' => function ($videoClip): string {
$pillVariantMap = [
'queued' => 'default',
'pending' => 'warning',
'running' => 'primary',
'canceled' => 'default',
'failed' => 'danger',
'passed' => 'success',
];
$pillIconMap = [
'queued' => 'timer-fill', // @icon("timer-fill")
'pending' => 'pause-fill', // @icon("pause-fill")
'running' => 'loader-fill', // @icon("loader-fill")
'canceled' => 'forbid-fill', // @icon("forbid-fill")
'failed' => 'close-fill', // @icon("close-fill")
'passed' => 'check-fill', // @icon("check-fill")
];
$pillIconClassMap = [
'queued' => '',
'pending' => '',
'running' => 'animate-spin',
'canceled' => '',
'failed' => '',
'passed' => '',
];
return '' . lang('VideoClip.list.status.' . $videoClip->status) . '';
},
],
[
'header' => lang('VideoClip.list.clip'),
'cell' => function ($videoClip): string {
$formatClass = [
'landscape' => 'aspect-video',
'portrait' => 'aspect-[9/16]',
'squared' => 'aspect-square',
];
return '' . icon('play-fill') . '
#' . $videoClip->id . ' – ' . esc($videoClip->title) . 'by ' . esc($videoClip->user->username) . '
' . format_duration((int) $videoClip->duration) . ' ';
},
],
[
'header' => lang('VideoClip.list.duration'),
'cell' => function (VideoClip $videoClip): string {
$duration = '';
if ($videoClip->job_started_at !== null) {
if ($videoClip->job_ended_at !== null) {
$duration = '
' .
'
' . icon('timer-fill', [
'class' => 'text-sm text-gray-400',
]) . format_duration((int) $videoClip->job_duration, true) . '
' .
'
' . icon('calendar-fill', [
'class' => 'text-sm text-gray-400',
]) . relative_time($videoClip->job_ended_at) . '
' .
'
';
} else {
$duration = '' . icon('timer-fill', [
'class' => 'text-sm text-gray-400',
]) . format_duration(($videoClip->job_started_at->difference(Time::now()))->getSeconds(), true) . '
';
}
}
return $duration;
},
],
[
'header' => lang('Common.actions'),
'cell' => function ($videoClip): string {
$downloadButton = '';
if ($videoClip->media) {
helper('misc');
$filename = 'clip-' . slugify($videoClip->title) . "-{$videoClip->start_time}-{$videoClip->end_time}";
// @icon("import-fill")
$downloadButton = '' . lang('VideoClip.download_clip') . '';
}
return '' . $downloadButton .
'' .
'' .
'
';
},
],
],
$videoClips,
'mb-6',
) ?>
= $pager->links() ?>
= $this->endSection() ?>