feat: add heading component + update ecs rules to fix views

This commit is contained in:
Yassine Doghri 2021-09-08 15:51:33 +00:00
parent a50abc138d
commit 23bdc6f8e3
116 changed files with 2560 additions and 2004 deletions

View File

@ -1 +1,2 @@
/// <reference types="vite/client" /> /// <reference types="vite/client" />
declare module "*";

View File

@ -0,0 +1,38 @@
<?php
declare(strict_types=1);
namespace App\Views\Components;
use Exception;
use ViewComponents\Component;
class Heading extends Component
{
protected string $level = '';
/**
* @var "small"|"base"|"large"
*/
protected string $size = 'base';
public function render(): string
{
if ($this->level === '') {
throw new Exception('level property must be set for Heading component.');
}
$sizeClasses = [
'small' => 'tracking-wide text-base',
'base' => 'text-xl',
'large' => 'text-3xl',
];
$class = 'relative z-10 font-bold text-pine-800 font-display before:w-full before:absolute before:h-1/2 before:left-0 before:bottom-0 before:rounded-full before:bg-pine-100 before:-z-10 ' . $sizeClasses[$this->size];
$level = $this->level;
return <<<HTML
<h{$level} class="{$class}">{$this->slot}</h{$level}>
HTML;
}
}

View File

@ -1,4 +1,6 @@
<?php if (session()->has('message')): ?> <?php declare(strict_types=1);
if (session()->has('message')): ?>
<div class="px-4 py-2 mb-4 font-semibold text-green-900 bg-green-200 border border-green-700"> <div class="px-4 py-2 mb-4 font-semibold text-green-900 bg-green-200 border border-green-700">
<?= session('message') ?> <?= session('message') ?>
</div> </div>

View File

@ -1,5 +1,7 @@
<?php <?php
declare(strict_types=1);
use CodeIgniter\CLI\CLI; use CodeIgniter\CLI\CLI;
CLI::error('ERROR: ' . $code); CLI::error('ERROR: ' . $code);

View File

@ -1,19 +1,16 @@
<?php <?php
declare(strict_types=1);
use CodeIgniter\CLI\CLI; use CodeIgniter\CLI\CLI;
// The main Exception // The main Exception
CLI::newLine(); CLI::newLine();
CLI::write('[' . $exception::class . ']', 'light_gray', 'red'); CLI::write('[' . $exception::class . ']', 'light_gray', 'red');
CLI::newLine(); CLI::newLine();
CLI::write($message); CLI::write($message);
CLI::newLine(); CLI::newLine();
CLI::write( CLI::write('at ' . CLI::color(clean_path($exception->getFile()) . ':' . $exception->getLine(), 'green', ), );
'at ' .
CLI::color(
clean_path($exception->getFile()) . ':' . $exception->getLine(),
'green',
),
);
CLI::newLine(); CLI::newLine();
// The backtrace // The backtrace
if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE) { if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE) {
@ -24,8 +21,7 @@ if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE) {
} }
foreach ($backtraces as $i => $error) { foreach ($backtraces as $i => $error) {
$padFile = ' '; // 4 spaces $padFile = ' ';
$padClass = ' '; // 7 spaces
$c = str_pad($i + 1, 3, ' ', STR_PAD_LEFT); $c = str_pad($i + 1, 3, ' ', STR_PAD_LEFT);
if (isset($error['file'])) { if (isset($error['file'])) {
@ -33,9 +29,7 @@ if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE) {
CLI::write($c . $padFile . CLI::color($filepath, 'yellow')); CLI::write($c . $padFile . CLI::color($filepath, 'yellow'));
} else { } else {
CLI::write( CLI::write($c . $padFile . CLI::color('[internal function]', 'yellow'), );
$c . $padFile . CLI::color('[internal function]', 'yellow'),
);
} }
$function = ''; $function = '';
@ -47,7 +41,7 @@ if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE) {
: $error['type']; : $error['type'];
$function .= $function .=
$padClass . $error['class'] . $type . $error['function']; $padClass . $error['class'] . $type . $error['function'];
} elseif (!isset($error['class']) && isset($error['function'])) { } elseif (! isset($error['class']) && isset($error['function'])) {
$function .= $padClass . $error['function']; $function .= $padClass . $error['function'];
} }
@ -57,7 +51,7 @@ if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE) {
return match (true) { return match (true) {
is_object($value) => 'Object(' . $value::class . ')', is_object($value) => 'Object(' . $value::class . ')',
is_array($value) => $value !== [] ? '[...]' : '[]', is_array($value) => $value !== [] ? '[...]' : '[]',
is_null($value) => 'null', $value === null => 'null',
default => var_export($value, true), default => var_export($value, true),
}; };
}, array_values($error['args'] ?? [])), }, array_values($error['args'] ?? [])),

View File

@ -1,5 +1,7 @@
<?php <?php
declare(strict_types=1);
// On the CLI, we still want errors in productions // On the CLI, we still want errors in productions
// so just use the exception template. // so just use the exception template.
include __DIR__ . '/error_exception.php'; include __DIR__ . '/error_exception.php';

View File

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
use CodeIgniter\CodeIgniter; use CodeIgniter\CodeIgniter;
use Config\Services; use Config\Services;
@ -70,9 +70,9 @@ $errorId = uniqid('error', true); ?>
<?php if (isset($row['file']) && is_file($row['file'])): ?> <?php if (isset($row['file']) && is_file($row['file'])): ?>
<?php <?php
if (isset($row['function']) && in_array($row['function'], ['include', 'include_once', 'require', 'require_once'], true)) { if (isset($row['function']) && in_array($row['function'], ['include', 'include_once', 'require', 'require_once'], true)) {
echo esc($row['function'] . ' ' . static::cleanPath($row['file'])); echo esc($row['function'] . ' ' . static::cleanPath($row['file']));
} else { } else {
echo esc(static::cleanPath($row['file']) . ' : ' . $row['line']); echo esc(static::cleanPath($row['file']) . ' : ' . $row['line']);
} }
?> ?>
<?php else: ?> <?php else: ?>
@ -82,7 +82,7 @@ $errorId = uniqid('error', true); ?>
<!-- Class/Method --> <!-- Class/Method -->
<?php if (isset($row['class'])) : ?> <?php if (isset($row['class'])) : ?>
&nbsp;&nbsp;&mdash;&nbsp;&nbsp;<?= esc($row['class'] . $row['type'] . $row['function']) ?> &nbsp;&nbsp;&mdash;&nbsp;&nbsp;<?= esc($row['class'] . $row['type'] . $row['function']) ?>
<?php if (!empty($row['args'])) : ?> <?php if (! empty($row['args'])) : ?>
<?php $args_id = $errorId . 'args' . $index ?> <?php $args_id = $errorId . 'args' . $index ?>
( <a href="#" onclick="return toggle('<?= esc($args_id, 'attr') ?>');">arguments</a> ) ( <a href="#" onclick="return toggle('<?= esc($args_id, 'attr') ?>');">arguments</a> )
<div class="args" id="<?= esc($args_id, 'attr') ?>"> <div class="args" id="<?= esc($args_id, 'attr') ?>">
@ -91,9 +91,9 @@ $errorId = uniqid('error', true); ?>
<?php <?php
$params = null; $params = null;
// Reflection by name is not available for closure function // Reflection by name is not available for closure function
if (!str_ends_with($row['function'], '}')) { if (! str_ends_with($row['function'], '}')) {
$mirror = isset($row['class']) ? new ReflectionMethod($row['class'], $row['function']) : new ReflectionFunction($row['function']); $mirror = isset($row['class']) ? new ReflectionMethod($row['class'], $row['function']) : new ReflectionFunction($row['function']);
$params = $mirror->getParameters(); $params = $mirror->getParameters();
} }
foreach ($row['args'] as $key => $value): ?> foreach ($row['args'] as $key => $value): ?>
<tr> <tr>
@ -111,7 +111,7 @@ $errorId = uniqid('error', true); ?>
<?php endif; ?> <?php endif; ?>
<?php endif; ?> <?php endif; ?>
<?php if (!isset($row['class']) && isset($row['function'])): ?> <?php if (! isset($row['class']) && isset($row['function'])): ?>
&nbsp;&nbsp;&mdash;&nbsp;&nbsp; <?= esc($row['function']) ?>() &nbsp;&nbsp;&mdash;&nbsp;&nbsp; <?= esc($row['function']) ?>()
<?php endif; ?> <?php endif; ?>
</p> </p>
@ -132,9 +132,9 @@ $errorId = uniqid('error', true); ?>
<!-- Server --> <!-- Server -->
<div class="content" id="server"> <div class="content" id="server">
<?php foreach (['_SERVER', '_SESSION'] as $var): ?> <?php foreach (['_SERVER', '_SESSION'] as $var): ?>
<?php if (empty($GLOBALS[$var]) || !is_array($GLOBALS[$var])) { <?php if (empty($GLOBALS[$var]) || ! is_array($GLOBALS[$var])) {
continue; continue;
} ?> } ?>
<h3>$<?= esc($var) ?></h3> <h3>$<?= esc($var) ?></h3>
@ -165,7 +165,7 @@ $errorId = uniqid('error', true); ?>
<!-- Constants --> <!-- Constants -->
<?php $constants = get_defined_constants(true); ?> <?php $constants = get_defined_constants(true); ?>
<?php if (!empty($constants['user'])): ?> <?php if (! empty($constants['user'])): ?>
<h3>Constants</h3> <h3>Constants</h3>
<table> <table>
@ -234,9 +234,9 @@ $errorId = uniqid('error', true); ?>
<?php $empty = true; ?> <?php $empty = true; ?>
<?php foreach (['_GET', '_POST', '_COOKIE'] as $var): ?> <?php foreach (['_GET', '_POST', '_COOKIE'] as $var): ?>
<?php if (empty($GLOBALS[$var]) || !is_array($GLOBALS[$var])) { <?php if (empty($GLOBALS[$var]) || ! is_array($GLOBALS[$var])) {
continue; continue;
} ?> } ?>
<?php $empty = false; ?> <?php $empty = false; ?>
@ -276,7 +276,7 @@ $errorId = uniqid('error', true); ?>
<?php endif; ?> <?php endif; ?>
<?php $headers = $request->getHeaders(); ?> <?php $headers = $request->getHeaders(); ?>
<?php if (!empty($headers)): ?> <?php if (! empty($headers)): ?>
<h3>Headers</h3> <h3>Headers</h3>
@ -290,11 +290,11 @@ $errorId = uniqid('error', true); ?>
<tbody> <tbody>
<?php foreach ($headers as $value): ?> <?php foreach ($headers as $value): ?>
<?php if (empty($value)) { <?php if (empty($value)) {
continue; continue;
} ?> } ?>
<?php if (!is_array($value)) { <?php if (! is_array($value)) {
$value = [$value]; $value = [$value];
} ?> } ?>
<?php foreach ($value as $h) : ?> <?php foreach ($value as $h) : ?>
<tr> <tr>
<td><?= esc($h->getName(), 'html') ?></td> <td><?= esc($h->getName(), 'html') ?></td>
@ -389,7 +389,7 @@ $errorId = uniqid('error', true); ?>
<p> <p>
Displayed at <?= esc(date('H:i:sa')) ?> &mdash; Displayed at <?= esc(date('H:i:sa')) ?> &mdash;
PHP: <?= esc(phpversion()) ?> &mdash; PHP: <?= esc(PHP_VERSION) ?> &mdash;
CodeIgniter: <?= esc(CodeIgniter::CI_VERSION) ?> CodeIgniter: <?= esc(CodeIgniter::CI_VERSION) ?>
</p> </p>

View File

@ -1,10 +1,8 @@
<?php <?php declare(strict_types=1);
use CodeIgniter\Pager\PagerRenderer; use CodeIgniter\Pager\PagerRenderer;
/** /** @var PagerRenderer $pager */
* @var PagerRenderer $pager
*/
$pager->setSurroundCount(2); $pager->setSurroundCount(2);
?> ?>
@ -23,8 +21,8 @@ $pager->setSurroundCount(2);
'Pager.previous', 'Pager.previous',
) ?>" class="block px-3 py-2 text-gray-700 hover:bg-gray-200 hover:text-black"> ) ?>" class="block px-3 py-2 text-gray-700 hover:bg-gray-200 hover:text-black">
<span aria-hidden="true"><?= lang( <span aria-hidden="true"><?= lang(
'Pager.previous', 'Pager.previous',
) ?></span> ) ?></span>
</a> </a>
</li> </li>
<?php endif; ?> <?php endif; ?>
@ -48,15 +46,15 @@ $pager->setSurroundCount(2);
<?php if ($pager->hasNextPage()): ?> <?php if ($pager->hasNextPage()): ?>
<li> <li>
<a href="<?= $pager->getNextPage() ?>" aria-label="<?= lang( <a href="<?= $pager->getNextPage() ?>" aria-label="<?= lang(
'Pager.next', 'Pager.next',
) ?>" class="block px-3 py-2 text-gray-700 hover:bg-gray-200 hover:text-black"> ) ?>" class="block px-3 py-2 text-gray-700 hover:bg-gray-200 hover:text-black">
<span aria-hidden="true"><?= lang('Pager.next') ?></span> <span aria-hidden="true"><?= lang('Pager.next') ?></span>
</a> </a>
</li> </li>
<li> <li>
<a href="<?= $pager->getLast() ?>" aria-label="<?= lang( <a href="<?= $pager->getLast() ?>" aria-label="<?= lang(
'Pager.last', 'Pager.last',
) ?>" class="block px-3 py-2 text-gray-700 hover:bg-gray-200 hover:text-black"> ) ?>" class="block px-3 py-2 text-gray-700 hover:bg-gray-200 hover:text-black">
<span aria-hidden="true"><?= lang('Pager.last') ?></span> <span aria-hidden="true"><?= lang('Pager.last') ?></span>
</a> </a>
</li> </li>

25
ecs.php
View File

@ -1,9 +1,11 @@
<?php <?php
use PhpCsFixer\Fixer\Whitespace\IndentationTypeFixer;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\CodingStandard\Fixer\Naming\StandardizeHereNowDocKeywordFixer; use Symplify\CodingStandard\Fixer\Naming\StandardizeHereNowDocKeywordFixer;
use Symplify\EasyCodingStandard\ValueObject\Option; use Symplify\EasyCodingStandard\ValueObject\Option;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList; use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
use Symplify\CodingStandard\Fixer\LineLength\LineLengthFixer;
return static function (ContainerConfigurator $containerConfigurator): void { return static function (ContainerConfigurator $containerConfigurator): void {
$parameters = $containerConfigurator->parameters(); $parameters = $containerConfigurator->parameters();
@ -12,21 +14,32 @@ return static function (ContainerConfigurator $containerConfigurator): void {
$parameters->set(Option::PATHS, [ $parameters->set(Option::PATHS, [
__DIR__ . '/app', __DIR__ . '/app',
__DIR__ . '/modules', __DIR__ . '/modules',
__DIR__ . '/themes',
__DIR__ . '/tests', __DIR__ . '/tests',
__DIR__ . '/public', __DIR__ . '/public',
__DIR__ . '/public',
]); ]);
$parameters->set(Option::SKIP, [ $parameters->set(Option::SKIP, [
// TODO: restrict some rules for views?
__DIR__ . '/app/Views/*',
__DIR__ . '/modules/**/Views/*',
// skip specific generated files // skip specific generated files
__DIR__ . '/modules/Admin/Language/*/PersonsTaxonomy.php', __DIR__ . '/modules/Admin/Language/*/PersonsTaxonomy.php',
StandardizeHereNowDocKeywordFixer::class => [ StandardizeHereNowDocKeywordFixer::class => [
__DIR__ . '/app/View/Components', __DIR__ . '/app/Views/Components/*',
__DIR__ . '/modules/**/View/Components', __DIR__ . '/modules/**/Views/Components/*',
__DIR__ . '/themes/**/Views/Components/*',
],
LineLengthFixer::class => [
__DIR__ . '/app/Views/*',
__DIR__ . '/modules/**/Views/*',
__DIR__ . '/themes/*',
],
IndentationTypeFixer::class => [
__DIR__ . '/app/Views/*',
__DIR__ . '/modules/**/Views/*',
__DIR__ . '/themes/*',
] ]
]); ]);

View File

@ -4,7 +4,6 @@ module.exports = {
mode: "jit", mode: "jit",
purge: [ purge: [
"./app/Views/**/*.php", "./app/Views/**/*.php",
"./app/View/Components/**/*.php",
"./modules/**/Views/**/*.php", "./modules/**/Views/**/*.php",
"./themes/**/*.php", "./themes/**/*.php",
"./app/Helpers/*.php", "./app/Helpers/*.php",
@ -49,6 +48,9 @@ module.exports = {
gridTemplateColumns: { gridTemplateColumns: {
podcasts: "repeat(auto-fill, minmax(14rem, 1fr))", podcasts: "repeat(auto-fill, minmax(14rem, 1fr))",
}, },
zIndex: {
"-10": "-10",
},
}, },
}, },
variants: {}, variants: {},

View File

@ -1,5 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="<?= service('request')->getLocale() ?>"> <html lang="<?= service('request')
->getLocale() ?>">
<head> <head>
<meta charset="UTF-8"/> <meta charset="UTF-8"/>
@ -8,9 +9,12 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="shortcut icon" type="image/png" href="/favicon.ico" /> <link rel="shortcut icon" type="image/png" href="/favicon.ico" />
<?= service('vite')->asset('styles/index.css', 'css') ?> <?= service('vite')
<?= service('vite')->asset('js/admin.ts', 'js') ?> ->asset('styles/index.css', 'css') ?>
<?= service('vite')->asset('js/audio-player.ts', 'js') ?> <?= service('vite')
->asset('js/admin.ts', 'js') ?>
<?= service('vite')
->asset('js/audio-player.ts', 'js') ?>
</head> </head>
<body class="relative bg-pine-50 holy-grail-grid"> <body class="relative bg-pine-50 holy-grail-grid">
@ -18,13 +22,13 @@
<header class="sticky top-0 z-50 flex items-center justify-between h-10 text-white border-b holy-grail__header bg-pine-800 border-pine-900"> <header class="sticky top-0 z-50 flex items-center justify-between h-10 text-white border-b holy-grail__header bg-pine-800 border-pine-900">
<div class="inline-flex items-center h-full"> <div class="inline-flex items-center h-full">
<a href="<?= route_to( <a href="<?= route_to(
'admin', 'admin',
) ?>" class="inline-flex items-center h-full px-2 border-r border-pine-900"> ) ?>" class="inline-flex items-center h-full px-2 border-r border-pine-900">
<?= (isset($podcast) ? icon('arrow-left', 'mr-2') : '') . svg('castopod-logo', 'h-6') ?> <?= (isset($podcast) ? icon('arrow-left', 'mr-2') : '') . svg('castopod-logo', 'h-6') ?>
</a> </a>
<a href="<?= route_to( <a href="<?= route_to(
'home', 'home',
) ?>" class="inline-flex items-center h-full px-6 text-sm font-semibold outline-none hover:underline focus:ring"> ) ?>" class="inline-flex items-center h-full px-6 text-sm font-semibold outline-none hover:underline focus:ring">
<?= lang('AdminNavigation.go_to_website') ?> <?= lang('AdminNavigation.go_to_website') ?>
<?= icon('external-link', 'ml-1 opacity-60') ?> <?= icon('external-link', 'ml-1 opacity-60') ?>
</a> </a>
@ -38,7 +42,8 @@
aria-haspopup="true" aria-haspopup="true"
aria-expanded="false"> aria-expanded="false">
<?= icon('account-circle', 'text-2xl opacity-60 mr-2') ?> <?= icon('account-circle', 'text-2xl opacity-60 mr-2') ?>
<?= user()->username ?> <?= user()
->username ?>
<?= icon('caret-down', 'ml-auto text-2xl') ?> <?= icon('caret-down', 'ml-auto text-2xl') ?>
</button> </button>
<nav <nav
@ -48,14 +53,14 @@
data-dropdown="menu" data-dropdown="menu"
data-dropdown-placement="bottom-end"> data-dropdown-placement="bottom-end">
<a class="px-4 py-1 hover:bg-gray-100" href="<?= route_to( <a class="px-4 py-1 hover:bg-gray-100" href="<?= route_to(
'my-account', 'my-account',
) ?>"><?= lang('AdminNavigation.account.my-account') ?></a> ) ?>"><?= lang('AdminNavigation.account.my-account') ?></a>
<a class="px-4 py-1 hover:bg-gray-100" href="<?= route_to( <a class="px-4 py-1 hover:bg-gray-100" href="<?= route_to(
'change-password', 'change-password',
) ?>"><?= lang('AdminNavigation.account.change-password') ?></a> ) ?>"><?= lang('AdminNavigation.account.change-password') ?></a>
<a class="px-4 py-1 hover:bg-gray-100" href="<?= route_to( <a class="px-4 py-1 hover:bg-gray-100" href="<?= route_to(
'logout', 'logout',
) ?>"><?= lang('AdminNavigation.account.logout') ?></a> ) ?>"><?= lang('AdminNavigation.account.logout') ?></a>
</nav> </nav>
</header> </header>
<aside id="admin-sidebar" class="sticky z-50 flex flex-col text-white transition duration-200 ease-in-out transform -translate-x-full border-r top-10 border-pine-900 bg-pine-800 holy-grail__sidebar md:translate-x-0"> <aside id="admin-sidebar" class="sticky z-50 flex flex-col text-white transition duration-200 ease-in-out transform -translate-x-full border-r top-10 border-pine-900 bg-pine-800 holy-grail__sidebar md:translate-x-0">
@ -80,15 +85,15 @@
<div class="flex flex-col"> <div class="flex flex-col">
<?= render_breadcrumb('text-gray-800 text-xs') ?> <?= render_breadcrumb('text-gray-800 text-xs') ?>
<div class="flex flex-wrap items-center"> <div class="flex flex-wrap items-center">
<h1 class="text-3xl font-bold font-display"><?= $this->renderSection( <Heading level="1" size="large"><?= $this->renderSection(
'pageTitle', 'pageTitle',
) ?></h1> ) ?></Heading>
<?= $this->renderSection('headerLeft') ?> <?= $this->renderSection('headerLeft') ?>
</div> </div>
</div> </div>
<div class="flex flex-wrap"><?= $this->renderSection( <div class="flex flex-wrap"><?= $this->renderSection(
'headerRight', 'headerRight',
) ?></div> ) ?></div>
</div> </div>
</header> </header>
<div class="container px-2 py-8 mx-auto md:px-12"> <div class="container px-2 py-8 mx-auto md:px-12">

View File

@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
$navigation = [ $navigation = [
'podcasts' => [ 'podcasts' => [
'icon' => 'mic', 'icon' => 'mic',
@ -12,8 +13,15 @@ $navigation = [
'icon' => 'star-smile', 'icon' => 'star-smile',
'items' => ['fediverse-blocked-actors', 'fediverse-blocked-domains'], 'items' => ['fediverse-blocked-actors', 'fediverse-blocked-domains'],
], ],
'users' => ['icon' => 'group', 'items' => ['user-list', 'user-create']], 'users' => [
'pages' => ['icon' => 'pages', 'items' => ['page-list', 'page-create']], 'icon' => 'group',
'items' => ['user-list', 'user-create'],
],
'pages' => [
'icon' => 'pages',
'items' => ['page-list', 'page-create'],
],
]; ?> ]; ?>
<nav class="flex flex-col flex-1 py-4 overflow-y-auto gap-y-4"> <nav class="flex flex-col flex-1 py-4 overflow-y-auto gap-y-4">
@ -29,9 +37,9 @@ $navigation = [
<li class="inline-flex"> <li class="inline-flex">
<a class="w-full py-1 pl-14 pr-2 text-sm outline-none hover:opacity-100 focus:ring<?= $isActive <a class="w-full py-1 pl-14 pr-2 text-sm outline-none hover:opacity-100 focus:ring<?= $isActive
? ' font-semibold opacity-100 inline-flex items-center' ? ' font-semibold opacity-100 inline-flex items-center'
: ' opacity-75' ?>" href="<?= route_to($item) ?>"><?= ($isActive ? icon('chevron-right', 'mr-2') : '') .lang( : ' opacity-75' ?>" href="<?= route_to($item) ?>"><?= ($isActive ? icon('chevron-right', 'mr-2') : '') . lang(
'AdminNavigation.' . $item, 'AdminNavigation.' . $item,
) ?></a> ) ?></a>
</li> </li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>

View File

@ -21,7 +21,7 @@
'id' => 'user', 'id' => 'user',
'class' => 'form-select mb-4', 'class' => 'form-select mb-4',
'required' => 'required', 'required' => 'required',
'placeholder' => lang('Contributor.form.user_placeholder') 'placeholder' => lang('Contributor.form.user_placeholder'),
]) ?> ]) ?>
<Forms.Label for="role"><?= lang('Contributor.form.role') ?></Forms.Label> <Forms.Label for="role"><?= lang('Contributor.form.role') ?></Forms.Label>
@ -29,14 +29,19 @@
'id' => 'role', 'id' => 'role',
'class' => 'form-select mb-4', 'class' => 'form-select mb-4',
'required' => 'required', 'required' => 'required',
'placeholder' => lang('Contributor.form.role_placeholder') 'placeholder' => lang('Contributor.form.role_placeholder'),
]) ?> ]) ?>
<?= button( <?= button(
lang('Contributor.form.submit_add'), lang('Contributor.form.submit_add'),
'', '',
['variant' => 'primary'], [
['type' => 'submit', 'class' => 'self-end'], 'variant' => 'primary',
],
[
'type' => 'submit',
'class' => 'self-end',
],
) ?> ) ?>
<?= form_close() ?> <?= form_close() ?>

View File

@ -26,8 +26,13 @@
<?= button( <?= button(
lang('Contributor.form.submit_edit'), lang('Contributor.form.submit_edit'),
'', '',
['variant' => 'primary'], [
['type' => 'submit', 'class' => 'self-end'], 'variant' => 'primary',
],
[
'type' => 'submit',
'class' => 'self-end',
],
) ?> ) ?>
<?= form_close() ?> <?= form_close() ?>

View File

@ -46,7 +46,9 @@
'variant' => 'info', 'variant' => 'info',
'size' => 'small', 'size' => 'small',
], ],
['class' => 'mr-2'], [
'class' => 'mr-2',
],
) . ) .
button( button(
lang('Contributor.remove'), lang('Contributor.remove'),
@ -59,7 +61,9 @@
'variant' => 'danger', 'variant' => 'danger',
'size' => 'small', 'size' => 'small',
], ],
['class' => 'mr-2'], [
'class' => 'mr-2',
],
); );
}, },
], ],

View File

@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
$podcastNavigation = [ $podcastNavigation = [
'dashboard' => [ 'dashboard' => [
'icon' => 'dashboard', 'icon' => 'dashboard',
@ -7,7 +8,7 @@ $podcastNavigation = [
]; ?> ]; ?>
<a href="<?= route_to('podcast-view', $podcast->id) ?>" class="flex items-center px-4 py-2 border-b border-pine-900 focus:ring"> <a href="<?= route_to('podcast-view', $podcast->id) ?>" class="flex items-center px-4 py-2 border-b border-pine-900 focus:ring">
<?= icon('arrow-left', 'mr-2' ) ?> <?= icon('arrow-left', 'mr-2') ?>
<img <img
src="<?= $podcast->image->thumbnail_url ?>" src="<?= $podcast->image->thumbnail_url ?>"
alt="<?= $podcast->title ?>" alt="<?= $podcast->title ?>"
@ -24,12 +25,12 @@ $podcastNavigation = [
<div class="flex flex-col items-start flex-1 w-48 px-2"> <div class="flex flex-col items-start flex-1 w-48 px-2">
<span class="w-full font-semibold truncate" title="<?= $episode->title ?>"><?= $episode->title ?></span> <span class="w-full font-semibold truncate" title="<?= $episode->title ?>"><?= $episode->title ?></span>
<a href="<?= route_to( <a href="<?= route_to(
'episode', 'episode',
$podcast->handle, $podcast->handle,
$episode->slug, $episode->slug,
) ?>" class="inline-flex items-center text-xs outline-none hover:underline focus:ring"><?= lang( ) ?>" class="inline-flex items-center text-xs outline-none hover:underline focus:ring"><?= lang(
'EpisodeNavigation.go_to_page', 'EpisodeNavigation.go_to_page',
) ?> ) ?>
<?= icon('external-link', 'ml-1 opacity-60') ?> <?= icon('external-link', 'ml-1 opacity-60') ?>
</a> </a>
</div> </div>
@ -48,10 +49,10 @@ $podcastNavigation = [
<a class="w-full py-1 pl-14 pr-2 text-sm outline-none hover:opacity-100 focus:ring <?= $isActive <a class="w-full py-1 pl-14 pr-2 text-sm outline-none hover:opacity-100 focus:ring <?= $isActive
? 'font-semibold opacity-100 inline-flex items-center' ? 'font-semibold opacity-100 inline-flex items-center'
: 'opacity-75' ?>" href="<?= route_to( : 'opacity-75' ?>" href="<?= route_to(
$item, $item,
$podcast->id, $podcast->id,
$episode->id $episode->id
) ?>"><?= ($isActive ? icon('chevron-right', 'mr-2') : '') .lang('EpisodeNavigation.' . $item) ?></a> ) ?>"><?= ($isActive ? icon('chevron-right', 'mr-2') : '') . lang('EpisodeNavigation.' . $item) ?></a>
</li> </li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>

View File

@ -24,9 +24,9 @@
</div> </div>
<?= form_section( <?= form_section(
lang('Episode.form.info_section_title'), lang('Episode.form.info_section_title'),
lang('Episode.form.info_section_subtitle'), lang('Episode.form.info_section_subtitle'),
) ?> ) ?>
<Forms.Label for="audio_file" hint="<?= lang('Episode.form.audio_file_hint') ?>"><?= lang('Episode.form.audio_file') ?></Forms.Label> <Forms.Label for="audio_file" hint="<?= lang('Episode.form.audio_file_hint') ?>"><?= lang('Episode.form.audio_file') ?></Forms.Label>
<?= form_input([ <?= form_input([
@ -62,15 +62,15 @@
<Forms.Label for="slug"><?= lang('Episode.form.permalink') ?></Forms.Label> <Forms.Label for="slug"><?= lang('Episode.form.permalink') ?></Forms.Label>
<permalink-edit class="inline-flex items-center mb-4 text-xs" edit-label="<?= lang('Common.edit') ?>" copy-label="<?= lang('Common.copy') ?>" copied-label="<?= lang('Common.copied') ?>"> <permalink-edit class="inline-flex items-center mb-4 text-xs" edit-label="<?= lang('Common.edit') ?>" copy-label="<?= lang('Common.copy') ?>" copied-label="<?= lang('Common.copied') ?>">
<span slot="domain"><?= base_url('/@'. $podcast->handle . '/episodes' ) . '/' ?></span> <span slot="domain"><?= base_url('/@' . $podcast->handle . '/episodes') . '/' ?></span>
<?= form_input([ <?= form_input([
'id' => 'slug', 'id' => 'slug',
'name' => 'slug', 'name' => 'slug',
'class' => 'form-input flex-1 w-0 text-xs', 'class' => 'form-input flex-1 w-0 text-xs',
'value' => old('slug'), 'value' => old('slug'),
'required' => 'required', 'required' => 'required',
'data-slugify' => 'slug', 'data-slugify' => 'slug',
'slot' => 'slug-input' 'slot' => 'slug-input',
]) ?> ]) ?>
</permalink-edit> </permalink-edit>
@ -98,89 +98,105 @@
</div> </div>
<?= form_fieldset('', ['class' => 'mb-4']) ?> <?= form_fieldset('', [
'class' => 'mb-4',
]) ?>
<legend> <legend>
<?= lang('Episode.form.type.label') . <?= lang('Episode.form.type.label') .
hint_tooltip(lang('Episode.form.type.hint'), 'ml-1') ?> hint_tooltip(lang('Episode.form.type.hint'), 'ml-1') ?>
</legend> </legend>
<?= form_radio( <?= form_radio(
['id' => 'full', 'name' => 'type', 'class' => 'form-radio-btn'], [
'full', 'id' => 'full',
old('type') ? old('type') == 'full' : true, 'name' => 'type',
) ?> 'class' => 'form-radio-btn',
],
'full',
old('type') ? old('type') === 'full' : true,
) ?>
<label for="full" class="inline-flex items-center"> <label for="full" class="inline-flex items-center">
<?= lang('Episode.form.type.full') ?> <?= lang('Episode.form.type.full') ?>
</label> </label>
<?= form_radio( <?= form_radio(
['id' => 'trailer', 'name' => 'type', 'class' => 'form-radio-btn'], [
'trailer', 'id' => 'trailer',
old('type') && old('type') == 'trailer', 'name' => 'type',
) ?> 'class' => 'form-radio-btn',
],
'trailer',
old('type') && old('type') === 'trailer',
) ?>
<label for="trailer" class="inline-flex items-center"> <label for="trailer" class="inline-flex items-center">
<?= lang('Episode.form.type.trailer') ?> <?= lang('Episode.form.type.trailer') ?>
</label> </label>
<?= form_radio( <?= form_radio(
['id' => 'bonus', 'name' => 'type', 'class' => 'form-radio-btn'], [
'bonus', 'id' => 'bonus',
old('type') && old('type') == 'bonus', 'name' => 'type',
) ?> 'class' => 'form-radio-btn',
],
'bonus',
old('type') && old('type') === 'bonus',
) ?>
<label for="bonus" class="inline-flex items-center"> <label for="bonus" class="inline-flex items-center">
<?= lang('Episode.form.type.bonus') ?> <?= lang('Episode.form.type.bonus') ?>
</label> </label>
<?= form_fieldset_close() ?> <?= form_fieldset_close() ?>
<?= form_fieldset('', ['class' => 'flex mb-6 gap-1']) ?> <?= form_fieldset('', [
'class' => 'flex mb-6 gap-1',
]) ?>
<legend> <legend>
<?= lang('Episode.form.parental_advisory.label') . <?= lang('Episode.form.parental_advisory.label') .
hint_tooltip(lang('Episode.form.parental_advisory.hint'), 'ml-1') ?> hint_tooltip(lang('Episode.form.parental_advisory.hint'), 'ml-1') ?>
</legend> </legend>
<?= form_radio( <?= form_radio(
[ [
'id' => 'undefined', 'id' => 'undefined',
'name' => 'parental_advisory', 'name' => 'parental_advisory',
'class' => 'form-radio-btn', 'class' => 'form-radio-btn',
], ],
'undefined', 'undefined',
old('parental_advisory') old('parental_advisory')
? old('parental_advisory') === 'undefined' ? old('parental_advisory') === 'undefined'
: true, : true,
) ?> ) ?>
<label for="undefined"><?= lang( <label for="undefined"><?= lang(
'Episode.form.parental_advisory.undefined', 'Episode.form.parental_advisory.undefined',
) ?></label> ) ?></label>
<?= form_radio( <?= form_radio(
[ [
'id' => 'clean', 'id' => 'clean',
'name' => 'parental_advisory', 'name' => 'parental_advisory',
'class' => 'form-radio-btn', 'class' => 'form-radio-btn',
], ],
'clean', 'clean',
old('parental_advisory') && old('parental_advisory') === 'clean', old('parental_advisory') && old('parental_advisory') === 'clean',
) ?> ) ?>
<label for="clean"><?= lang( <label for="clean"><?= lang(
'Episode.form.parental_advisory.clean', 'Episode.form.parental_advisory.clean',
) ?></label> ) ?></label>
<?= form_radio( <?= form_radio(
[ [
'id' => 'explicit', 'id' => 'explicit',
'name' => 'parental_advisory', 'name' => 'parental_advisory',
'class' => 'form-radio-btn', 'class' => 'form-radio-btn',
], ],
'explicit', 'explicit',
old('parental_advisory') && old('parental_advisory') === 'explicit', old('parental_advisory') && old('parental_advisory') === 'explicit',
) ?> ) ?>
<label for="explicit"><?= lang( <label for="explicit"><?= lang(
'Episode.form.parental_advisory.explicit', 'Episode.form.parental_advisory.explicit',
) ?></label> ) ?></label>
<?= form_fieldset_close() ?> <?= form_fieldset_close() ?>
<?= form_section_close() ?> <?= form_section_close() ?>
<?= form_section( <?= form_section(
lang('Episode.form.show_notes_section_title'), lang('Episode.form.show_notes_section_title'),
lang('Episode.form.show_notes_section_subtitle'), lang('Episode.form.show_notes_section_subtitle'),
) ?> ) ?>
<div class="mb-4"> <div class="mb-4">
<Forms.Label for="description"><?= lang('Episode.form.description') ?></Forms.Label> <Forms.Label for="description"><?= lang('Episode.form.description') ?></Forms.Label>
@ -195,9 +211,9 @@
<?= form_section_close() ?> <?= form_section_close() ?>
<?= form_section( <?= form_section(
lang('Episode.form.location_section_title'), lang('Episode.form.location_section_title'),
lang('Episode.form.location_section_subtitle'), lang('Episode.form.location_section_subtitle'),
) ?> ) ?>
<Forms.Label for="location_name" hint="<?= lang('Episode.form.location_name_hint') ?>" isOptional="true"><?= lang('Episode.form.location_name') ?></Forms.Label> <Forms.Label for="location_name" hint="<?= lang('Episode.form.location_name_hint') ?>" isOptional="true"><?= lang('Episode.form.location_name') ?></Forms.Label>
<?= form_input([ <?= form_input([
@ -213,7 +229,9 @@
lang('Episode.form.additional_files_section_subtitle'), lang('Episode.form.additional_files_section_subtitle'),
) ?> ) ?>
<?= form_fieldset('', ['class' => 'flex flex-col mb-4']) ?> <?= form_fieldset('', [
'class' => 'flex flex-col mb-4',
]) ?>
<legend><?= lang('Episode.form.transcript') . <legend><?= lang('Episode.form.transcript') .
'<small class="ml-1 lowercase">(' . '<small class="ml-1 lowercase">(' .
lang('Common.optional') . lang('Common.optional') .
@ -226,17 +244,17 @@
? 'checked' ? 'checked'
: '' ?> /> : '' ?> />
<label for="transcript-file-upload-choice"><?= lang( <label for="transcript-file-upload-choice"><?= lang(
'Common.forms.upload_file', 'Common.forms.upload_file',
) ?></label> ) ?></label>
<input type="radio" name="transcript-choice" id="transcript-file-remote-url-choice" aria-controls="transcript-file-remote-url-choice" value="remote-url" <?= old( <input type="radio" name="transcript-choice" id="transcript-file-remote-url-choice" aria-controls="transcript-file-remote-url-choice" value="remote-url" <?= old(
'transcript-choice', 'transcript-choice',
) === 'remote-url' ) === 'remote-url'
? 'checked' ? 'checked'
: '' ?> /> : '' ?> />
<label for="transcript-file-remote-url-choice"><?= lang( <label for="transcript-file-remote-url-choice"><?= lang(
'Common.forms.remote_url', 'Common.forms.remote_url',
) ?></label> ) ?></label>
<div class="py-2 tab-panels"> <div class="py-2 tab-panels">
<section id="transcript-file-upload" class="flex items-center tab-panel"> <section id="transcript-file-upload" class="flex items-center tab-panel">
@ -264,7 +282,9 @@
</div> </div>
<?= form_fieldset_close() ?> <?= form_fieldset_close() ?>
<?= form_fieldset('', ['class' => 'flex flex-col mb-4']) ?> <?= form_fieldset('', [
'class' => 'flex flex-col mb-4',
]) ?>
<legend><?= lang('Episode.form.chapters') . <legend><?= lang('Episode.form.chapters') .
'<small class="ml-1 lowercase">(' . '<small class="ml-1 lowercase">(' .
lang('Common.optional') . lang('Common.optional') .
@ -277,17 +297,17 @@
? 'checked' ? 'checked'
: '' ?> /> : '' ?> />
<label for="chapters-file-upload-choice"><?= lang( <label for="chapters-file-upload-choice"><?= lang(
'Common.forms.upload_file', 'Common.forms.upload_file',
) ?></label> ) ?></label>
<input type="radio" name="chapters-choice" id="chapters-file-remote-url-choice" aria-controls="chapters-file-remote-url-choice" value="remote-url" <?= old( <input type="radio" name="chapters-choice" id="chapters-file-remote-url-choice" aria-controls="chapters-file-remote-url-choice" value="remote-url" <?= old(
'chapters-choice', 'chapters-choice',
) === 'remote-url' ) === 'remote-url'
? 'checked' ? 'checked'
: '' ?> /> : '' ?> />
<label for="chapters-file-remote-url-choice"><?= lang( <label for="chapters-file-remote-url-choice"><?= lang(
'Common.forms.remote_url', 'Common.forms.remote_url',
) ?></label> ) ?></label>
<div class="py-2 tab-panels"> <div class="py-2 tab-panels">
<section id="chapters-file-upload" class="flex items-center tab-panel"> <section id="chapters-file-upload" class="flex items-center tab-panel">
@ -318,9 +338,9 @@
<?= form_section_close() ?> <?= form_section_close() ?>
<?= form_section( <?= form_section(
lang('Episode.form.advanced_section_title'), lang('Episode.form.advanced_section_title'),
lang('Episode.form.advanced_section_subtitle'), lang('Episode.form.advanced_section_subtitle'),
) ?> ) ?>
<Forms.Label for="custom_rss" hint="<?= lang('Episode.form.custom_rss_hint') ?>" isOptional="true"><?= lang('Episode.form.custom_rss') ?></Forms.Label> <Forms.Label for="custom_rss" hint="<?= lang('Episode.form.custom_rss_hint') ?>" isOptional="true"><?= lang('Episode.form.custom_rss') ?></Forms.Label>
<Forms.XMLEditor id="custom_rss" name="custom_rss"><?= old('custom_rss', '', false) ?></Forms.XMLEditor> <Forms.XMLEditor id="custom_rss" name="custom_rss"><?= old('custom_rss', '', false) ?></Forms.XMLEditor>
@ -329,11 +349,16 @@
<Forms.Toggler id="block" name="block" value="yes" checked="<?= old('block', false) ?>" hint="<?= lang('Episode.form.block_hint') ?>"><?= lang('Episode.form.block') ?></Forms.Toggler> <Forms.Toggler id="block" name="block" value="yes" checked="<?= old('block', false) ?>" hint="<?= lang('Episode.form.block_hint') ?>"><?= lang('Episode.form.block') ?></Forms.Toggler>
<?= button( <?= button(
lang('Episode.form.submit_create'), lang('Episode.form.submit_create'),
'', '',
['variant' => 'primary'], [
['type' => 'submit', 'class' => 'self-end'], 'variant' => 'primary',
) ?> ],
[
'type' => 'submit',
'class' => 'self-end',
],
) ?>
<?= form_close() ?> <?= form_close() ?>

View File

@ -23,8 +23,8 @@
</div> </div>
<?= form_section( <?= form_section(
lang('Episode.form.info_section_title'), lang('Episode.form.info_section_title'),
'<img '<img
src="' . src="' .
$episode->image->medium_url . $episode->image->medium_url .
'" '"
@ -33,7 +33,7 @@
'" '"
class="w-48" class="w-48"
/>', />',
) ?> ) ?>
<Forms.Label for="audio_file" hint="<?= lang('Episode.form.audio_file_hint') ?>"><?= lang('Episode.form.audio_file') ?></Forms.Label> <Forms.Label for="audio_file" hint="<?= lang('Episode.form.audio_file_hint') ?>"><?= lang('Episode.form.audio_file') ?></Forms.Label>
<?= form_input([ <?= form_input([
@ -76,7 +76,7 @@
'value' => old('slug', $episode->slug), 'value' => old('slug', $episode->slug),
'required' => 'required', 'required' => 'required',
'data-slugify' => 'slug', 'data-slugify' => 'slug',
'slot' => 'slug-input' 'slot' => 'slug-input',
]) ?> ]) ?>
</permalink-edit> </permalink-edit>
@ -103,93 +103,109 @@
</div> </div>
</div> </div>
<?= form_fieldset('', ['class' => 'flex mb-4 gap-1']) ?> <?= form_fieldset('', [
'class' => 'flex mb-4 gap-1',
]) ?>
<legend> <legend>
<?= lang('Episode.form.type.label') . <?= lang('Episode.form.type.label') .
hint_tooltip(lang('Episode.form.type.hint'), 'ml-1') ?> hint_tooltip(lang('Episode.form.type.hint'), 'ml-1') ?>
</legend> </legend>
<?= form_radio( <?= form_radio(
['id' => 'full', 'name' => 'type', 'class' => 'form-radio-btn'], [
'full', 'id' => 'full',
old('type') ? old('type') === 'full' : $episode->type === 'full', 'name' => 'type',
) ?> 'class' => 'form-radio-btn',
],
'full',
old('type') ? old('type') === 'full' : $episode->type === 'full',
) ?>
<label for="full" class="inline-flex items-center"> <label for="full" class="inline-flex items-center">
<?= lang('Episode.form.type.full') ?> <?= lang('Episode.form.type.full') ?>
</label> </label>
<?= form_radio( <?= form_radio(
['id' => 'trailer', 'name' => 'type', 'class' => 'form-radio-btn'], [
'trailer', 'id' => 'trailer',
old('type') ? old('type') === 'trailer' : $episode->type === 'trailer', 'name' => 'type',
) ?> 'class' => 'form-radio-btn',
],
'trailer',
old('type') ? old('type') === 'trailer' : $episode->type === 'trailer',
) ?>
<label for="trailer" class="inline-flex items-center"> <label for="trailer" class="inline-flex items-center">
<?= lang('Episode.form.type.trailer') ?> <?= lang('Episode.form.type.trailer') ?>
</label> </label>
<?= form_radio( <?= form_radio(
['id' => 'bonus', 'name' => 'type', 'class' => 'form-radio-btn'], [
'bonus', 'id' => 'bonus',
old('type') ? old('type') === 'bonus' : $episode->type === 'bonus', 'name' => 'type',
) ?> 'class' => 'form-radio-btn',
],
'bonus',
old('type') ? old('type') === 'bonus' : $episode->type === 'bonus',
) ?>
<label for="bonus" class="inline-flex items-center"> <label for="bonus" class="inline-flex items-center">
<?= lang('Episode.form.type.bonus') ?> <?= lang('Episode.form.type.bonus') ?>
</label> </label>
<?= form_fieldset_close() ?> <?= form_fieldset_close() ?>
<?= form_fieldset('', ['class' => 'mb-6']) ?> <?= form_fieldset('', [
'class' => 'mb-6',
]) ?>
<legend> <legend>
<?= lang('Episode.form.parental_advisory.label') . <?= lang('Episode.form.parental_advisory.label') .
hint_tooltip(lang('Episode.form.parental_advisory.hint'), 'ml-1') ?> hint_tooltip(lang('Episode.form.parental_advisory.hint'), 'ml-1') ?>
</legend> </legend>
<?= form_radio( <?= form_radio(
[ [
'id' => 'undefined', 'id' => 'undefined',
'name' => 'parental_advisory', 'name' => 'parental_advisory',
'class' => 'form-radio-btn', 'class' => 'form-radio-btn',
], ],
'undefined', 'undefined',
old('parental_advisory') old('parental_advisory')
? old('parental_advisory') === 'undefined' ? old('parental_advisory') === 'undefined'
: $episode->parental_advisory === null, : $episode->parental_advisory === null,
) ?> ) ?>
<label for="undefined"><?= lang( <label for="undefined"><?= lang(
'Episode.form.parental_advisory.undefined', 'Episode.form.parental_advisory.undefined',
) ?></label> ) ?></label>
<?= form_radio( <?= form_radio(
[ [
'id' => 'clean', 'id' => 'clean',
'name' => 'parental_advisory', 'name' => 'parental_advisory',
'class' => 'form-radio-btn', 'class' => 'form-radio-btn',
], ],
'clean', 'clean',
old('parental_advisory') old('parental_advisory')
? old('parental_advisory') === 'clean' ? old('parental_advisory') === 'clean'
: $episode->parental_advisory === 'clean', : $episode->parental_advisory === 'clean',
) ?> ) ?>
<label for="clean"><?= lang( <label for="clean"><?= lang(
'Episode.form.parental_advisory.clean', 'Episode.form.parental_advisory.clean',
) ?></label> ) ?></label>
<?= form_radio( <?= form_radio(
[ [
'id' => 'explicit', 'id' => 'explicit',
'name' => 'parental_advisory', 'name' => 'parental_advisory',
'class' => 'form-radio-btn', 'class' => 'form-radio-btn',
], ],
'explicit', 'explicit',
old('parental_advisory') old('parental_advisory')
? old('parental_advisory') === 'explicit' ? old('parental_advisory') === 'explicit'
: $episode->parental_advisory === 'explicit', : $episode->parental_advisory === 'explicit',
) ?> ) ?>
<label for="explicit"><?= lang( <label for="explicit"><?= lang(
'Episode.form.parental_advisory.explicit', 'Episode.form.parental_advisory.explicit',
) ?></label> ) ?></label>
<?= form_fieldset_close() ?> <?= form_fieldset_close() ?>
<?= form_section_close() ?> <?= form_section_close() ?>
<?= form_section( <?= form_section(
lang('Episode.form.show_notes_section_title'), lang('Episode.form.show_notes_section_title'),
lang('Episode.form.show_notes_section_subtitle'), lang('Episode.form.show_notes_section_subtitle'),
) ?> ) ?>
<div class="mb-4"> <div class="mb-4">
<Forms.Label for="description"><?= lang('Episode.form.description') ?></Forms.Label> <Forms.Label for="description"><?= lang('Episode.form.description') ?></Forms.Label>
@ -204,9 +220,9 @@
<?= form_section_close() ?> <?= form_section_close() ?>
<?= form_section( <?= form_section(
lang('Episode.form.location_section_title'), lang('Episode.form.location_section_title'),
lang('Episode.form.location_section_subtitle'), lang('Episode.form.location_section_subtitle'),
) ?> ) ?>
<Forms.Label for="location_name" hint="<?= lang('Episode.form.location_name_hint') ?>" isOptional="true"><?= lang('Episode.form.location_name') ?></Forms.Label> <Forms.Label for="location_name" hint="<?= lang('Episode.form.location_name_hint') ?>" isOptional="true"><?= lang('Episode.form.location_name') ?></Forms.Label>
<?= form_input([ <?= form_input([
@ -226,7 +242,9 @@
]), ]),
) ?> ) ?>
<?= form_fieldset('', ['class' => 'flex flex-col mb-4']) ?> <?= form_fieldset('', [
'class' => 'flex flex-col mb-4',
]) ?>
<legend><?= lang('Episode.form.transcript') . <legend><?= lang('Episode.form.transcript') .
'<small class="ml-1 lowercase">(' . '<small class="ml-1 lowercase">(' .
lang('Common.optional') . lang('Common.optional') .
@ -237,30 +255,30 @@
? '' ? ''
: 'checked' ?> /> : 'checked' ?> />
<label for="transcript-file-upload-choice"><?= lang( <label for="transcript-file-upload-choice"><?= lang(
'Common.forms.upload_file', 'Common.forms.upload_file',
) ?></label> ) ?></label>
<input type="radio" name="transcript-choice" id="transcript-file-remote-url-choice" aria-controls="transcript-file-remote-url-choice" value="remote-url" <?= $episode->transcript_file_remote_url <input type="radio" name="transcript-choice" id="transcript-file-remote-url-choice" aria-controls="transcript-file-remote-url-choice" value="remote-url" <?= $episode->transcript_file_remote_url
? 'checked' ? 'checked'
: '' ?> /> : '' ?> />
<label for="transcript-file-remote-url-choice"><?= lang( <label for="transcript-file-remote-url-choice"><?= lang(
'Common.forms.remote_url', 'Common.forms.remote_url',
) ?></label> ) ?></label>
<div class="py-2 tab-panels"> <div class="py-2 tab-panels">
<section id="transcript-file-upload" class="flex items-center tab-panel"> <section id="transcript-file-upload" class="flex items-center tab-panel">
<?php if ($episode->transcript_file) : ?> <?php if ($episode->transcript_file) : ?>
<div class="flex justify-between"> <div class="flex justify-between">
<?= anchor( <?= anchor(
$episode->transcript_file_url, $episode->transcript_file_url,
icon('file', 'mr-2 text-gray-500') . icon('file', 'mr-2 text-gray-500') .
$episode->transcript_file, $episode->transcript_file,
[ [
'class' => 'inline-flex items-center text-xs', 'class' => 'inline-flex items-center text-xs',
'target' => '_blank', 'target' => '_blank',
'rel' => 'noreferrer noopener', 'rel' => 'noreferrer noopener',
], ],
) . ) .
anchor( anchor(
route_to( route_to(
'transcript-delete', 'transcript-delete',
@ -307,7 +325,9 @@
</div> </div>
<?= form_fieldset_close() ?> <?= form_fieldset_close() ?>
<?= form_fieldset('', ['class' => 'flex flex-col mb-4']) ?> <?= form_fieldset('', [
'class' => 'flex flex-col mb-4',
]) ?>
<legend><?= lang('Episode.form.chapters') . <legend><?= lang('Episode.form.chapters') .
'<small class="ml-1 lowercase">(' . '<small class="ml-1 lowercase">(' .
lang('Common.optional') . lang('Common.optional') .
@ -318,29 +338,29 @@
? '' ? ''
: 'checked' ?> /> : 'checked' ?> />
<label for="chapters-file-upload-choice"><?= lang( <label for="chapters-file-upload-choice"><?= lang(
'Common.forms.upload_file', 'Common.forms.upload_file',
) ?></label> ) ?></label>
<input type="radio" name="chapters-choice" id="chapters-file-remote-url-choice" aria-controls="chapters-file-remote-url-choice" value="remote-url" <?= $episode->chapters_file_remote_url <input type="radio" name="chapters-choice" id="chapters-file-remote-url-choice" aria-controls="chapters-file-remote-url-choice" value="remote-url" <?= $episode->chapters_file_remote_url
? 'checked' ? 'checked'
: '' ?> /> : '' ?> />
<label for="chapters-file-remote-url-choice"><?= lang( <label for="chapters-file-remote-url-choice"><?= lang(
'Common.forms.remote_url', 'Common.forms.remote_url',
) ?></label> ) ?></label>
<div class="py-2 tab-panels"> <div class="py-2 tab-panels">
<section id="chapters-file-upload" class="flex items-center tab-panel"> <section id="chapters-file-upload" class="flex items-center tab-panel">
<?php if ($episode->chapters_file) : ?> <?php if ($episode->chapters_file) : ?>
<div class="flex justify-between"> <div class="flex justify-between">
<?= anchor( <?= anchor(
$episode->chapters_file_url, $episode->chapters_file_url,
icon('file', 'mr-2') . $episode->chapters_file, icon('file', 'mr-2') . $episode->chapters_file,
[ [
'class' => 'inline-flex items-center text-xs', 'class' => 'inline-flex items-center text-xs',
'target' => '_blank', 'target' => '_blank',
'rel' => 'noreferrer noopener', 'rel' => 'noreferrer noopener',
], ],
) . ) .
anchor( anchor(
route_to( route_to(
'chapters-delete', 'chapters-delete',
@ -390,9 +410,9 @@
<?= form_section_close() ?> <?= form_section_close() ?>
<?= form_section( <?= form_section(
lang('Episode.form.advanced_section_title'), lang('Episode.form.advanced_section_title'),
lang('Episode.form.advanced_section_subtitle'), lang('Episode.form.advanced_section_subtitle'),
) ?> ) ?>
<Forms.Label for="custom_rss" hint="<?= lang('Episode.form.custom_rss_hint') ?>" isOptional="true"><?= lang('Episode.form.custom_rss') ?></Forms.Label> <Forms.Label for="custom_rss" hint="<?= lang('Episode.form.custom_rss_hint') ?>" isOptional="true"><?= lang('Episode.form.custom_rss') ?></Forms.Label>
<Forms.XMLEditor id="custom_rss" name="custom_rss"><?= old('custom_rss', $episode->custom_rss_string, false) ?></Forms.XMLEditor> <Forms.XMLEditor id="custom_rss" name="custom_rss"><?= old('custom_rss', $episode->custom_rss_string, false) ?></Forms.XMLEditor>
@ -402,17 +422,25 @@
<div class="flex items-center justify-between"> <div class="flex items-center justify-between">
<?= button( <?= button(
lang('Episode.delete'), lang('Episode.delete'),
route_to('episode-delete', $podcast->id, $episode->id), route_to('episode-delete', $podcast->id, $episode->id),
['variant' => 'danger', 'iconLeft' => 'delete-bin'], [
) ?> 'variant' => 'danger',
'iconLeft' => 'delete-bin',
],
) ?>
<?= button( <?= button(
lang('Episode.form.submit_edit'), lang('Episode.form.submit_edit'),
'', '',
['variant' => 'primary'], [
['type' => 'submit', 'class' => 'self-end'], 'variant' => 'primary',
) ?> ],
[
'type' => 'submit',
'class' => 'self-end',
],
) ?>
</div> </div>
<?= form_close() ?> <?= form_close() ?>

View File

@ -17,10 +17,10 @@
<button style="<?= $theme[ <button style="<?= $theme[
'style' 'style'
] ?>" class="w-12 h-12 mr-1 border-2 border-gray-400 rounded-lg hover:border-white" title="<?= lang( ] ?>" class="w-12 h-12 mr-1 border-2 border-gray-400 rounded-lg hover:border-white" title="<?= lang(
"Episode.embeddable_player.{$themeKey}", "Episode.embeddable_player.{$themeKey}",
) ?>" data-type="theme-picker" data-url="<?= $episode->getEmbeddablePlayerUrl( ) ?>" data-type="theme-picker" data-url="<?= $episode->getEmbeddablePlayerUrl(
$themeKey, $themeKey,
) ?>"></button> ) ?>"></button>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
@ -28,38 +28,48 @@
<div class="flex items-center w-full mt-8"> <div class="flex items-center w-full mt-8">
<?= form_textarea( <?= form_textarea(
[ [
'id' => 'iframe', 'id' => 'iframe',
'name' => 'iframe', 'name' => 'iframe',
'class' => 'form-textarea w-full h-20 mr-2', 'class' => 'form-textarea w-full h-20 mr-2',
], ],
"<iframe width=\"100%\" height=\"280\" frameborder=\"0\" scrolling=\"no\" style=\"width: 100%; height: 280px; overflow: hidden;\" src=\"{$episode->embeddable_player_url}\"></iframe>", "<iframe width=\"100%\" height=\"280\" frameborder=\"0\" scrolling=\"no\" style=\"width: 100%; height: 280px; overflow: hidden;\" src=\"{$episode->embeddable_player_url}\"></iframe>",
) ?> ) ?>
<?= icon_button( <?= icon_button(
'file-copy', 'file-copy',
lang('Episode.embeddable_player.clipboard_iframe'), lang('Episode.embeddable_player.clipboard_iframe'),
'', '',
['variant' => 'default'], [
['data-type' => 'clipboard-copy', 'data-clipboard-target' => 'iframe'], 'variant' => 'default',
) ?> ],
[
'data-type' => 'clipboard-copy',
'data-clipboard-target' => 'iframe',
],
) ?>
</div> </div>
<div class="flex items-center w-full mt-4"> <div class="flex items-center w-full mt-4">
<?= form_textarea( <?= form_textarea(
[ [
'id' => 'url', 'id' => 'url',
'name' => 'url', 'name' => 'url',
'class' => 'form-textarea w-full h-10 mr-2', 'class' => 'form-textarea w-full h-10 mr-2',
], ],
$episode->embeddable_player_url, $episode->embeddable_player_url,
) ?> ) ?>
<?= icon_button( <?= icon_button(
'file-copy', 'file-copy',
lang('Episode.embeddable_player.clipboard_url'), lang('Episode.embeddable_player.clipboard_url'),
'', '',
['variant' => 'default'], [
['data-type' => 'clipboard-copy', 'data-clipboard-target' => 'url'], 'variant' => 'default',
) ?> ],
[
'data-type' => 'clipboard-copy',
'data-clipboard-target' => 'url',
],
) ?>
</div> </div>
<?= $this->endSection() ?> <?= $this->endSection() ?>

View File

@ -26,102 +26,102 @@
</p> </p>
<?= data_table( <?= data_table(
[
[ [
'header' => lang('Episode.list.episode'), [
'cell' => function ($episode, $podcast) { 'header' => lang('Episode.list.episode'),
return '<div class="flex">' . 'cell' => function ($episode, $podcast) {
'<div class="relative flex-shrink-0 mr-2">'. return '<div class="flex">' .
'<time class="absolute px-1 text-xs font-semibold text-white rounded bottom-2 right-2 bg-black/50" datetime="PT<?= $episode->audio_file_duration ?>S">' . '<div class="relative flex-shrink-0 mr-2">' .
format_duration( '<time class="absolute px-1 text-xs font-semibold text-white rounded bottom-2 right-2 bg-black/50" datetime="PT<?= $episode->audio_file_duration ?>S">' .
$episode->audio_file_duration, format_duration(
) . $episode->audio_file_duration,
'</time>' . ) .
'<img loading="lazy" src="' . $episode->image->thumbnail_url . '" alt="' . $episode->title . '" class="object-cover w-20 h-20 rounded-lg" />' . '</time>' .
'</div>' . '<img loading="lazy" src="' . $episode->image->thumbnail_url . '" alt="' . $episode->title . '" class="object-cover w-20 h-20 rounded-lg" />' .
'<a class="text-sm hover:underline" href="' . route_to( '</div>' .
'episode-view', '<a class="text-sm hover:underline" href="' . route_to(
$podcast->id, 'episode-view',
$episode->id, $podcast->id,
) . '">' . $episode->id,
'<h2 class="inline-flex w-full font-semibold leading-none group">' . ) . '">' .
episode_numbering( '<h2 class="inline-flex w-full font-semibold leading-none group">' .
$episode->number, episode_numbering(
$episode->season_number, $episode->number,
'text-xs font-semibold text-gray-600', $episode->season_number,
true, 'text-xs font-semibold text-gray-600',
) . true,
'<span class="mx-1">-</span>' . ) .
'<span class="mr-1 group-hover:underline">' . $episode->title . '</span>' . '<span class="mx-1">-</span>' .
'</h2>' . '<span class="mr-1 group-hover:underline">' . $episode->title . '</span>' .
'<p class="max-w-sm text-xs text-gray-600 line-clamp-2">' . $episode->description . '</p>' . '</h2>' .
'</a>' . '<p class="max-w-sm text-xs text-gray-600 line-clamp-2">' . $episode->description . '</p>' .
'</div>'; '</a>' .
}, '</div>';
},
],
[
'header' => lang('Episode.list.visibility'),
'cell' => function ($episode): string {
return publication_pill(
$episode->published_at,
$episode->publication_status,
);
},
],
[
'header' => lang('Episode.list.comments'),
'cell' => function ($episode): int {
return $episode->comments_count;
},
],
[
'header' => lang('Episode.list.actions'),
'cell' => function ($episode, $podcast) {
return '<button id="more-dropdown-<?= $episode->id ?>" type="button" class="inline-flex items-center p-1 outline-none focus:ring" data-dropdown="button" data-dropdown-target="more-dropdown-<?= $episode->id ?>-menu" aria-haspopup="true" aria-expanded="false">' .
icon('more') .
'</button>' .
'<nav id="more-dropdown-<?= $episode->id ?>-menu" class="flex flex-col py-2 text-black whitespace-no-wrap bg-white border rounded shadow" aria-labelledby="more-dropdown-<?= $episode->id ?>" data-dropdown="menu" data-dropdown-placement="bottom-start" data-dropdown-offset-x="0" data-dropdown-offset-y="-24">' .
'<a class="px-4 py-1 hover:bg-gray-100" href="' . route_to(
'episode-edit',
$podcast->id,
$episode->id,
) . '">' . lang('Episode.edit') . '</a>' .
'<a class="px-4 py-1 hover:bg-gray-100" href="' . route_to(
'embeddable-player-add',
$podcast->id,
$episode->id,
) . '">' . lang(
'Episode.embeddable_player.add',
) . '</a>' .
'<a class="px-4 py-1 hover:bg-gray-100" href="' . route_to(
'episode-persons-manage',
$podcast->id,
$episode->id,
) . '">' . lang('Person.persons') . '</a>' .
'<a class="px-4 py-1 hover:bg-gray-100" href="' . route_to(
'soundbites-edit',
$podcast->id,
$episode->id,
) . '">' . lang('Episode.soundbites') . '</a>' .
'<a class="px-4 py-1 hover:bg-gray-100" href="' . route_to(
'episode',
$podcast->handle,
$episode->slug,
) . '">' . lang('Episode.go_to_page') . '</a>' .
'<a class="px-4 py-1 hover:bg-gray-100" href="' . route_to(
'episode-delete',
$podcast->id,
$episode->id,
) . '">' . lang('Episode.delete') . '</a>' .
'</nav>' .
'</div>';
},
],
], ],
[ $episodes,
'header' => lang('Episode.list.visibility'), 'mb-6',
'cell' => function ($episode): string { $podcast
return publication_pill( ) ?>
$episode->published_at,
$episode->publication_status,
);
},
],
[
'header' => lang('Episode.list.comments'),
'cell' => function ($episode): int {
return $episode->comments_count;
},
],
[
'header' => lang('Episode.list.actions'),
'cell' => function ($episode, $podcast) {
return '<button id="more-dropdown-<?= $episode->id ?>" type="button" class="inline-flex items-center p-1 outline-none focus:ring" data-dropdown="button" data-dropdown-target="more-dropdown-<?= $episode->id ?>-menu" aria-haspopup="true" aria-expanded="false">' .
icon('more') .
'</button>' .
'<nav id="more-dropdown-<?= $episode->id ?>-menu" class="flex flex-col py-2 text-black whitespace-no-wrap bg-white border rounded shadow" aria-labelledby="more-dropdown-<?= $episode->id ?>" data-dropdown="menu" data-dropdown-placement="bottom-start" data-dropdown-offset-x="0" data-dropdown-offset-y="-24">' .
'<a class="px-4 py-1 hover:bg-gray-100" href="' . route_to(
'episode-edit',
$podcast->id,
$episode->id,
) . '">' . lang('Episode.edit') . '</a>' .
'<a class="px-4 py-1 hover:bg-gray-100" href="' . route_to(
'embeddable-player-add',
$podcast->id,
$episode->id,
) . '">' . lang(
'Episode.embeddable_player.add',
) . '</a>' .
'<a class="px-4 py-1 hover:bg-gray-100" href="' . route_to(
'episode-persons-manage',
$podcast->id,
$episode->id,
) . '">' . lang('Person.persons') . '</a>' .
'<a class="px-4 py-1 hover:bg-gray-100" href="' . route_to(
'soundbites-edit',
$podcast->id,
$episode->id,
) . '">' . lang('Episode.soundbites') . '</a>' .
'<a class="px-4 py-1 hover:bg-gray-100" href="' . route_to(
'episode',
$podcast->handle,
$episode->slug,
) . '">' . lang('Episode.go_to_page') . '</a>' .
'<a class="px-4 py-1 hover:bg-gray-100" href="' . route_to(
'episode-delete',
$podcast->id,
$episode->id,
) . '">' . lang('Episode.delete') . '</a>' .
'</nav>' .
'</div>';
},
],
],
$episodes,
'mb-6',
$podcast
) ?>
<?= $pager->links() ?> <?= $pager->links() ?>

View File

@ -12,8 +12,13 @@
<?= button( <?= button(
lang('Person.create'), lang('Person.create'),
route_to('person-create'), route_to('person-create'),
['variant' => 'primary', 'iconLeft' => 'add'], [
['class' => 'mr-2'], 'variant' => 'primary',
'iconLeft' => 'add',
],
[
'class' => 'mr-2',
],
) ?> ) ?>
<?= $this->endSection() ?> <?= $this->endSection() ?>
@ -105,8 +110,13 @@
<?= button( <?= button(
lang('Person.episode_form.submit_add'), lang('Person.episode_form.submit_add'),
'', '',
['variant' => 'primary'], [
['type' => 'submit', 'class' => 'self-end'], 'variant' => 'primary',
],
[
'type' => 'submit',
'class' => 'self-end',
],
) ?> ) ?>
<?= form_close() ?> <?= form_close() ?>

View File

@ -14,45 +14,49 @@
<?= anchor( <?= anchor(
route_to('episode-view', $podcast->id, $episode->id), route_to('episode-view', $podcast->id, $episode->id),
icon('arrow-left', 'mr-2 text-lg') . lang('Episode.publish_form.back_to_episode_dashboard'), icon('arrow-left', 'mr-2 text-lg') . lang('Episode.publish_form.back_to_episode_dashboard'),
['class' => 'inline-flex items-center font-semibold mr-4 text-sm'], [
'class' => 'inline-flex items-center font-semibold mr-4 text-sm',
],
) ?> ) ?>
<?= form_open(route_to('episode-publish', $podcast->id, $episode->id), [ <?= form_open(route_to('episode-publish', $podcast->id, $episode->id), [
'method' => 'post', 'method' => 'post',
'class' => 'mx-auto flex flex-col max-w-xl items-start', 'class' => 'mx-auto flex flex-col max-w-xl items-start',
'data-submit' => 'validate-message' 'data-submit' => 'validate-message',
]) ?> ]) ?>
<?= csrf_field() ?> <?= csrf_field() ?>
<?= form_hidden('client_timezone', 'UTC') ?> <?= form_hidden('client_timezone', 'UTC') ?>
<label for="message" class="text-lg font-semibold"><?= lang( <label for="message" class="text-lg font-semibold"><?= lang(
'Episode.publish_form.post', 'Episode.publish_form.post',
) ?></label> ) ?></label>
<small class="max-w-md mb-2 text-gray-600"><?= lang('Episode.publish_form.post_hint') ?></small> <small class="max-w-md mb-2 text-gray-600"><?= lang('Episode.publish_form.post_hint') ?></small>
<div class="mb-8 overflow-hidden bg-white shadow-md rounded-xl"> <div class="mb-8 overflow-hidden bg-white shadow-md rounded-xl">
<div class="flex px-4 py-3"> <div class="flex px-4 py-3">
<img src="<?= $podcast->actor->avatar_image_url ?>" alt="<?= $podcast <img src="<?= $podcast->actor->avatar_image_url ?>" alt="<?= $podcast
->actor->display_name ?>" class="w-12 h-12 mr-4 rounded-full" /> ->actor->display_name ?>" class="w-12 h-12 mr-4 rounded-full" />
<p class="flex items-baseline min-w-0"> <p class="flex items-baseline min-w-0">
<span class="mr-2 font-semibold truncate"><?= $podcast->actor <span class="mr-2 font-semibold truncate"><?= $podcast->actor
->display_name ?></span> ->display_name ?></span>
<span class="text-sm text-gray-500 truncate">@<?= $podcast->actor <span class="text-sm text-gray-500 truncate">@<?= $podcast->actor
->username ?></span> ->username ?></span>
</p> </p>
</div> </div>
<div class="px-4 mb-2"> <div class="px-4 mb-2">
<?= form_textarea( <?= form_textarea(
[ [
'id' => 'message', 'id' => 'message',
'name' => 'message', 'name' => 'message',
'class' => 'form-textarea min-w-0 w-full', 'class' => 'form-textarea min-w-0 w-full',
'placeholder' => 'Write your message...', 'placeholder' => 'Write your message...',
'autofocus' => '' 'autofocus' => '',
], ],
old('message', '', false), old('message', '', false),
['rows' => 2], [
) ?> 'rows' => 2,
],
) ?>
</div> </div>
<div class="flex"> <div class="flex">
<img src="<?= $episode->image->thumbnail_url ?>" alt="<?= $episode->title ?>" class="w-24 h-24" /> <img src="<?= $episode->image->thumbnail_url ?>" alt="<?= $episode->title ?>" class="w-24 h-24" />
@ -61,11 +65,11 @@
<div class="flex items-baseline"> <div class="flex items-baseline">
<span class="flex-1 w-0 mr-2 text-sm font-semibold truncate"><?= $episode->title ?></span> <span class="flex-1 w-0 mr-2 text-sm font-semibold truncate"><?= $episode->title ?></span>
<?= episode_numbering( <?= episode_numbering(
$episode->number, $episode->number,
$episode->season_number, $episode->season_number,
'text-xs font-semibold text-gray-600', 'text-xs font-semibold text-gray-600',
true, true,
) ?> ) ?>
</div> </div>
<div class="text-xs text-gray-600"> <div class="text-xs text-gray-600">
<time datetime="PT<?= $episode->audio_file_duration ?>S"> <time datetime="PT<?= $episode->audio_file_duration ?>S">
@ -78,59 +82,61 @@
</div> </div>
<footer class="flex justify-around px-6 py-3"> <footer class="flex justify-around px-6 py-3">
<span class="inline-flex items-center"><?= icon( <span class="inline-flex items-center"><?= icon(
'chat', 'chat',
'text-xl mr-1 text-gray-400', 'text-xl mr-1 text-gray-400',
) . '0' ?></span> ) . '0' ?></span>
<span class="inline-flex items-center"><?= icon( <span class="inline-flex items-center"><?= icon(
'repeat', 'repeat',
'text-xl mr-1 text-gray-400', 'text-xl mr-1 text-gray-400',
) . '0' ?></span> ) . '0' ?></span>
<span class="inline-flex items-center"><?= icon( <span class="inline-flex items-center"><?= icon(
'heart', 'heart',
'text-xl mr-1 text-gray-400', 'text-xl mr-1 text-gray-400',
) . '0' ?></span> ) . '0' ?></span>
</footer> </footer>
</div> </div>
<?= form_fieldset('', ['class' => 'flex flex-col mb-4']) ?> <?= form_fieldset('', [
'class' => 'flex flex-col mb-4',
]) ?>
<legend class="text-lg font-semibold"><?= lang( <legend class="text-lg font-semibold"><?= lang(
'Episode.publish_form.publication_date', 'Episode.publish_form.publication_date',
) ?></legend> ) ?></legend>
<label for="now" class="inline-flex items-center"> <label for="now" class="inline-flex items-center">
<?= form_radio( <?= form_radio(
[ [
'id' => 'now', 'id' => 'now',
'name' => 'publication_method', 'name' => 'publication_method',
'class' => 'text-pine-700', 'class' => 'text-pine-700',
], ],
'now', 'now',
old('publication_method') ? old('publish') === 'now' : true, old('publication_method') ? old('publish') === 'now' : true,
) ?> ) ?>
<span class="ml-2"><?= lang( <span class="ml-2"><?= lang(
'Episode.publish_form.publication_method.now', 'Episode.publish_form.publication_method.now',
) ?></span> ) ?></span>
</label> </label>
<div class="inline-flex flex-wrap items-center radio-toggler"> <div class="inline-flex flex-wrap items-center radio-toggler">
<?= form_radio( <?= form_radio(
[ [
'id' => 'schedule', 'id' => 'schedule',
'name' => 'publication_method', 'name' => 'publication_method',
'class' => 'text-pine-700', 'class' => 'text-pine-700',
], ],
'schedule', 'schedule',
old('publication_method') && old('publication_method') &&
old('publication_method') === 'schedule', old('publication_method') === 'schedule',
) ?> ) ?>
<label for="schedule" class="ml-2"><?= lang( <label for="schedule" class="ml-2"><?= lang(
'Episode.publish_form.publication_method.schedule', 'Episode.publish_form.publication_method.schedule',
) ?></label> ) ?></label>
<div class="w-full mt-2 radio-toggler-element"> <div class="w-full mt-2 radio-toggler-element">
<?= form_label( <?= form_label(
lang('Episode.publish_form.scheduled_publication_date'), lang('Episode.publish_form.scheduled_publication_date'),
'scheduled_publication_date', 'scheduled_publication_date',
[], [],
lang('Episode.publish_form.scheduled_publication_date_hint'), lang('Episode.publish_form.scheduled_publication_date_hint'),
) ?> ) ?>
<div class="flex" data-picker="datetime"> <div class="flex" data-picker="datetime">
<?= form_input([ <?= form_input([
'id' => 'scheduled_publication_date', 'id' => 'scheduled_publication_date',
@ -140,8 +146,8 @@
'data-input' => '', 'data-input' => '',
]) ?> ]) ?>
<button class="p-3 border border-l-0 border-gray-500 bg-pine-100 focus:outline-none rounded-r-md hover:bg-pine-200 focus:ring" type="button" title="<?= lang( <button class="p-3 border border-l-0 border-gray-500 bg-pine-100 focus:outline-none rounded-r-md hover:bg-pine-200 focus:ring" type="button" title="<?= lang(
'Episode.publish_form.scheduled_publication_date_clear', 'Episode.publish_form.scheduled_publication_date_clear',
) ?>" data-clear=""><?= icon('close') ?></button> ) ?>" data-clear=""><?= icon('close') ?></button>
</div> </div>
</div> </div>
</div> </div>
@ -150,26 +156,28 @@
<div id="publish-warning" class="inline-flex flex-col hidden p-4 text-black bg-yellow-300 border-2 border-yellow-900 rounded-md" role="alert"> <div id="publish-warning" class="inline-flex flex-col hidden p-4 text-black bg-yellow-300 border-2 border-yellow-900 rounded-md" role="alert">
<p class="flex items-baseline font-semibold"> <p class="flex items-baseline font-semibold">
<?= icon('alert', 'mr-2 text-lg flex-shrink-0') . lang( <?= icon('alert', 'mr-2 text-lg flex-shrink-0') . lang(
'Episode.publish_form.message_warning', 'Episode.publish_form.message_warning',
) ?></p> ) ?></p>
<p> <p>
<?= lang( <?= lang(
'Episode.publish_form.message_warning_hint', 'Episode.publish_form.message_warning_hint',
) ?> ) ?>
</p> </p>
</div> </div>
<?= button( <?= button(
lang('Episode.publish_form.submit'), lang('Episode.publish_form.submit'),
'', '',
['variant' => 'primary'], [
[ 'variant' => 'primary',
'class' => 'self-end mt-4', ],
'type' => 'submit', [
'data-btn-text-warning' => lang('Episode.publish_form.message_warning_submit'), 'class' => 'self-end mt-4',
'data-btn-text' => lang('Episode.publish_form.submit_edit') 'type' => 'submit',
], 'data-btn-text-warning' => lang('Episode.publish_form.message_warning_submit'),
) ?> 'data-btn-text' => lang('Episode.publish_form.submit_edit'),
],
) ?>
<?= form_close() ?> <?= form_close() ?>

View File

@ -13,13 +13,15 @@
<?= anchor( <?= anchor(
route_to('episode-view', $podcast->id, $episode->id), route_to('episode-view', $podcast->id, $episode->id),
icon('arrow-left', 'mr-2 text-lg') . lang('Episode.publish_form.back_to_episode_dashboard'), icon('arrow-left', 'mr-2 text-lg') . lang('Episode.publish_form.back_to_episode_dashboard'),
['class' => 'inline-flex items-center font-semibold mr-4 text-sm'], [
'class' => 'inline-flex items-center font-semibold mr-4 text-sm',
],
) ?> ) ?>
<?= form_open(route_to('episode-publish_edit', $podcast->id, $episode->id), [ <?= form_open(route_to('episode-publish_edit', $podcast->id, $episode->id), [
'method' => 'post', 'method' => 'post',
'class' => 'mx-auto flex flex-col max-w-xl items-start', 'class' => 'mx-auto flex flex-col max-w-xl items-start',
'data-submit' => 'validate-message' 'data-submit' => 'validate-message',
]) ?> ]) ?>
<?= csrf_field() ?> <?= csrf_field() ?>
<?= form_hidden('client_timezone', 'UTC') ?> <?= form_hidden('client_timezone', 'UTC') ?>
@ -27,8 +29,8 @@
<label for="message" class="text-lg font-semibold"><?= lang( <label for="message" class="text-lg font-semibold"><?= lang(
'Episode.publish_form.post', 'Episode.publish_form.post',
) ?></label> ) ?></label>
<small class="max-w-md mb-2 text-gray-600"><?= lang('Episode.publish_form.post_hint') ?></small> <small class="max-w-md mb-2 text-gray-600"><?= lang('Episode.publish_form.post_hint') ?></small>
<div class="mb-8 overflow-hidden bg-white shadow-md rounded-xl"> <div class="mb-8 overflow-hidden bg-white shadow-md rounded-xl">
<div class="flex px-4 py-3"> <div class="flex px-4 py-3">
@ -43,30 +45,32 @@
</div> </div>
<div class="px-4 mb-2"> <div class="px-4 mb-2">
<?= form_textarea( <?= form_textarea(
[ [
'id' => 'message', 'id' => 'message',
'name' => 'message', 'name' => 'message',
'class' => 'form-textarea', 'class' => 'form-textarea',
'placeholder' => 'Write your message...', 'placeholder' => 'Write your message...',
'autofocus' => '' 'autofocus' => '',
], ],
old('message', $post->message, false), old('message', $post->message, false),
['rows' => 2], [
) ?> 'rows' => 2,
],
) ?>
</div> </div>
<div class="flex"> <div class="flex">
<img src="<?= $episode->image <img src="<?= $episode->image
->thumbnail_url ?>" alt="<?= $episode->title ?>" class="w-24 h-24" /> ->thumbnail_url ?>" alt="<?= $episode->title ?>" class="w-24 h-24" />
<div class="flex flex-col flex-1"> <div class="flex flex-col flex-1">
<a href="<?= $episode->link ?>" class="flex-1 px-4 py-2 bg-gray-100"> <a href="<?= $episode->link ?>" class="flex-1 px-4 py-2 bg-gray-100">
<div class="flex items-baseline"> <div class="flex items-baseline">
<span class="flex-1 w-0 mr-2 text-sm font-semibold truncate"><?= $episode->title ?></span> <span class="flex-1 w-0 mr-2 text-sm font-semibold truncate"><?= $episode->title ?></span>
<?= episode_numbering( <?= episode_numbering(
$episode->number, $episode->number,
$episode->season_number, $episode->season_number,
'text-xs font-semibold text-gray-600', 'text-xs font-semibold text-gray-600',
true, true,
) ?> ) ?>
</div> </div>
<div class="text-xs text-gray-600"> <div class="text-xs text-gray-600">
<?= relative_time($episode->published_at) ?> <?= relative_time($episode->published_at) ?>
@ -81,60 +85,62 @@
</div> </div>
<footer class="flex justify-around px-6 py-3"> <footer class="flex justify-around px-6 py-3">
<span class="inline-flex items-center"><?= icon( <span class="inline-flex items-center"><?= icon(
'chat', 'chat',
'text-xl mr-1 text-gray-400', 'text-xl mr-1 text-gray-400',
) . '0' ?></span> ) . '0' ?></span>
<span class="inline-flex items-center"><?= icon( <span class="inline-flex items-center"><?= icon(
'repeat', 'repeat',
'text-xl mr-1 text-gray-400', 'text-xl mr-1 text-gray-400',
) . '0' ?></span> ) . '0' ?></span>
<span class="inline-flex items-center"><?= icon( <span class="inline-flex items-center"><?= icon(
'heart', 'heart',
'text-xl mr-1 text-gray-400', 'text-xl mr-1 text-gray-400',
) . '0' ?></span> ) . '0' ?></span>
</footer> </footer>
</div> </div>
<?= form_fieldset('', ['class' => 'flex flex-col mb-4']) ?> <?= form_fieldset('', [
'class' => 'flex flex-col mb-4',
]) ?>
<legend class="text-lg font-semibold"><?= lang( <legend class="text-lg font-semibold"><?= lang(
'Episode.publish_form.publication_date', 'Episode.publish_form.publication_date',
) ?></legend> ) ?></legend>
<label for="now" class="inline-flex items-center"> <label for="now" class="inline-flex items-center">
<?= form_radio( <?= form_radio(
[ [
'id' => 'now', 'id' => 'now',
'name' => 'publication_method', 'name' => 'publication_method',
'class' => 'text-pine-700', 'class' => 'text-pine-700',
], ],
'now', 'now',
old('publication_method') && old('publish') === 'now', old('publication_method') && old('publish') === 'now',
) ?> ) ?>
<span class="ml-2"><?= lang( <span class="ml-2"><?= lang(
'Episode.publish_form.publication_method.now', 'Episode.publish_form.publication_method.now',
) ?></span> ) ?></span>
</label> </label>
<div class="inline-flex flex-wrap items-center radio-toggler"> <div class="inline-flex flex-wrap items-center radio-toggler">
<?= form_radio( <?= form_radio(
[ [
'id' => 'schedule', 'id' => 'schedule',
'name' => 'publication_method', 'name' => 'publication_method',
'class' => 'text-pine-700', 'class' => 'text-pine-700',
], ],
'schedule', 'schedule',
old('publication_method') old('publication_method')
? old('publication_method') === 'schedule' ? old('publication_method') === 'schedule'
: true, : true,
) ?> ) ?>
<label for="schedule" class="ml-2"><?= lang( <label for="schedule" class="ml-2"><?= lang(
'Episode.publish_form.publication_method.schedule', 'Episode.publish_form.publication_method.schedule',
) ?></label> ) ?></label>
<div class="w-full mt-2 radio-toggler-element"> <div class="w-full mt-2 radio-toggler-element">
<?= form_label( <?= form_label(
lang('Episode.publish_form.scheduled_publication_date'), lang('Episode.publish_form.scheduled_publication_date'),
'scheduled_publication_date', 'scheduled_publication_date',
[], [],
lang('Episode.publish_form.scheduled_publication_date_hint'), lang('Episode.publish_form.scheduled_publication_date_hint'),
) ?> ) ?>
<div class="flex" data-picker="datetime"> <div class="flex" data-picker="datetime">
<?= form_input([ <?= form_input([
'id' => 'scheduled_publication_date', 'id' => 'scheduled_publication_date',
@ -159,32 +165,36 @@
<div id="publish-warning" class="inline-flex flex-col hidden p-4 text-black bg-yellow-300 border-2 border-yellow-900 rounded-md" role="alert"> <div id="publish-warning" class="inline-flex flex-col hidden p-4 text-black bg-yellow-300 border-2 border-yellow-900 rounded-md" role="alert">
<p class="flex items-baseline font-semibold"> <p class="flex items-baseline font-semibold">
<?= icon('alert', 'mr-2 text-lg flex-shrink-0') . lang( <?= icon('alert', 'mr-2 text-lg flex-shrink-0') . lang(
'Episode.publish_form.message_warning', 'Episode.publish_form.message_warning',
) ?></p> ) ?></p>
<p> <p>
<?= lang( <?= lang(
'Episode.publish_form.message_warning_hint', 'Episode.publish_form.message_warning_hint',
) ?> ) ?>
</p> </p>
</div> </div>
<div class="flex items-center justify-between w-full mt-4"> <div class="flex items-center justify-between w-full mt-4">
<?= anchor( <?= anchor(
route_to('episode-publish-cancel', $podcast->id, $episode->id), route_to('episode-publish-cancel', $podcast->id, $episode->id),
lang('Episode.publish_form.cancel_publication'), lang('Episode.publish_form.cancel_publication'),
['class' => 'py-2 px-3 rounded-full bg-red-100 text-red-900 font-semibold mr-4'], [
) ?> 'class' => 'py-2 px-3 rounded-full bg-red-100 text-red-900 font-semibold mr-4',
],
) ?>
<?= button( <?= button(
lang('Episode.publish_form.submit_edit'), lang('Episode.publish_form.submit_edit'),
'', '',
['variant' => 'primary'], [
[ 'variant' => 'primary',
'type' => 'submit', ],
'data-btn-text-warning' => lang('Episode.publish_form.message_warning_submit'), [
'data-btn-text' => lang('Episode.publish_form.submit_edit') 'type' => 'submit',
], 'data-btn-text-warning' => lang('Episode.publish_form.message_warning_submit'),
) ?> 'data-btn-text' => lang('Episode.publish_form.submit_edit'),
],
) ?>
</div> </div>
<?= form_close() ?> <?= form_close() ?>

View File

@ -13,7 +13,10 @@
<?= form_open_multipart( <?= form_open_multipart(
route_to('episode-soundbites-edit', $podcast->id, $episode->id), route_to('episode-soundbites-edit', $podcast->id, $episode->id),
['method' => 'post', 'class' => 'flex flex-col'], [
'method' => 'post',
'class' => 'flex flex-col',
],
) ?> ) ?>
<?= csrf_field() ?> <?= csrf_field() ?>
@ -27,24 +30,24 @@
<tr> <tr>
<th class="w-3/12 px-1 py-2"> <th class="w-3/12 px-1 py-2">
<?= form_label( <?= form_label(
lang('Episode.soundbites_form.start_time'), lang('Episode.soundbites_form.start_time'),
'start_time', 'start_time',
[], [],
lang('Episode.soundbites_form.start_time_hint'), lang('Episode.soundbites_form.start_time_hint'),
) ?></th> ) ?></th>
<th class="w-3/12 px-1 py-2"><?= form_label( <th class="w-3/12 px-1 py-2"><?= form_label(
lang('Episode.soundbites_form.duration'), lang('Episode.soundbites_form.duration'),
'duration', 'duration',
[], [],
lang('Episode.soundbites_form.duration_hint'), lang('Episode.soundbites_form.duration_hint'),
) ?></th> ) ?></th>
<th class="w-7/12 px-1 py-2"><?= form_label( <th class="w-7/12 px-1 py-2"><?= form_label(
lang('Episode.soundbites_form.label'), lang('Episode.soundbites_form.label'),
'label', 'label',
[], [],
lang('Episode.soundbites_form.label_hint'), lang('Episode.soundbites_form.label_hint'),
true, true,
) ?></th> ) ?></th>
<th class="w-1/12 px-1 py-2"></th> <th class="w-1/12 px-1 py-2"></th>
</tr> </tr>
</thead> </thead>
@ -52,124 +55,130 @@
<?php foreach ($episode->soundbites as $soundbite): ?> <?php foreach ($episode->soundbites as $soundbite): ?>
<tr> <tr>
<td class="px-1 py-2 font-medium bg-white border border-light-blue-500"><?= form_input( <td class="px-1 py-2 font-medium bg-white border border-light-blue-500"><?= form_input(
[ [
'type' => 'number', 'type' => 'number',
'min' => 0, 'min' => 0,
'max' => $episode->audio_file_duration, 'max' => $episode->audio_file_duration,
'step' => 'any', 'step' => 'any',
'id' => "soundbites[{$soundbite->id}][start_time]", 'id' => "soundbites[{$soundbite->id}][start_time]",
'name' => "soundbites[{$soundbite->id}][start_time]", 'name' => "soundbites[{$soundbite->id}][start_time]",
'class' => 'form-input w-full border-none text-center', 'class' => 'form-input w-full border-none text-center',
'value' => $soundbite->start_time, 'value' => $soundbite->start_time,
'data-type' => 'soundbite-field', 'data-type' => 'soundbite-field',
'data-field-type' => 'start-time', 'data-field-type' => 'start-time',
'data-soundbite-id' => $soundbite->id, 'data-soundbite-id' => $soundbite->id,
'required' => 'required', 'required' => 'required',
], ],
) ?></td> ) ?></td>
<td class="px-1 py-2 font-medium bg-white border border-light-blue-500"><?= form_input( <td class="px-1 py-2 font-medium bg-white border border-light-blue-500"><?= form_input(
[ [
'type' => 'number', 'type' => 'number',
'min' => 0, 'min' => 0,
'max' => $episode->audio_file_duration, 'max' => $episode->audio_file_duration,
'step' => 'any', 'step' => 'any',
'id' => "soundbites[{$soundbite->id}][duration]", 'id' => "soundbites[{$soundbite->id}][duration]",
'name' => "soundbites[{$soundbite->id}][duration]", 'name' => "soundbites[{$soundbite->id}][duration]",
'class' => 'form-input w-full border-none text-center', 'class' => 'form-input w-full border-none text-center',
'value' => $soundbite->duration, 'value' => $soundbite->duration,
'data-type' => 'soundbite-field', 'data-type' => 'soundbite-field',
'data-field-type' => 'duration', 'data-field-type' => 'duration',
'data-soundbite-id' => $soundbite->id, 'data-soundbite-id' => $soundbite->id,
'required' => 'required', 'required' => 'required',
], ],
) ?></td> ) ?></td>
<td class="px-1 py-2 font-medium bg-white border border-light-blue-500"><?= form_input( <td class="px-1 py-2 font-medium bg-white border border-light-blue-500"><?= form_input(
[ [
'id' => "soundbites[{$soundbite->id}][label]", 'id' => "soundbites[{$soundbite->id}][label]",
'name' => "soundbites[{$soundbite->id}][label]", 'name' => "soundbites[{$soundbite->id}][label]",
'class' => 'form-input w-full border-none', 'class' => 'form-input w-full border-none',
'value' => $soundbite->label, 'value' => $soundbite->label,
], ],
) ?></td> ) ?></td>
<td class="px-4 py-2"><?= icon_button( <td class="px-4 py-2"><?= icon_button(
'play', 'play',
lang('Episode.soundbites_form.play'), lang('Episode.soundbites_form.play'),
'', '',
['variant' => 'primary'], [
[ 'variant' => 'primary',
'class' => 'mb-1 mr-1', ],
'data-type' => 'play-soundbite', [
'data-soundbite-id' => $soundbite->id, 'class' => 'mb-1 mr-1',
'data-soundbite-start-time' => $soundbite->start_time, 'data-type' => 'play-soundbite',
'data-soundbite-duration' => $soundbite->duration, 'data-soundbite-id' => $soundbite->id,
], 'data-soundbite-start-time' => $soundbite->start_time,
) ?> 'data-soundbite-duration' => $soundbite->duration,
],
) ?>
<?= icon_button( <?= icon_button(
'delete-bin', 'delete-bin',
lang('Episode.soundbites_form.delete'), lang('Episode.soundbites_form.delete'),
route_to( route_to(
'soundbite-delete', 'soundbite-delete',
$podcast->id, $podcast->id,
$episode->id, $episode->id,
$soundbite->id, $soundbite->id,
), ),
['variant' => 'danger'], [
[], 'variant' => 'danger',
) ?> ],
[],
) ?>
</td> </td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
<tr> <tr>
<td class="px-1 py-4 font-medium bg-white border border-light-blue-500"><?= form_input( <td class="px-1 py-4 font-medium bg-white border border-light-blue-500"><?= form_input(
[ [
'type' => 'number', 'type' => 'number',
'min' => 0, 'min' => 0,
'max' => $episode->audio_file_duration, 'max' => $episode->audio_file_duration,
'step' => 'any', 'step' => 'any',
'id' => 'soundbites[0][start_time]', 'id' => 'soundbites[0][start_time]',
'name' => 'soundbites[0][start_time]', 'name' => 'soundbites[0][start_time]',
'class' => 'form-input w-full border-none text-center', 'class' => 'form-input w-full border-none text-center',
'value' => old('start_time'), 'value' => old('start_time'),
'data-soundbite-id' => '0', 'data-soundbite-id' => '0',
'data-type' => 'soundbite-field', 'data-type' => 'soundbite-field',
'data-field-type' => 'start-time', 'data-field-type' => 'start-time',
], ],
) ?></td> ) ?></td>
<td class="px-1 py-4 font-medium bg-white border border-light-blue-500"><?= form_input( <td class="px-1 py-4 font-medium bg-white border border-light-blue-500"><?= form_input(
[ [
'type' => 'number', 'type' => 'number',
'min' => 0, 'min' => 0,
'max' => $episode->audio_file_duration, 'max' => $episode->audio_file_duration,
'step' => 'any', 'step' => 'any',
'id' => 'soundbites[0][duration]', 'id' => 'soundbites[0][duration]',
'name' => 'soundbites[0][duration]', 'name' => 'soundbites[0][duration]',
'class' => 'form-input w-full border-none text-center', 'class' => 'form-input w-full border-none text-center',
'value' => old('duration'), 'value' => old('duration'),
'data-soundbite-id' => '0', 'data-soundbite-id' => '0',
'data-type' => 'soundbite-field', 'data-type' => 'soundbite-field',
'data-field-type' => 'duration', 'data-field-type' => 'duration',
], ],
) ?></td> ) ?></td>
<td class="px-1 py-4 font-medium bg-white border border-light-blue-500"><?= form_input( <td class="px-1 py-4 font-medium bg-white border border-light-blue-500"><?= form_input(
[ [
'id' => 'soundbites[0][label]', 'id' => 'soundbites[0][label]',
'name' => 'soundbites[0][label]', 'name' => 'soundbites[0][label]',
'class' => 'form-input w-full border-none', 'class' => 'form-input w-full border-none',
'value' => old('label'), 'value' => old('label'),
], ],
) ?></td> ) ?></td>
<td class="px-4 py-2"><?= icon_button( <td class="px-4 py-2"><?= icon_button(
'play', 'play',
lang('Episode.soundbites_form.play'), lang('Episode.soundbites_form.play'),
'', '',
['variant' => 'primary'], [
[ 'variant' => 'primary',
'data-type' => 'play-soundbite', ],
'data-soundbite-id' => 0, [
'data-soundbite-start-time' => 0, 'data-type' => 'play-soundbite',
'data-soundbite-duration' => 0, 'data-soundbite-id' => 0,
], 'data-soundbite-start-time' => 0,
) ?> 'data-soundbite-duration' => 0,
],
) ?>
</td> </td>
@ -180,16 +189,18 @@
Your browser does not support the audio tag. Your browser does not support the audio tag.
</audio> </audio>
</td><td class="px-4 py-2"><?= icon_button( </td><td class="px-4 py-2"><?= icon_button(
'timer', 'timer',
lang('Episode.soundbites_form.bookmark'), lang('Episode.soundbites_form.bookmark'),
'', '',
['variant' => 'info'], [
[ 'variant' => 'info',
'data-type' => 'get-soundbite', ],
'data-start-time-field-name' => 'soundbites[0][start_time]', [
'data-duration-field-name' => 'soundbites[0][duration]', 'data-type' => 'get-soundbite',
], 'data-start-time-field-name' => 'soundbites[0][start_time]',
) ?></td></tr> 'data-duration-field-name' => 'soundbites[0][duration]',
],
) ?></td></tr>
</tbody> </tbody>
</table> </table>
@ -199,8 +210,13 @@
<?= button( <?= button(
lang('Episode.soundbites_form.submit_edit'), lang('Episode.soundbites_form.submit_edit'),
'', '',
['variant' => 'primary'], [
['type' => 'submit', 'class' => 'self-end'], 'variant' => 'primary',
],
[
'type' => 'submit',
'class' => 'self-end',
],
) ?> ) ?>
<?= form_close() ?> <?= form_close() ?>

View File

@ -21,15 +21,15 @@
<label for="understand" class="inline-flex items-center mb-4"> <label for="understand" class="inline-flex items-center mb-4">
<?= form_checkbox( <?= form_checkbox(
[ [
'id' => 'understand', 'id' => 'understand',
'name' => 'understand', 'name' => 'understand',
'class' => 'text-pine-700', 'class' => 'text-pine-700',
'required' => 'required', 'required' => 'required',
], ],
'yes', 'yes',
old('understand', false), old('understand', false),
) ?> ) ?>
<span class="ml-2"><?= lang('Episode.unpublish_form.understand') ?></span> <span class="ml-2"><?= lang('Episode.unpublish_form.understand') ?></span>
</label> </label>
@ -42,8 +42,12 @@
<?= button( <?= button(
lang('Episode.unpublish_form.submit'), lang('Episode.unpublish_form.submit'),
'', '',
['variant' => 'danger'], [
['type' => 'submit'], 'variant' => 'danger',
],
[
'type' => 'submit',
],
) ?> ) ?>
</div> </div>

View File

@ -33,22 +33,23 @@
<div class="grid grid-cols-1 gap-4 lg:grid-cols-2"> <div class="grid grid-cols-1 gap-4 lg:grid-cols-2">
<Charts.XY title="<?= lang('Charts.episode_by_day') ?>" dataUrl="<?= route_to( <Charts.XY title="<?= lang('Charts.episode_by_day') ?>" dataUrl="<?= route_to(
'analytics-filtered-data', 'analytics-filtered-data',
$podcast->id, $podcast->id,
'PodcastByEpisode', 'PodcastByEpisode',
'ByDay', 'ByDay',
$episode->id, $episode->id,
) ?>"/> ) ?>"/>
<Charts.XY title="<?= lang('Charts.episode_by_month') ?>" dataUrl="<?= route_to( <Charts.XY title="<?= lang('Charts.episode_by_month') ?>" dataUrl="<?= route_to(
'analytics-filtered-data', 'analytics-filtered-data',
$podcast->id, $podcast->id,
'PodcastByEpisode', 'PodcastByEpisode',
'ByMonth', 'ByMonth',
$episode->id, $episode->id,
) ?>"/> ) ?>"/>
</div> </div>
<?= service('vite')->asset('js/charts.ts', 'js') ?> <?= service('vite')
->asset('js/charts.ts', 'js') ?>
<?= $this->endSection() ?> <?= $this->endSection() ?>

View File

@ -35,8 +35,13 @@
<?= button( <?= button(
lang('Fediverse.block_lists_form.submit'), lang('Fediverse.block_lists_form.submit'),
'', '',
['variant' => 'primary'], [
['type' => 'submit', 'class' => 'self-end'], 'variant' => 'primary',
],
[
'type' => 'submit',
'class' => 'self-end',
],
) ?> ) ?>
<?= form_close() ?> <?= form_close() ?>
@ -66,7 +71,10 @@
'fediverse-unblock-actor', 'fediverse-unblock-actor',
$blockedActor->username, $blockedActor->username,
), ),
['variant' => 'info', 'size' => 'small'], [
'variant' => 'info',
'size' => 'small',
],
[ [
'class' => 'mr-2', 'class' => 'mr-2',
'type' => 'submit', 'type' => 'submit',

View File

@ -34,8 +34,13 @@
<?= button( <?= button(
lang('Fediverse.block_lists_form.submit'), lang('Fediverse.block_lists_form.submit'),
'', '',
['variant' => 'primary'], [
['type' => 'submit', 'class' => 'self-end'], 'variant' => 'primary',
],
[
'type' => 'submit',
'class' => 'self-end',
],
) ?> ) ?>
<?= form_close() ?> <?= form_close() ?>
@ -64,7 +69,10 @@
'fediverse-unblock-domain', 'fediverse-unblock-domain',
$blockedDomain->name, $blockedDomain->name,
), ),
['variant' => 'info', 'size' => 'small'], [
'variant' => 'info',
'size' => 'small',
],
[ [
'class' => 'mr-2', 'class' => 'mr-2',
'type' => 'submit', 'type' => 'submit',

View File

@ -39,8 +39,13 @@
<?= button( <?= button(
lang('User.form.submit_password_change'), lang('User.form.submit_password_change'),
'', '',
['variant' => 'primary'], [
['type' => 'submit', 'class' => 'self-end'], 'variant' => 'primary',
],
[
'type' => 'submit',
'class' => 'self-end',
],
) ?> ) ?>
<?= form_close() ?> <?= form_close() ?>

View File

@ -11,6 +11,8 @@
<?= $this->section('content') ?> <?= $this->section('content') ?>
<?= view('_partials/_user_info.php', ['user' => user()]) ?> <?= view('_partials/_user_info.php', [
'user' => user(),
]) ?>
<?= $this->endSection() ?> <?= $this->endSection() ?>

View File

@ -16,7 +16,9 @@
]) ?> ]) ?>
<?= csrf_field() ?> <?= csrf_field() ?>
<?= form_label(lang('Page.form.title'), 'title', ['class' => 'max-w-sm']) ?> <?= form_label(lang('Page.form.title'), 'title', [
'class' => 'max-w-sm',
]) ?>
<?= form_input([ <?= form_input([
'id' => 'title', 'id' => 'title',
'name' => 'title', 'name' => 'title',
@ -32,7 +34,7 @@
[], [],
) ?> ) ?>
<permalink-edit class="inline-flex items-center w-full max-w-sm mb-4 text-xs" edit-label="<?= lang('Common.edit') ?>" copy-label="<?= lang('Common.copy') ?>" copied-label="<?= lang('Common.copied') ?>"> <permalink-edit class="inline-flex items-center w-full max-w-sm mb-4 text-xs" edit-label="<?= lang('Common.edit') ?>" copy-label="<?= lang('Common.copy') ?>" copied-label="<?= lang('Common.copied') ?>">
<span slot="domain" class="flex-shrink-0"><?= base_url('pages' ) . '/' ?></span> <span slot="domain" class="flex-shrink-0"><?= base_url('pages') . '/' ?></span>
<?= form_input([ <?= form_input([
'id' => 'slug', 'id' => 'slug',
'name' => 'slug', 'name' => 'slug',
@ -53,8 +55,13 @@
<?= button( <?= button(
lang('Page.form.submit_create'), lang('Page.form.submit_create'),
'', '',
['variant' => 'primary'], [
['type' => 'submit', 'class' => 'self-end'], 'variant' => 'primary',
],
[
'type' => 'submit',
'class' => 'self-end',
],
) ?> ) ?>
<?= form_close() ?> <?= form_close() ?>

View File

@ -16,7 +16,9 @@
]) ?> ]) ?>
<?= csrf_field() ?> <?= csrf_field() ?>
<?= form_label(lang('Page.form.title'), 'title', ['class' => 'max-w-sm']) ?> <?= form_label(lang('Page.form.title'), 'title', [
'class' => 'max-w-sm',
]) ?>
<?= form_input([ <?= form_input([
'id' => 'title', 'id' => 'title',
'name' => 'title', 'name' => 'title',
@ -52,8 +54,13 @@
<?= button( <?= button(
lang('Page.form.submit_edit'), lang('Page.form.submit_edit'),
'', '',
['variant' => 'primary'], [
['type' => 'submit', 'class' => 'self-end'], 'variant' => 'primary',
],
[
'type' => 'submit',
'class' => 'self-end',
],
) ?> ) ?>
<?= form_close() ?> <?= form_close() ?>

View File

@ -40,18 +40,28 @@
'variant' => 'secondary', 'variant' => 'secondary',
'size' => 'small', 'size' => 'small',
], ],
['class' => 'mr-2'], [
'class' => 'mr-2',
],
) . ) .
button( button(
lang('Page.edit'), lang('Page.edit'),
route_to('page-edit', $page->id), route_to('page-edit', $page->id),
['variant' => 'info', 'size' => 'small'], [
['class' => 'mr-2'], 'variant' => 'info',
'size' => 'small',
],
[
'class' => 'mr-2',
],
) . ) .
button( button(
lang('Page.delete'), lang('Page.delete'),
route_to('page-delete', $page->id), route_to('page-delete', $page->id),
['variant' => 'danger', 'size' => 'small'], [
'variant' => 'danger',
'size' => 'small',
],
); );
}, },
], ],

View File

@ -83,8 +83,13 @@
<?= button( <?= button(
lang('Person.form.submit_create'), lang('Person.form.submit_create'),
'', '',
['variant' => 'primary'], [
['type' => 'submit', 'class' => 'self-end'], 'variant' => 'primary',
],
[
'type' => 'submit',
'class' => 'self-end',
],
) ?> ) ?>

View File

@ -84,8 +84,13 @@
<?= button( <?= button(
lang('Person.form.submit_edit'), lang('Person.form.submit_edit'),
'', '',
['variant' => 'primary'], [
['type' => 'submit', 'class' => 'self-end'], 'variant' => 'primary',
],
[
'type' => 'submit',
'class' => 'self-end',
],
) ?> ) ?>

View File

@ -12,8 +12,13 @@
<?= button( <?= button(
lang('Person.create'), lang('Person.create'),
route_to('person-create'), route_to('person-create'),
['variant' => 'primary', 'iconLeft' => 'add'], [
['class' => 'mr-2'], 'variant' => 'primary',
'iconLeft' => 'add',
],
[
'class' => 'mr-2',
],
) ?> ) ?>
<?= $this->endSection() ?> <?= $this->endSection() ?>
@ -26,34 +31,34 @@
<img <img
alt="<?= $person->full_name ?>" alt="<?= $person->full_name ?>"
src="<?= $person->image src="<?= $person->image
->thumbnail_url ?>" class="object-cover w-full" /> ->thumbnail_url ?>" class="object-cover w-full" />
<div class="p-2"> <div class="p-2">
<a href="<?= route_to( <a href="<?= route_to(
'person-view', 'person-view',
$person->id, $person->id,
) ?>" class="hover:underline"> ) ?>" class="hover:underline">
<h2 class="font-semibold"><?= $person->full_name ?></h2> <h2 class="font-semibold"><?= $person->full_name ?></h2>
</a> </a>
</div> </div>
<footer class="flex items-center justify-end p-2"> <footer class="flex items-center justify-end p-2">
<a class="inline-flex p-2 mr-2 text-teal-700 bg-teal-100 rounded-full shadow-xs hover:bg-teal-200" href="<?= route_to( <a class="inline-flex p-2 mr-2 text-teal-700 bg-teal-100 rounded-full shadow-xs hover:bg-teal-200" href="<?= route_to(
'person-edit', 'person-edit',
$person->id, $person->id,
) ?>" data-toggle="tooltip" data-placement="bottom" title="<?= lang( ) ?>" data-toggle="tooltip" data-placement="bottom" title="<?= lang(
'Person.edit', 'Person.edit',
) ?>"><?= icon('edit') ?></a> ) ?>"><?= icon('edit') ?></a>
<a class="inline-flex p-2 mr-2 text-gray-700 bg-red-100 rounded-full shadow-xs hover:bg-gray-200" href="<?= route_to( <a class="inline-flex p-2 mr-2 text-gray-700 bg-red-100 rounded-full shadow-xs hover:bg-gray-200" href="<?= route_to(
'person-delete', 'person-delete',
$person->id, $person->id,
) ?>" data-toggle="tooltip" data-placement="bottom" title="<?= lang( ) ?>" data-toggle="tooltip" data-placement="bottom" title="<?= lang(
'Person.delete', 'Person.delete',
) ?>"><?= icon('delete-bin') ?></a> ) ?>"><?= icon('delete-bin') ?></a>
<a class="inline-flex p-2 text-gray-700 bg-gray-100 rounded-full shadow-xs hover:bg-gray-200" href="<?= route_to( <a class="inline-flex p-2 text-gray-700 bg-gray-100 rounded-full shadow-xs hover:bg-gray-200" href="<?= route_to(
'person-view', 'person-view',
$person->id, $person->id,
) ?>" data-toggle="tooltip" data-placement="bottom" title="<?= lang( ) ?>" data-toggle="tooltip" data-placement="bottom" title="<?= lang(
'Person.view', 'Person.view',
) ?>"><?= icon('eye') ?></a> ) ?>"><?= icon('eye') ?></a>
</footer> </footer>
</article> </article>
<?php endforeach; ?> <?php endforeach; ?>

View File

@ -13,8 +13,13 @@
<?= button( <?= button(
lang('Person.edit'), lang('Person.edit'),
route_to('person-edit', $person->id), route_to('person-edit', $person->id),
['variant' => 'secondary', 'iconLeft' => 'edit'], [
['class' => 'mr-2'], 'variant' => 'secondary',
'iconLeft' => 'edit',
],
[
'class' => 'mr-2',
],
) ?> ) ?>
<?= $this->endSection() ?> <?= $this->endSection() ?>

View File

@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
$podcastNavigation = [ $podcastNavigation = [
'dashboard' => [ 'dashboard' => [
'icon' => 'dashboard', 'icon' => 'dashboard',
@ -43,12 +44,12 @@ $podcastNavigation = [
<div class="flex flex-col items-start flex-1 w-48 px-2"> <div class="flex flex-col items-start flex-1 w-48 px-2">
<span class="w-full font-semibold truncate" title="<?= $podcast->title ?>"><?= $podcast->title ?></span> <span class="w-full font-semibold truncate" title="<?= $podcast->title ?>"><?= $podcast->title ?></span>
<a href="<?= route_to( <a href="<?= route_to(
'podcast-activity', 'podcast-activity',
$podcast->handle, $podcast->handle,
) ?>" class="inline-flex items-center text-sm outline-none hover:underline focus:ring" ) ?>" class="inline-flex items-center text-sm outline-none hover:underline focus:ring"
data-toggle="tooltip" data-placement="bottom" title="<?= lang( data-toggle="tooltip" data-placement="bottom" title="<?= lang(
'PodcastNavigation.go_to_page', 'PodcastNavigation.go_to_page',
) ?>">@<?= $podcast->handle ?> ) ?>">@<?= $podcast->handle ?>
<?= icon('external-link', 'ml-1 opacity-60') ?> <?= icon('external-link', 'ml-1 opacity-60') ?>
</a> </a>
</div> </div>
@ -67,9 +68,9 @@ $podcastNavigation = [
<a class="w-full py-1 pl-14 pr-2 text-sm outline-none hover:opacity-100 focus:ring <?= $isActive <a class="w-full py-1 pl-14 pr-2 text-sm outline-none hover:opacity-100 focus:ring <?= $isActive
? 'font-semibold opacity-100 inline-flex items-center' ? 'font-semibold opacity-100 inline-flex items-center'
: 'opacity-75' ?>" href="<?= route_to( : 'opacity-75' ?>" href="<?= route_to(
$item, $item,
$podcast->id, $podcast->id,
) ?>"><?= ($isActive ? icon('chevron-right', 'mr-2') : '') .lang('PodcastNavigation.' . $item) ?></a> ) ?>"><?= ($isActive ? icon('chevron-right', 'mr-2') : '') . lang('PodcastNavigation.' . $item) ?></a>
</li> </li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>

View File

@ -12,26 +12,27 @@
<div class="grid grid-cols-1 gap-4 lg:grid-cols-2"> <div class="grid grid-cols-1 gap-4 lg:grid-cols-2">
<Charts.XY class="col-span-1" title="<?= lang('Charts.podcast_by_day') ?>" dataUrl="<?= route_to( <Charts.XY class="col-span-1" title="<?= lang('Charts.podcast_by_day') ?>" dataUrl="<?= route_to(
'analytics-data', 'analytics-data',
$podcast->id, $podcast->id,
'Podcast', 'Podcast',
'ByDay', 'ByDay',
) ?>"/> ) ?>"/>
<Charts.XY class="col-span-1" title="<?= lang('Charts.podcast_by_month') ?>" dataUrl="<?= route_to( <Charts.XY class="col-span-1" title="<?= lang('Charts.podcast_by_month') ?>" dataUrl="<?= route_to(
'analytics-data', 'analytics-data',
$podcast->id, $podcast->id,
'Podcast', 'Podcast',
'ByMonth', 'ByMonth',
) ?>"/> ) ?>"/>
<Charts.XY class="col-span-1" title="<?= lang('Charts.podcast_by_bandwidth') ?>" dataUrl="<?= route_to( <Charts.XY class="col-span-1" title="<?= lang('Charts.podcast_by_bandwidth') ?>" dataUrl="<?= route_to(
'analytics-data', 'analytics-data',
$podcast->id, $podcast->id,
'Podcast', 'Podcast',
'BandwidthByDay', 'BandwidthByDay',
) ?>"/> ) ?>"/>
</div> </div>
<?= service('vite')->asset('js/charts.ts', 'js') ?> <?= service('vite')
->asset('js/charts.ts', 'js') ?>
<?= $this->endSection() ?> <?= $this->endSection() ?>

View File

@ -12,19 +12,20 @@
<div class="grid grid-cols-1 gap-4 lg:grid-cols-2"> <div class="grid grid-cols-1 gap-4 lg:grid-cols-2">
<Charts.XY class="col-span-1" title="<?= lang('Charts.daily_listening_time') ?>" dataUrl="<?= route_to( <Charts.XY class="col-span-1" title="<?= lang('Charts.daily_listening_time') ?>" dataUrl="<?= route_to(
'analytics-data', 'analytics-data',
$podcast->id, $podcast->id,
'Podcast', 'Podcast',
'TotalListeningTimeByDay', 'TotalListeningTimeByDay',
) ?>"/> ) ?>"/>
<Charts.XY class="col-span-1" title="<?= lang('Charts.monthly_listening_time') ?>" dataUrl="<?= route_to( <Charts.XY class="col-span-1" title="<?= lang('Charts.monthly_listening_time') ?>" dataUrl="<?= route_to(
'analytics-data', 'analytics-data',
$podcast->id, $podcast->id,
'Podcast', 'Podcast',
'TotalListeningTimeByMonth', 'TotalListeningTimeByMonth',
) ?>"/> ) ?>"/>
</div> </div>
<?= service('vite')->asset('js/charts.ts', 'js') ?> <?= service('vite')
->asset('js/charts.ts', 'js') ?>
<?= $this->endSection() ?> <?= $this->endSection() ?>

View File

@ -12,24 +12,25 @@
<div class="grid grid-cols-1 gap-4 lg:grid-cols-2"> <div class="grid grid-cols-1 gap-4 lg:grid-cols-2">
<Charts.Pie title="<?= lang('Charts.by_country_weekly') ?>" dataUrl="<?= route_to( <Charts.Pie title="<?= lang('Charts.by_country_weekly') ?>" dataUrl="<?= route_to(
'analytics-data', 'analytics-data',
$podcast->id, $podcast->id,
'PodcastByCountry', 'PodcastByCountry',
'Weekly', 'Weekly',
) ?>" /> ) ?>" />
<Charts.Pie title="<?= lang('Charts.by_country_yearly') ?>" dataUrl="<?= route_to( <Charts.Pie title="<?= lang('Charts.by_country_yearly') ?>" dataUrl="<?= route_to(
'analytics-data', 'analytics-data',
$podcast->id, $podcast->id,
'PodcastByCountry', 'PodcastByCountry',
'Yearly', 'Yearly',
) ?>" /> ) ?>" />
<Charts.Map class="col-span-2" title="<?= lang('Charts.podcast_by_region') ?>" dataUrl="<?= route_to( <Charts.Map class="col-span-2" title="<?= lang('Charts.podcast_by_region') ?>" dataUrl="<?= route_to(
'analytics-full-data', 'analytics-full-data',
$podcast->id, $podcast->id,
'PodcastByRegion', 'PodcastByRegion',
) ?>" /> ) ?>" />
</div> </div>
<?= service('vite')->asset('js/charts.ts', 'js') ?> <?= service('vite')
->asset('js/charts.ts', 'js') ?>
<?= $this->endSection() ?> <?= $this->endSection() ?>

View File

@ -12,36 +12,37 @@
<div class="grid grid-cols-1 gap-4 lg:grid-cols-2"> <div class="grid grid-cols-1 gap-4 lg:grid-cols-2">
<Charts.Pie title="<?= lang('Charts.by_player_weekly') ?>" dataUrl="<?= route_to( <Charts.Pie title="<?= lang('Charts.by_player_weekly') ?>" dataUrl="<?= route_to(
'analytics-data', 'analytics-data',
$podcast->id, $podcast->id,
'PodcastByPlayer', 'PodcastByPlayer',
'ByAppWeekly', 'ByAppWeekly',
) ?>" /> ) ?>" />
<Charts.Pie title="<?= lang('Charts.by_service_weekly') ?>" dataUrl="<?= route_to( <Charts.Pie title="<?= lang('Charts.by_service_weekly') ?>" dataUrl="<?= route_to(
'analytics-data', 'analytics-data',
$podcast->id, $podcast->id,
'PodcastByService', 'PodcastByService',
'ByServiceWeekly', 'ByServiceWeekly',
) ?>" /> ) ?>" />
<Charts.Pie title="<?= lang('Charts.by_device_weekly') ?>" dataUrl="<?= route_to( <Charts.Pie title="<?= lang('Charts.by_device_weekly') ?>" dataUrl="<?= route_to(
'analytics-data', 'analytics-data',
$podcast->id, $podcast->id,
'PodcastByPlayer', 'PodcastByPlayer',
'ByDeviceWeekly', 'ByDeviceWeekly',
) ?>" /> ) ?>" />
<Charts.Pie title="<?= lang('Charts.by_os_weekly') ?>" dataUrl="<?= route_to( <Charts.Pie title="<?= lang('Charts.by_os_weekly') ?>" dataUrl="<?= route_to(
'analytics-data', 'analytics-data',
$podcast->id, $podcast->id,
'PodcastByPlayer', 'PodcastByPlayer',
'ByOsWeekly', 'ByOsWeekly',
) ?>" /> ) ?>" />
<Charts.XY class="col-span-2" title="<?= lang('Charts.podcast_bots') ?>" dataUrl="<?= route_to( <Charts.XY class="col-span-2" title="<?= lang('Charts.podcast_bots') ?>" dataUrl="<?= route_to(
'analytics-data', 'analytics-data',
$podcast->id, $podcast->id,
'PodcastByPlayer', 'PodcastByPlayer',
'Bots', 'Bots',
) ?>" /> ) ?>" />
</div> </div>
<?= service('vite')->asset('js/charts.ts', 'js') ?> <?= service('vite')
->asset('js/charts.ts', 'js') ?>
<?= $this->endSection() ?> <?= $this->endSection() ?>

View File

@ -12,17 +12,18 @@
<div class="grid grid-cols-1 gap-4 lg:grid-cols-2"> <div class="grid grid-cols-1 gap-4 lg:grid-cols-2">
<Charts.Bar title="<?= lang('Charts.by_weekday') ?>" dataUrl="<?= route_to( <Charts.Bar title="<?= lang('Charts.by_weekday') ?>" dataUrl="<?= route_to(
'analytics-data', 'analytics-data',
$podcast->id, $podcast->id,
'Podcast', 'Podcast',
'ByWeekday', 'ByWeekday',
) ?>" /> ) ?>" />
<Charts.Bar title="<?= lang('Charts.by_hour') ?>" dataUrl="<?= route_to( <Charts.Bar title="<?= lang('Charts.by_hour') ?>" dataUrl="<?= route_to(
'analytics-full-data', 'analytics-full-data',
$podcast->id, $podcast->id,
'PodcastByHour', 'PodcastByHour',
) ?>" /> ) ?>" />
</div> </div>
<?= service('vite')->asset('js/charts.ts', 'js') ?> <?= service('vite')
->asset('js/charts.ts', 'js') ?>
<?= $this->endSection() ?> <?= $this->endSection() ?>

View File

@ -12,19 +12,20 @@
<div class="grid grid-cols-1 gap-4 lg:grid-cols-2"> <div class="grid grid-cols-1 gap-4 lg:grid-cols-2">
<Charts.XY class="col-span-1" title="<?= lang('Charts.unique_daily_listeners') ?>" dataUrl="<?= route_to( <Charts.XY class="col-span-1" title="<?= lang('Charts.unique_daily_listeners') ?>" dataUrl="<?= route_to(
'analytics-data', 'analytics-data',
$podcast->id, $podcast->id,
'Podcast', 'Podcast',
'UniqueListenersByDay', 'UniqueListenersByDay',
) ?>"/> ) ?>"/>
<Charts.XY class="col-span-1" title="<?= lang('Charts.unique_monthly_listeners') ?>" dataUrl="<?= route_to( <Charts.XY class="col-span-1" title="<?= lang('Charts.unique_monthly_listeners') ?>" dataUrl="<?= route_to(
'analytics-data', 'analytics-data',
$podcast->id, $podcast->id,
'Podcast', 'Podcast',
'UniqueListenersByMonth', 'UniqueListenersByMonth',
) ?>"/> ) ?>"/>
</div> </div>
<?= service('vite')->asset('js/charts.ts', 'js') ?> <?= service('vite')
->asset('js/charts.ts', 'js') ?>
<?= $this->endSection() ?> <?= $this->endSection() ?>

View File

@ -12,30 +12,31 @@
<div class="grid grid-cols-1 gap-4 lg:grid-cols-2"> <div class="grid grid-cols-1 gap-4 lg:grid-cols-2">
<Charts.Pie title="<?= lang('Charts.by_domain_weekly') ?>" dataUrl="<?= route_to( <Charts.Pie title="<?= lang('Charts.by_domain_weekly') ?>" dataUrl="<?= route_to(
'analytics-data', 'analytics-data',
$podcast->id, $podcast->id,
'WebsiteByReferer', 'WebsiteByReferer',
'ByDomainWeekly', 'ByDomainWeekly',
) ?>" /> ) ?>" />
<Charts.Pie title="<?= lang('Charts.by_domain_yearly') ?>" dataUrl="<?= route_to( <Charts.Pie title="<?= lang('Charts.by_domain_yearly') ?>" dataUrl="<?= route_to(
'analytics-data', 'analytics-data',
$podcast->id, $podcast->id,
'WebsiteByReferer', 'WebsiteByReferer',
'ByDomainYearly', 'ByDomainYearly',
) ?>" /> ) ?>" />
<Charts.Pie title="<?= lang('Charts.by_entry_page') ?>" dataUrl="<?= route_to( <Charts.Pie title="<?= lang('Charts.by_entry_page') ?>" dataUrl="<?= route_to(
'analytics-full-data', 'analytics-full-data',
$podcast->id, $podcast->id,
'WebsiteByEntryPage', 'WebsiteByEntryPage',
) ?>" /> ) ?>" />
<Charts.Pie title="<?= lang('Charts.by_browser') ?>" dataUrl="<?= route_to( <Charts.Pie title="<?= lang('Charts.by_browser') ?>" dataUrl="<?= route_to(
'analytics-full-data', 'analytics-full-data',
$podcast->id, $podcast->id,
'WebsiteByBrowser', 'WebsiteByBrowser',
) ?>" /> ) ?>" />
</div> </div>
<?= service('vite')->asset('js/charts.ts', 'js') ?> <?= service('vite')
->asset('js/charts.ts', 'js') ?>
<?= $this->endSection() ?> <?= $this->endSection() ?>

View File

@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
?> ?>
<?= $this->extend('_layout') ?> <?= $this->extend('_layout') ?>
@ -61,25 +62,35 @@
'class' => 'form-input w-full pl-8', 'class' => 'form-input w-full pl-8',
'value' => old('handle'), 'value' => old('handle'),
'required' => 'required', 'required' => 'required',
]) ?> ]) ?>
</div> </div>
<?= form_fieldset('', ['class' => 'mb-4']) ?> <?= form_fieldset('', [
'class' => 'mb-4',
]) ?>
<legend> <legend>
<?= lang('Podcast.form.type.label') . <?= lang('Podcast.form.type.label') .
hint_tooltip(lang('Podcast.form.type.hint'), 'ml-1') ?> hint_tooltip(lang('Podcast.form.type.hint'), 'ml-1') ?>
</legend> </legend>
<?= form_radio( <?= form_radio(
['id' => 'episodic', 'name' => 'type', 'class' => 'form-radio-btn'], [
'episodic', 'id' => 'episodic',
old('type') ? old('type') == 'episodic' : true, 'name' => 'type',
) ?> 'class' => 'form-radio-btn',
],
'episodic',
old('type') ? old('type') === 'episodic' : true,
) ?>
<label for="episodic"><?= lang('Podcast.form.type.episodic') ?></label> <label for="episodic"><?= lang('Podcast.form.type.episodic') ?></label>
<?= form_radio( <?= form_radio(
['id' => 'serial', 'name' => 'type', 'class' => 'form-radio-btn'], [
'serial', 'id' => 'serial',
old('type') && old('type') == 'serial', 'name' => 'type',
) ?> 'class' => 'form-radio-btn',
],
'serial',
old('type') && old('type') === 'serial',
) ?>
<label for="serial"><?= lang('Podcast.form.type.serial') ?></label> <label for="serial"><?= lang('Podcast.form.type.serial') ?></label>
<?= form_fieldset_close() ?> <?= form_fieldset_close() ?>
@ -92,9 +103,9 @@
<?= form_section( <?= form_section(
lang('Podcast.form.classification_section_title'), lang('Podcast.form.classification_section_title'),
lang('Podcast.form.classification_section_subtitle'), lang('Podcast.form.classification_section_subtitle'),
) ?> ) ?>
<?= form_label(lang('Podcast.form.language'), 'language') ?> <?= form_label(lang('Podcast.form.language'), 'language') ?>
<?= form_dropdown('language', $languageOptions, [old('language', $browserLang)], [ <?= form_dropdown('language', $languageOptions, [old('language', $browserLang)], [
@ -108,7 +119,7 @@
'id' => 'category', 'id' => 'category',
'class' => 'form-select mb-4', 'class' => 'form-select mb-4',
'required' => 'required', 'required' => 'required',
'placeholder' => lang('Podcast.form.category_placeholder') 'placeholder' => lang('Podcast.form.category_placeholder'),
]) ?> ]) ?>
<?= form_label( <?= form_label(
@ -126,101 +137,103 @@
selected="<?= htmlspecialchars(json_encode(old('other_categories', []))) ?>" selected="<?= htmlspecialchars(json_encode(old('other_categories', []))) ?>"
options="<?= htmlspecialchars(json_encode($categoryOptions)) ?>" /> options="<?= htmlspecialchars(json_encode($categoryOptions)) ?>" />
<?= form_fieldset('', ['class' => 'mb-4']) ?> <?= form_fieldset('', [
'class' => 'mb-4',
]) ?>
<legend> <legend>
<?= lang('Podcast.form.parental_advisory.label') . <?= lang('Podcast.form.parental_advisory.label') .
hint_tooltip(lang('Podcast.form.parental_advisory.hint'), 'ml-1') ?> hint_tooltip(lang('Podcast.form.parental_advisory.hint'), 'ml-1') ?>
</legend> </legend>
<?= form_radio( <?= form_radio(
[ [
'id' => 'undefined', 'id' => 'undefined',
'name' => 'parental_advisory', 'name' => 'parental_advisory',
'class' => 'form-radio-btn', 'class' => 'form-radio-btn',
], ],
'undefined', 'undefined',
old('parental_advisory') old('parental_advisory')
? old('parental_advisory') === 'undefined' ? old('parental_advisory') === 'undefined'
: true, : true,
) ?> ) ?>
<label for="undefined"><?= lang( <label for="undefined"><?= lang(
'Podcast.form.parental_advisory.undefined', 'Podcast.form.parental_advisory.undefined',
) ?></label> ) ?></label>
<?= form_radio( <?= form_radio(
[ [
'id' => 'clean', 'id' => 'clean',
'name' => 'parental_advisory', 'name' => 'parental_advisory',
'class' => 'form-radio-btn', 'class' => 'form-radio-btn',
], ],
'clean', 'clean',
old('parental_advisory') && old('parental_advisory') === 'clean', old('parental_advisory') && old('parental_advisory') === 'clean',
) ?> ) ?>
<label for="clean"><?= lang( <label for="clean"><?= lang(
'Podcast.form.parental_advisory.clean', 'Podcast.form.parental_advisory.clean',
) ?></label> ) ?></label>
<?= form_radio( <?= form_radio(
[ [
'id' => 'explicit', 'id' => 'explicit',
'name' => 'parental_advisory', 'name' => 'parental_advisory',
'class' => 'form-radio-btn', 'class' => 'form-radio-btn',
], ],
'explicit', 'explicit',
old('parental_advisory') && old('parental_advisory') === 'explicit', old('parental_advisory') && old('parental_advisory') === 'explicit',
) ?> ) ?>
<label for="explicit"><?= lang( <label for="explicit"><?= lang(
'Podcast.form.parental_advisory.explicit', 'Podcast.form.parental_advisory.explicit',
) ?></label> ) ?></label>
<?= form_fieldset_close() ?> <?= form_fieldset_close() ?>
<?= form_section_close() ?> <?= form_section_close() ?>
<?= form_section( <?= form_section(
lang('Podcast.form.author_section_title'), lang('Podcast.form.author_section_title'),
lang('Podcast.form.author_section_subtitle'), lang('Podcast.form.author_section_subtitle'),
) ?> ) ?>
<?= form_label( <?= form_label(
lang('Podcast.form.owner_name'), lang('Podcast.form.owner_name'),
'owner_name', 'owner_name',
[], [],
lang('Podcast.form.owner_name_hint'), lang('Podcast.form.owner_name_hint'),
) ?> ) ?>
<?= form_input([ <?= form_input([
'id' => 'owner_name', 'id' => 'owner_name',
'name' => 'owner_name', 'name' => 'owner_name',
'class' => 'form-input mb-4', 'class' => 'form-input mb-4',
'value' => old('owner_name'), 'value' => old('owner_name'),
'required' => 'required', 'required' => 'required',
]) ?> ]) ?>
<?= form_label( <?= form_label(
lang('Podcast.form.owner_email'), lang('Podcast.form.owner_email'),
'owner_email', 'owner_email',
[], [],
lang('Podcast.form.owner_email_hint'), lang('Podcast.form.owner_email_hint'),
) ?> ) ?>
<?= form_input([ <?= form_input([
'id' => 'owner_email', 'id' => 'owner_email',
'name' => 'owner_email', 'name' => 'owner_email',
'class' => 'form-input mb-4', 'class' => 'form-input mb-4',
'value' => old('owner_email'), 'value' => old('owner_email'),
'type' => 'email', 'type' => 'email',
'required' => 'required', 'required' => 'required',
]) ?> ]) ?>
<?= form_label( <?= form_label(
lang('Podcast.form.publisher'), lang('Podcast.form.publisher'),
'publisher', 'publisher',
[], [],
lang('Podcast.form.publisher_hint'), lang('Podcast.form.publisher_hint'),
true, true,
) ?> ) ?>
<?= form_input([ <?= form_input([
'id' => 'publisher', 'id' => 'publisher',
'name' => 'publisher', 'name' => 'publisher',
'class' => 'form-input mb-4', 'class' => 'form-input mb-4',
'value' => old('publisher'), 'value' => old('publisher'),
]) ?> ]) ?>
<?= form_label(lang('Podcast.form.copyright'), 'copyright', [], '', true) ?> <?= form_label(lang('Podcast.form.copyright'), 'copyright', [], '', true) ?>
<?= form_input([ <?= form_input([
@ -275,12 +288,14 @@
<div class="flex flex-col mb-4 gap-x-2 gap-y-4 md:flex-row"> <div class="flex flex-col mb-4 gap-x-2 gap-y-4 md:flex-row">
<div class="flex flex-col flex-shrink"> <div class="flex flex-col flex-shrink">
<?= form_label( <?= form_label(
lang('Podcast.form.partner_id'), lang('Podcast.form.partner_id'),
'partner_id', 'partner_id',
['class' => 'text-sm'], [
lang('Podcast.form.partner_id_hint'), 'class' => 'text-sm',
true, ],
) ?> lang('Podcast.form.partner_id_hint'),
true,
) ?>
<?= form_input([ <?= form_input([
'id' => 'partner_id', 'id' => 'partner_id',
'name' => 'partner_id', 'name' => 'partner_id',
@ -292,7 +307,9 @@
<?= form_label( <?= form_label(
lang('Podcast.form.partner_link_url'), lang('Podcast.form.partner_link_url'),
'partner_link_url', 'partner_link_url',
['class' => 'text-sm'], [
'class' => 'text-sm',
],
lang('Podcast.form.partner_link_url_hint'), lang('Podcast.form.partner_link_url_hint'),
true, true,
) ?> ) ?>
@ -307,7 +324,9 @@
<?= form_label( <?= form_label(
lang('Podcast.form.partner_image_url'), lang('Podcast.form.partner_image_url'),
'partner_image_url', 'partner_image_url',
['class' => 'text-sm'], [
'class' => 'text-sm',
],
lang('Podcast.form.partner_image_url_hint'), lang('Podcast.form.partner_image_url_hint'),
true, true,
) ?> ) ?>
@ -323,24 +342,24 @@
<?= form_section_close() ?> <?= form_section_close() ?>
<?= form_section( <?= form_section(
lang('Podcast.form.advanced_section_title'), lang('Podcast.form.advanced_section_title'),
lang('Podcast.form.advanced_section_subtitle'), lang('Podcast.form.advanced_section_subtitle'),
) ?> ) ?>
<?= form_label( <?= form_label(
lang('Podcast.form.custom_rss'), lang('Podcast.form.custom_rss'),
'custom_rss', 'custom_rss',
[], [],
lang('Podcast.form.custom_rss_hint'), lang('Podcast.form.custom_rss_hint'),
true, true,
) ?> ) ?>
<Forms.XMLEditor id="custom_rss" name="custom_rss"><?= old('custom_rss', '', false) ?></Forms.XMLEditor> <Forms.XMLEditor id="custom_rss" name="custom_rss"><?= old('custom_rss', '', false) ?></Forms.XMLEditor>
<?= form_section_close() ?> <?= form_section_close() ?>
<?= form_section( <?= form_section(
lang('Podcast.form.status_section_title'), lang('Podcast.form.status_section_title'),
lang('Podcast.form.status_section_subtitle'), lang('Podcast.form.status_section_subtitle'),
) ?> ) ?>
<Forms.Toggler class="mb-2" id="lock" name="lock" value="yes" checked="<?= old('complete', true) ?>" hint="<?= lang('Podcast.form.lock_hint') ?>"> <Forms.Toggler class="mb-2" id="lock" name="lock" value="yes" checked="<?= old('complete', true) ?>" hint="<?= lang('Podcast.form.lock_hint') ?>">
<?= lang('Podcast.form.lock') ?> <?= lang('Podcast.form.lock') ?>
@ -355,11 +374,16 @@
<?= form_section_close() ?> <?= form_section_close() ?>
<?= button( <?= button(
lang('Podcast.form.submit_create'), lang('Podcast.form.submit_create'),
'', '',
['variant' => 'primary'], [
['type' => 'submit', 'class' => 'self-end'], 'variant' => 'primary',
) ?> ],
[
'type' => 'submit',
'class' => 'self-end',
],
) ?>
<?= form_close() ?> <?= form_close() ?>

View File

@ -1,4 +1,5 @@
<?php <?php declare(strict_types=1);
?> ?>
<?= $this->extend('_layout') ?> <?= $this->extend('_layout') ?>
@ -38,8 +39,8 @@
<small class="mb-4 text-gray-600"><?= lang( <small class="mb-4 text-gray-600"><?= lang(
'Common.forms.image_size_hint', 'Common.forms.image_size_hint',
) ?></small> ) ?></small>
<?= form_label(lang('Podcast.form.title'), 'title') ?> <?= form_label(lang('Podcast.form.title'), 'title') ?>
@ -53,22 +54,32 @@
<span class="mb-4 text-sm"><?= $podcast->link ?></span> <span class="mb-4 text-sm"><?= $podcast->link ?></span>
<?= form_fieldset('', ['class' => 'mb-4']) ?> <?= form_fieldset('', [
'class' => 'mb-4',
]) ?>
<legend><?= lang('Podcast.form.type.label') . <legend><?= lang('Podcast.form.type.label') .
hint_tooltip(lang('Podcast.form.type.hint'), 'ml-1') ?> hint_tooltip(lang('Podcast.form.type.hint'), 'ml-1') ?>
</legend> </legend>
<?= form_radio( <?= form_radio(
['id' => 'episodic', 'name' => 'type', 'class' => 'form-radio-btn'], [
'episodic', 'id' => 'episodic',
old('type') ? old('type') == 'episodic' : $podcast->type == 'episodic', 'name' => 'type',
) ?> 'class' => 'form-radio-btn',
],
'episodic',
old('type') ? old('type') === 'episodic' : $podcast->type === 'episodic',
) ?>
<label for="episodic"><?= lang('Podcast.form.type.episodic') ?></label> <label for="episodic"><?= lang('Podcast.form.type.episodic') ?></label>
<?= form_radio( <?= form_radio(
['id' => 'serial', 'name' => 'type', 'class' => 'form-radio-btn'], [
'serial', 'id' => 'serial',
old('type') ? old('type') == 'serial' : $podcast->type == 'serial', 'name' => 'type',
) ?> 'class' => 'form-radio-btn',
],
'serial',
old('type') ? old('type') === 'serial' : $podcast->type === 'serial',
) ?>
<label for="serial"><?= lang('Podcast.form.type.serial') ?></label> <label for="serial"><?= lang('Podcast.form.type.serial') ?></label>
<?= form_fieldset_close() ?> <?= form_fieldset_close() ?>
@ -80,42 +91,42 @@
<?= form_section_close() ?> <?= form_section_close() ?>
<?= form_section( <?= form_section(
lang('Podcast.form.classification_section_title'), lang('Podcast.form.classification_section_title'),
lang('Podcast.form.classification_section_subtitle'), lang('Podcast.form.classification_section_subtitle'),
) ?> ) ?>
<?= form_label(lang('Podcast.form.language'), 'language') ?> <?= form_label(lang('Podcast.form.language'), 'language') ?>
<?= form_dropdown( <?= form_dropdown(
'language', 'language',
$languageOptions, $languageOptions,
[old('language', $podcast->language_code)], [old('language', $podcast->language_code)],
[ [
'id' => 'language', 'id' => 'language',
'class' => 'form-select mb-4', 'class' => 'form-select mb-4',
'required' => 'required', 'required' => 'required',
], ],
) ?> ) ?>
<?= form_label(lang('Podcast.form.category'), 'category') ?> <?= form_label(lang('Podcast.form.category'), 'category') ?>
<?= form_dropdown( <?= form_dropdown(
'category', 'category',
$categoryOptions, $categoryOptions,
[old('category', $podcast->category_id)], [old('category', $podcast->category_id)],
[ [
'id' => 'category', 'id' => 'category',
'class' => 'form-select mb-4', 'class' => 'form-select mb-4',
'required' => 'required', 'required' => 'required',
], ],
) ?> ) ?>
<?= form_label( <?= form_label(
lang('Podcast.form.other_categories'), lang('Podcast.form.other_categories'),
'other_categories', 'other_categories',
[], [],
'', '',
true, true,
) ?> ) ?>
<Forms.MultiSelect <Forms.MultiSelect
id="other_categories" id="other_categories"
@ -125,68 +136,70 @@ lang('Podcast.form.classification_section_subtitle'),
selected="<?= json_encode(old('other_categories', $podcast->other_categories_ids)) ?>" selected="<?= json_encode(old('other_categories', $podcast->other_categories_ids)) ?>"
options="<?= htmlspecialchars(json_encode($categoryOptions)) ?>" /> options="<?= htmlspecialchars(json_encode($categoryOptions)) ?>" />
<?= form_fieldset('', ['class' => 'mb-4']) ?> <?= form_fieldset('', [
'class' => 'mb-4',
]) ?>
<legend><?= lang('Podcast.form.parental_advisory.label') . <legend><?= lang('Podcast.form.parental_advisory.label') .
hint_tooltip(lang('Podcast.form.parental_advisory.hint'), 'ml-1') ?></legend> hint_tooltip(lang('Podcast.form.parental_advisory.hint'), 'ml-1') ?></legend>
<?= form_radio( <?= form_radio(
[ [
'id' => 'undefined', 'id' => 'undefined',
'name' => 'parental_advisory', 'name' => 'parental_advisory',
'class' => 'form-radio-btn', 'class' => 'form-radio-btn',
], ],
'undefined', 'undefined',
old('parental_advisory') old('parental_advisory')
? old('parental_advisory') === 'undefined' ? old('parental_advisory') === 'undefined'
: $podcast->parental_advisory === null, : $podcast->parental_advisory === null,
) ?> ) ?>
<label for="undefined"><?= lang( <label for="undefined"><?= lang(
'Podcast.form.parental_advisory.undefined', 'Podcast.form.parental_advisory.undefined',
) ?></label> ) ?></label>
<?= form_radio( <?= form_radio(
[ [
'id' => 'clean', 'id' => 'clean',
'name' => 'parental_advisory', 'name' => 'parental_advisory',
'class' => 'form-radio-btn', 'class' => 'form-radio-btn',
], ],
'clean', 'clean',
old('parental_advisory') old('parental_advisory')
? old('parental_advisory') === 'clean' ? old('parental_advisory') === 'clean'
: $podcast->parental_advisory === 'clean', : $podcast->parental_advisory === 'clean',
) ?> ) ?>
<label for="clean"><?= lang( <label for="clean"><?= lang(
'Podcast.form.parental_advisory.clean', 'Podcast.form.parental_advisory.clean',
) ?></label> ) ?></label>
<?= form_radio( <?= form_radio(
[ [
'id' => 'explicit', 'id' => 'explicit',
'name' => 'parental_advisory', 'name' => 'parental_advisory',
'class' => 'form-radio-btn', 'class' => 'form-radio-btn',
], ],
'explicit', 'explicit',
old('parental_advisory') old('parental_advisory')
? old('parental_advisory') === 'explicit' ? old('parental_advisory') === 'explicit'
: $podcast->parental_advisory === 'explicit', : $podcast->parental_advisory === 'explicit',
) ?> ) ?>
<label for="explicit"><?= lang( <label for="explicit"><?= lang(
'Podcast.form.parental_advisory.explicit', 'Podcast.form.parental_advisory.explicit',
) ?></label> ) ?></label>
<?= form_fieldset_close() ?> <?= form_fieldset_close() ?>
<?= form_section_close() ?> <?= form_section_close() ?>
<?= form_section( <?= form_section(
lang('Podcast.form.author_section_title'), lang('Podcast.form.author_section_title'),
lang('Podcast.form.author_section_subtitle'), lang('Podcast.form.author_section_subtitle'),
) ?> ) ?>
<?= form_label( <?= form_label(
lang('Podcast.form.owner_name'), lang('Podcast.form.owner_name'),
'owner_name', 'owner_name',
[], [],
lang('Podcast.form.owner_name_hint'), lang('Podcast.form.owner_name_hint'),
) ?> ) ?>
<?= form_input([ <?= form_input([
'id' => 'owner_name', 'id' => 'owner_name',
@ -284,72 +297,72 @@ lang('Podcast.form.classification_section_subtitle'),
<div class="flex flex-col mb-4 gap-x-2 gap-y-4 md:flex-row"> <div class="flex flex-col mb-4 gap-x-2 gap-y-4 md:flex-row">
<div class="flex flex-col flex-shrink w-32"> <div class="flex flex-col flex-shrink w-32">
<?= form_label( <?= form_label(
lang('Podcast.form.partner_id'), lang('Podcast.form.partner_id'),
'partner_id', 'partner_id',
[],
lang('Podcast.form.partner_id_hint'),
true,
) ?>
<?= form_input([
'id' => 'partner_id',
'name' => 'partner_id',
'class' => 'form-input w-full',
'value' => old('partner_id', $podcast->partner_id),
]) ?>
</div>
<div class="flex flex-col flex-1">
<?= form_label(
lang('Podcast.form.partner_link_url'),
'partner_link_url',
[], [],
lang('Podcast.form.partner_id_hint'), lang('Podcast.form.partner_link_url_hint'),
true, true,
) ?> ) ?>
<?= form_input([ <?= form_input([
'id' => 'partner_id', 'id' => 'partner_link_url',
'name' => 'partner_id', 'name' => 'partner_link_url',
'class' => 'form-input w-full', 'class' => 'form-input w-full',
'value' => old('partner_id', $podcast->partner_id), 'value' => old('partner_link_url', $podcast->partner_link_url),
]) ?> ]) ?>
</div> </div>
<div class="flex flex-col flex-1"> <div class="flex flex-col flex-1">
<?= form_label( <?= form_label(
lang('Podcast.form.partner_link_url'), lang('Podcast.form.partner_image_url'),
'partner_link_url', 'partner_image_url',
[], [],
lang('Podcast.form.partner_link_url_hint'), lang('Podcast.form.partner_image_url_hint'),
true, true,
) ?> ) ?>
<?= form_input([
'id' => 'partner_link_url',
'name' => 'partner_link_url',
'class' => 'form-input w-full',
'value' => old('partner_link_url', $podcast->partner_link_url),
]) ?>
</div>
<div class="flex flex-col flex-1">
<?= form_label(
lang('Podcast.form.partner_image_url'),
'partner_image_url',
[],
lang('Podcast.form.partner_image_url_hint'),
true,
) ?>
<?= form_input([ <?= form_input([
'id' => 'partner_image_url', 'id' => 'partner_image_url',
'name' => 'partner_image_url', 'name' => 'partner_image_url',
'class' => 'form-input w-full', 'class' => 'form-input w-full',
'value' => old('partner_image_url', $podcast->partner_image_url), 'value' => old('partner_image_url', $podcast->partner_image_url),
]) ?> ]) ?>
</div> </div>
</div> </div>
<?= form_section_close() ?> <?= form_section_close() ?>
<?= form_section( <?= form_section(
lang('Podcast.form.advanced_section_title'), lang('Podcast.form.advanced_section_title'),
lang('Podcast.form.advanced_section_subtitle'), lang('Podcast.form.advanced_section_subtitle'),
) ?> ) ?>
<?= form_label( <?= form_label(
lang('Podcast.form.custom_rss'), lang('Podcast.form.custom_rss'),
'custom_rss', 'custom_rss',
[], [],
lang('Podcast.form.custom_rss_hint'), lang('Podcast.form.custom_rss_hint'),
true, true,
) ?> ) ?>
<Forms.XMLEditor id="custom_rss" name="custom_rss"><?= old('custom_rss', $podcast->custom_rss_string, false) ?></Forms.XMLEditor> <Forms.XMLEditor id="custom_rss" name="custom_rss"><?= old('custom_rss', $podcast->custom_rss_string, false) ?></Forms.XMLEditor>
<?= form_section_close() ?> <?= form_section_close() ?>
<?= form_section( <?= form_section(
lang('Podcast.form.status_section_title'), lang('Podcast.form.status_section_title'),
lang('Podcast.form.status_section_subtitle'), lang('Podcast.form.status_section_subtitle'),
) ?> ) ?>
<Forms.Toggler class="mb-2" id="lock" name="lock" value="yes" checked="<?= old('complete', $podcast->is_locked) ?>" hint="<?= lang('Podcast.form.lock_hint') ?>"> <Forms.Toggler class="mb-2" id="lock" name="lock" value="yes" checked="<?= old('complete', $podcast->is_locked) ?>" hint="<?= lang('Podcast.form.lock_hint') ?>">
<?= lang('Podcast.form.lock') ?> <?= lang('Podcast.form.lock') ?>

View File

@ -22,28 +22,28 @@
</div> </div>
<?= form_section( <?= form_section(
lang('PodcastImport.old_podcast_section_title'), lang('PodcastImport.old_podcast_section_title'),
icon('scales', 'mr-2 text-lg flex-shrink-0') . icon('scales', 'mr-2 text-lg flex-shrink-0') .
lang('PodcastImport.old_podcast_section_subtitle'), lang('PodcastImport.old_podcast_section_subtitle'),
[], [],
'inline-flex text-xs p-2 text-blue-800 font-semibold bg-blue-100 border border-blue-300 rounded', 'inline-flex text-xs p-2 text-blue-800 font-semibold bg-blue-100 border border-blue-300 rounded',
) ?> ) ?>
<?= form_label( <?= form_label(
lang('PodcastImport.imported_feed_url'), lang('PodcastImport.imported_feed_url'),
'imported_feed_url', 'imported_feed_url',
[], [],
lang('PodcastImport.imported_feed_url_hint'), lang('PodcastImport.imported_feed_url_hint'),
) ?> ) ?>
<?= form_input([ <?= form_input([
'id' => 'imported_feed_url', 'id' => 'imported_feed_url',
'name' => 'imported_feed_url', 'name' => 'imported_feed_url',
'class' => 'form-input', 'class' => 'form-input',
'value' => old('imported_feed_url'), 'value' => old('imported_feed_url'),
'placeholder' => 'https://...', 'placeholder' => 'https://...',
'type' => 'url', 'type' => 'url',
'required' => 'required', 'required' => 'required',
]) ?> ]) ?>
<?= form_section_close() ?> <?= form_section_close() ?>
@ -51,11 +51,11 @@
<?= form_section(lang('PodcastImport.new_podcast_section_title'), '') ?> <?= form_section(lang('PodcastImport.new_podcast_section_title'), '') ?>
<?= form_label( <?= form_label(
lang('Podcast.form.handle'), lang('Podcast.form.handle'),
'handle', 'handle',
[], [],
lang('Podcast.form.handle_hint'), lang('Podcast.form.handle_hint'),
) ?> ) ?>
<div class="relative mb-4"> <div class="relative mb-4">
<?= icon('at', 'absolute text-xl h-full inset-0 text-gray-400 left-3') ?> <?= icon('at', 'absolute text-xl h-full inset-0 text-gray-400 left-3') ?>
<?= form_input([ <?= form_input([
@ -79,7 +79,7 @@
'id' => 'category', 'id' => 'category',
'class' => 'form-select mb-4', 'class' => 'form-select mb-4',
'required' => 'required', 'required' => 'required',
'placeholder' => lang('Podcast.form.category_placeholder') 'placeholder' => lang('Podcast.form.category_placeholder'),
]) ?> ]) ?>
<?= form_section_close() ?> <?= form_section_close() ?>
@ -90,85 +90,89 @@
lang('PodcastImport.advanced_params_section_subtitle'), lang('PodcastImport.advanced_params_section_subtitle'),
) ?> ) ?>
<?= form_fieldset('', ['class' => 'flex flex-col mb-4']) ?> <?= form_fieldset('', [
'class' => 'flex flex-col mb-4',
]) ?>
<legend><?= lang('PodcastImport.slug_field.label') ?></legend> <legend><?= lang('PodcastImport.slug_field.label') ?></legend>
<label for="title" class="inline-flex items-center">
<?= form_radio(
[
'id' => 'title',
'name' => 'slug_field',
'class' => 'form-radio text-pine-700',
],
'title',
old('slug_field') ? old('slug_field') === 'title' : true,
) ?>
<span class="ml-2"><?= lang('PodcastImport.slug_field.title') ?></span>
</label>
<label for="link" class="inline-flex items-center"> <label for="link" class="inline-flex items-center">
<?= form_radio( <?= form_radio(
[ [
'id' => 'link', 'id' => 'title',
'name' => 'slug_field', 'name' => 'slug_field',
'class' => 'form-radio text-pine-700', 'class' => 'form-radio text-pine-700',
], ],
'link', 'title',
old('slug_field') && old('slug_field') === 'link', old('slug_field') ? old('slug_field') === 'title' : true,
) ?> ) ?>
<span class="ml-2"><?= lang('PodcastImport.slug_field.title') ?></span>
</label>
<label for="title" class="inline-flex items-center">
<?= form_radio(
[
'id' => 'link',
'name' => 'slug_field',
'class' => 'form-radio text-pine-700',
],
'link',
old('slug_field') && old('slug_field') === 'link',
) ?>
<span class="ml-2"><?= lang('PodcastImport.slug_field.link') ?></span> <span class="ml-2"><?= lang('PodcastImport.slug_field.link') ?></span>
</label> </label>
<?= form_fieldset_close() ?> <?= form_fieldset_close() ?>
<?= form_fieldset('', ['class' => 'flex flex-col mb-4']) ?> <?= form_fieldset('', [
'class' => 'flex flex-col mb-4',
]) ?>
<legend><?= lang('PodcastImport.description_field') ?></legend> <legend><?= lang('PodcastImport.description_field') ?></legend>
<label for="description" class="inline-flex items-center"> <label for="description" class="inline-flex items-center">
<?= form_radio( <?= form_radio(
[ [
'id' => 'description', 'id' => 'description',
'name' => 'description_field', 'name' => 'description_field',
'class' => 'form-radio text-pine-700', 'class' => 'form-radio text-pine-700',
], ],
'description', 'description',
old('description_field') old('description_field')
? old('description_field') == 'description' ? old('description_field') === 'description'
: true, : true,
) ?> ) ?>
<span class="ml-2">&lt;description&gt;</span> <span class="ml-2">&lt;description&gt;</span>
</label> </label>
<label for="summary" class="inline-flex items-center"> <label for="summary" class="inline-flex items-center">
<?= form_radio( <?= form_radio(
[ [
'id' => 'summary', 'id' => 'summary',
'name' => 'description_field', 'name' => 'description_field',
'class' => 'form-radio text-pine-600', 'class' => 'form-radio text-pine-600',
], ],
'summary', 'summary',
old('description_field') && old('description_field') == 'summary', old('description_field') && old('description_field') === 'summary',
) ?> ) ?>
<span class="ml-2">&lt;itunes:summary&gt;</span> <span class="ml-2">&lt;itunes:summary&gt;</span>
</label> </label>
<label for="subtitle_summary" class="inline-flex items-center"> <label for="subtitle_summary" class="inline-flex items-center">
<?= form_radio( <?= form_radio(
[ [
'id' => 'subtitle_summary', 'id' => 'subtitle_summary',
'name' => 'description_field', 'name' => 'description_field',
'class' => 'form-radio text-pine-700', 'class' => 'form-radio text-pine-700',
], ],
'subtitle_summary', 'subtitle_summary',
old('description_field') && old('description_field') &&
old('description_field') == 'subtitle_summary', old('description_field') === 'subtitle_summary',
) ?> ) ?>
<span class="ml-2">&lt;itunes:subtitle&gt; + &lt;itunes:summary&gt;</span> <span class="ml-2">&lt;itunes:subtitle&gt; + &lt;itunes:summary&gt;</span>
</label> </label>
<label for="content" class="inline-flex items-center"> <label for="content" class="inline-flex items-center">
<?= form_radio( <?= form_radio(
[ [
'id' => 'content', 'id' => 'content',
'name' => 'description_field', 'name' => 'description_field',
'class' => 'form-radio text-pine-700', 'class' => 'form-radio text-pine-700',
], ],
'content', 'content',
old('description_field') && old('description_field') == 'content', old('description_field') && old('description_field') === 'content',
) ?> ) ?>
<span class="ml-2">&lt;content:encoded&gt;</span> <span class="ml-2">&lt;content:encoded&gt;</span>
</label> </label>
<?= form_fieldset_close() ?> <?= form_fieldset_close() ?>
@ -176,14 +180,14 @@
<label class="inline-flex items-center mb-4"> <label class="inline-flex items-center mb-4">
<?= form_checkbox( <?= form_checkbox(
[ [
'id' => 'force_renumber', 'id' => 'force_renumber',
'name' => 'force_renumber', 'name' => 'force_renumber',
'class' => 'form-checkbox text-pine-700', 'class' => 'form-checkbox text-pine-700',
], ],
'yes', 'yes',
old('force_renumber', false), old('force_renumber', false),
) ?> ) ?>
<span class="ml-2"><?= lang('PodcastImport.force_renumber') ?></span> <span class="ml-2"><?= lang('PodcastImport.force_renumber') ?></span>
<?= hint_tooltip(lang('PodcastImport.force_renumber_hint'), 'ml-1') ?> <?= hint_tooltip(lang('PodcastImport.force_renumber_hint'), 'ml-1') ?>
</label> </label>
@ -221,8 +225,13 @@
<?= button( <?= button(
lang('PodcastImport.submit'), lang('PodcastImport.submit'),
'', '',
['variant' => 'primary'], [
['type' => 'submit', 'class' => 'self-end'], 'variant' => 'primary',
],
[
'type' => 'submit',
'class' => 'self-end',
],
) ?> ) ?>
<?= form_close() ?> <?= form_close() ?>

View File

@ -1,10 +1,10 @@
<section class="flex flex-col"> <section class="flex flex-col">
<header class="flex justify-between py-2"> <header class="flex justify-between py-2">
<h2 class="text-xl"><?= lang('Podcast.latest_episodes') ?></h1> <Heading level="2"><?= lang('Podcast.latest_episodes') ?></Heading>
<a href="<?= route_to( <a href="<?= route_to(
'episode-list', 'episode-list',
$podcast->id, $podcast->id,
) ?>" class="inline-flex items-center text-sm underline hover:no-underline"> ) ?>" class="inline-flex items-center text-sm underline hover:no-underline">
<?= lang('Podcast.see_all_episodes') ?> <?= lang('Podcast.see_all_episodes') ?>
<?= icon('chevron-right', 'ml-2') ?> <?= icon('chevron-right', 'ml-2') ?>
</a> </a>
@ -15,10 +15,10 @@
<article class="snap-center flex flex-col flex-shrink-0 flex-1 w-full min-w-[12rem] max-w-[17rem] overflow-hidden bg-white border-2 border-pine-100 rounded-xl"> <article class="snap-center flex flex-col flex-shrink-0 flex-1 w-full min-w-[12rem] max-w-[17rem] overflow-hidden bg-white border-2 border-pine-100 rounded-xl">
<div class="relative"> <div class="relative">
<?= publication_pill( <?= publication_pill(
$episode->published_at, $episode->published_at,
$episode->publication_status, $episode->publication_status,
'absolute top-2 right-2 text-sm' 'absolute top-2 right-2 text-sm'
); ?> ); ?>
<img <img
src="<?= $episode->image->medium_url ?>" src="<?= $episode->image->medium_url ?>"
alt="<?= $episode->title ?>" class="object-cover w-full" /> alt="<?= $episode->title ?>" class="object-cover w-full" />
@ -26,18 +26,18 @@
<div class="flex items-start justify-between p-2"> <div class="flex items-start justify-between p-2">
<div class="flex flex-col min-w-0"> <div class="flex flex-col min-w-0">
<a href="<?= route_to( <a href="<?= route_to(
'episode-view', 'episode-view',
$podcast->id, $podcast->id,
$episode->id, $episode->id,
) ?>" ) ?>"
class="text-sm font-semibold truncate hover:underline" class="text-sm font-semibold truncate hover:underline"
> >
<?= episode_numbering( <?= episode_numbering(
$episode->number, $episode->number,
$episode->season_number, $episode->season_number,
'font-semibold text-gray-600', 'font-semibold text-gray-600',
true, true,
) ?> ) ?>
<span class="mx-1">-</span> <span class="mx-1">-</span>
<?= $episode->title ?> <?= $episode->title ?>
</a> </a>
@ -59,33 +59,33 @@
data-dropdown="menu" data-dropdown="menu"
data-dropdown-placement="bottom"> data-dropdown-placement="bottom">
<a class="px-4 py-1 hover:bg-gray-100" href="<?= route_to( <a class="px-4 py-1 hover:bg-gray-100" href="<?= route_to(
'episode-edit', 'episode-edit',
$podcast->id, $podcast->id,
$episode->id, $episode->id,
) ?>"><?= lang('Episode.edit') ?></a> ) ?>"><?= lang('Episode.edit') ?></a>
<a class="px-4 py-1 hover:bg-gray-100" href="<?= route_to( <a class="px-4 py-1 hover:bg-gray-100" href="<?= route_to(
'embeddable-player-add', 'embeddable-player-add',
$podcast->id, $podcast->id,
$episode->id, $episode->id,
) ?>"><?= lang( ) ?>"><?= lang(
'Episode.embeddable_player.add', 'Episode.embeddable_player.add',
) ?></a> ) ?></a>
<a class="px-4 py-1 hover:bg-gray-100" href="<?= route_to( <a class="px-4 py-1 hover:bg-gray-100" href="<?= route_to(
'episode-persons-manage', 'episode-persons-manage',
$podcast->id, $podcast->id,
$episode->id, $episode->id,
) ?>"><?= lang('Person.persons') ?></a> ) ?>"><?= lang('Person.persons') ?></a>
<a class="px-4 py-1 hover:bg-gray-100" href="<?= route_to( <a class="px-4 py-1 hover:bg-gray-100" href="<?= route_to(
'episode', 'episode',
$podcast->handle, $podcast->handle,
$episode->slug, $episode->slug,
) ?>"><?= lang('Episode.go_to_page') ?></a> ) ?>"><?= lang('Episode.go_to_page') ?></a>
<hr class="my-2 border border-gray-100"> <hr class="my-2 border border-gray-100">
<a class="px-4 py-1 font-semibold text-red-600 hover:bg-gray-100" href="<?= route_to( <a class="px-4 py-1 font-semibold text-red-600 hover:bg-gray-100" href="<?= route_to(
'episode-delete', 'episode-delete',
$podcast->id, $podcast->id,
$episode->id, $episode->id,
) ?>"><?= lang('Episode.delete') ?></a> ) ?>"><?= lang('Episode.delete') ?></a>
</nav> </nav>
</div> </div>
</article> </article>

View File

@ -12,8 +12,13 @@
<?= button( <?= button(
lang('Podcast.create'), lang('Podcast.create'),
route_to('podcast-create'), route_to('podcast-create'),
['variant' => 'accent', 'iconLeft' => 'add'], [
['class' => 'mr-2'], 'variant' => 'accent',
'iconLeft' => 'add',
],
[
'class' => 'mr-2',
],
) ?> ) ?>
<?= button(lang('Podcast.import'), route_to('podcast-import'), [ <?= button(lang('Podcast.import'), route_to('podcast-import'), [
'variant' => 'primary', 'variant' => 'primary',
@ -31,27 +36,27 @@
<img <img
alt="<?= $podcast->title ?>" alt="<?= $podcast->title ?>"
src="<?= $podcast->image src="<?= $podcast->image
->medium_url ?>" class="object-cover w-full h-48" /> ->medium_url ?>" class="object-cover w-full h-48" />
<a href="<?= route_to( <a href="<?= route_to(
'podcast-view', 'podcast-view',
$podcast->id, $podcast->id,
) ?>" class="flex flex-col p-2 hover:underline"> ) ?>" class="flex flex-col p-2 hover:underline">
<h2 class="font-semibold truncate"><?= $podcast->title ?></h2> <h2 class="font-semibold truncate"><?= $podcast->title ?></h2>
<p class="text-gray-600">@<?= $podcast->handle ?></p> <p class="text-gray-600">@<?= $podcast->handle ?></p>
</a> </a>
<footer class="flex items-center justify-end p-2"> <footer class="flex items-center justify-end p-2">
<a class="inline-flex p-2 mr-2 text-blue-700 bg-blue-100 rounded-full shadow-xs hover:bg-blue-200" href="<?= route_to( <a class="inline-flex p-2 mr-2 text-blue-700 bg-blue-100 rounded-full shadow-xs hover:bg-blue-200" href="<?= route_to(
'podcast-edit', 'podcast-edit',
$podcast->id, $podcast->id,
) ?>" data-toggle="tooltip" data-placement="bottom" title="<?= lang( ) ?>" data-toggle="tooltip" data-placement="bottom" title="<?= lang(
'Podcast.edit', 'Podcast.edit',
) ?>"><?= icon('edit') ?></a> ) ?>"><?= icon('edit') ?></a>
<a class="inline-flex p-2 text-gray-700 bg-gray-100 rounded-full shadow-xs hover:bg-gray-200" href="<?= route_to( <a class="inline-flex p-2 text-gray-700 bg-gray-100 rounded-full shadow-xs hover:bg-gray-200" href="<?= route_to(
'podcast-view', 'podcast-view',
$podcast->id, $podcast->id,
) ?>" data-toggle="tooltip" data-placement="bottom" title="<?= lang( ) ?>" data-toggle="tooltip" data-placement="bottom" title="<?= lang(
'Podcast.view', 'Podcast.view',
) ?>"><?= icon('eye') ?></a> ) ?>"><?= icon('eye') ?></a>
</footer> </footer>
</article> </article>
<?php endforeach; ?> <?php endforeach; ?>

View File

@ -12,8 +12,13 @@
<?= button( <?= button(
lang('Person.create'), lang('Person.create'),
route_to('person-create'), route_to('person-create'),
['variant' => 'primary', 'iconLeft' => 'add'], [
['class' => 'mr-2'], 'variant' => 'primary',
'iconLeft' => 'add',
],
[
'class' => 'mr-2',
],
) ?> ) ?>
<?= $this->endSection() ?> <?= $this->endSection() ?>
@ -114,8 +119,13 @@
<?= button( <?= button(
lang('Person.podcast_form.submit_add'), lang('Person.podcast_form.submit_add'),
'', '',
['variant' => 'primary'], [
['type' => 'submit', 'class' => 'self-end'], 'variant' => 'primary',
],
[
'type' => 'submit',
'class' => 'self-end',
],
) ?> ) ?>
<?= form_close() ?> <?= form_close() ?>

View File

@ -20,22 +20,22 @@
<div class="relative flex items-start mb-8"> <div class="relative flex items-start mb-8">
<div class="flex flex-col items-center w-12 mr-4"> <div class="flex flex-col items-center w-12 mr-4">
<?= anchor( <?= anchor(
$platform->submit_url, $platform->submit_url,
icon( icon(
$platform->type . '/' . $platform->slug, $platform->type . '/' . $platform->slug,
'text-gray-600 text-4xl', 'text-gray-600 text-4xl',
), ),
[ [
'class' => 'mb-1 text-gray-600 hover:text-gray-900', 'class' => 'mb-1 text-gray-600 hover:text-gray-900',
'target' => '_blank', 'target' => '_blank',
'rel' => 'noopener noreferrer', 'rel' => 'noopener noreferrer',
'data-toggle' => 'tooltip', 'data-toggle' => 'tooltip',
'data-placement' => 'bottom', 'data-placement' => 'bottom',
'title' => lang('Platforms.submit_url', [ 'title' => lang('Platforms.submit_url', [
'platformName' => $platform->label, 'platformName' => $platform->label,
]), ]),
], ],
) ?> ) ?>
<div class="inline-flex bg-gray-200"> <div class="inline-flex bg-gray-200">
<?= anchor($platform->home_url, icon('external-link', 'mx-auto'), [ <?= anchor($platform->home_url, icon('external-link', 'mx-auto'), [
'class' => 'flex-1 text-gray-600 hover:text-gray-900', 'class' => 'flex-1 text-gray-600 hover:text-gray-900',
@ -103,19 +103,24 @@
'type' => 'text', 'type' => 'text',
'placeholder' => lang("Platforms.description.{$platform->type}"), 'placeholder' => lang("Platforms.description.{$platform->type}"),
]) ?> ]) ?>
<Forms.Toggler class="mb-1 text-sm" id="<?= $platform->slug . '_visible' ?>" name="<?= 'platforms[' . $platform->slug . '][visible]'?>" value="yes" checked="<?= old($platform->slug . '_visible', $platform->is_visible ? $platform->is_visible : false ) ?>"><?= lang('Platforms.visible') ?></Forms.Toggler> <Forms.Toggler class="mb-1 text-sm" id="<?= $platform->slug . '_visible' ?>" name="<?= 'platforms[' . $platform->slug . '][visible]'?>" value="yes" checked="<?= old($platform->slug . '_visible', $platform->is_visible ? $platform->is_visible : false) ?>"><?= lang('Platforms.visible') ?></Forms.Toggler>
<Forms.Toggler class="text-sm" id="<?= $platform->slug . '_on_embeddable_player' ?>" name="<?= 'platforms[' . $platform->slug . '][on_embeddable_player]'?>" value="yes" checked="<?= old($platform->slug . '_on_embeddable_player', $platform->is_on_embeddable_player ? $platform->is_on_embeddable_player : false ) ?>"><?= lang('Platforms.on_embeddable_player') ?></Forms.Toggler> <Forms.Toggler class="text-sm" id="<?= $platform->slug . '_on_embeddable_player' ?>" name="<?= 'platforms[' . $platform->slug . '][on_embeddable_player]'?>" value="yes" checked="<?= old($platform->slug . '_on_embeddable_player', $platform->is_on_embeddable_player ? $platform->is_on_embeddable_player : false) ?>"><?= lang('Platforms.on_embeddable_player') ?></Forms.Toggler>
</div> </div>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
<?= button( <?= button(
lang('Platforms.submit'), lang('Platforms.submit'),
'', '',
['variant' => 'primary'], [
['type' => 'submit', 'class' => 'self-end'], 'variant' => 'primary',
) ?> ],
[
'type' => 'submit',
'class' => 'self-end',
],
) ?>
<?= form_close() ?> <?= form_close() ?>

View File

@ -12,8 +12,13 @@
<?= button( <?= button(
lang('Podcast.edit'), lang('Podcast.edit'),
route_to('podcast-edit', $podcast->id), route_to('podcast-edit', $podcast->id),
['variant' => 'primary', 'iconLeft' => 'edit'], [
['class' => 'mr-2'], 'variant' => 'primary',
'iconLeft' => 'edit',
],
[
'class' => 'mr-2',
],
) ?> ) ?>
<?= button(lang('Episode.create'), route_to('episode-create', $podcast->id), [ <?= button(lang('Episode.create'), route_to('episode-create', $podcast->id), [
'variant' => 'accent', 'variant' => 'accent',

View File

@ -11,7 +11,9 @@
<?= $this->section('content') ?> <?= $this->section('content') ?>
<?= form_open(route_to('user-create'), ['class' => 'flex flex-col max-w-sm']) ?> <?= form_open(route_to('user-create'), [
'class' => 'flex flex-col max-w-sm',
]) ?>
<?= csrf_field() ?> <?= csrf_field() ?>
<?= form_label(lang('User.form.email'), 'email') ?> <?= form_label(lang('User.form.email'), 'email') ?>
@ -43,8 +45,13 @@
<?= button( <?= button(
lang('User.form.submit_create'), lang('User.form.submit_create'),
'', '',
['variant' => 'primary'], [
['type' => 'submit', 'class' => 'self-end'], 'variant' => 'primary',
],
[
'type' => 'submit',
'class' => 'self-end',
],
) ?> ) ?>
<?= form_close() ?> <?= form_close() ?>

View File

@ -1,11 +1,15 @@
<?= $this->extend('_layout') ?> <?= $this->extend('_layout') ?>
<?= $this->section('title') ?> <?= $this->section('title') ?>
<?= lang('User.edit_roles', ['username' => $user->username]) ?> <?= lang('User.edit_roles', [
'username' => $user->username,
]) ?>
<?= $this->endSection() ?> <?= $this->endSection() ?>
<?= $this->section('pageTitle') ?> <?= $this->section('pageTitle') ?>
<?= lang('User.edit_roles', ['username' => $user->username]) ?> <?= lang('User.edit_roles', [
'username' => $user->username,
]) ?>
<?= $this->endSection() ?> <?= $this->endSection() ?>
@ -22,8 +26,13 @@
<?= button( <?= button(
lang('User.form.submit_edit'), lang('User.form.submit_edit'),
'', '',
['variant' => 'primary'], [
['type' => 'submit', 'class' => 'self-end'], 'variant' => 'primary',
],
[
'type' => 'submit',
'class' => 'self-end',
],
) ?> ) ?>
<?= form_close() ?> <?= form_close() ?>

View File

@ -40,8 +40,12 @@
'username' => $user->username, 'username' => $user->username,
]), ]),
route_to('user-edit', $user->id), route_to('user-edit', $user->id),
['variant' => 'info'], [
['class' => 'ml-2'], 'variant' => 'info',
],
[
'class' => 'ml-2',
],
); );
}, },
], ],
@ -63,7 +67,9 @@
'variant' => 'secondary', 'variant' => 'secondary',
'size' => 'small', 'size' => 'small',
], ],
['class' => 'mr-2'], [
'class' => 'mr-2',
],
) . ) .
button( button(
lang('User.' . ($user->isBanned() ? 'unban' : 'ban')), lang('User.' . ($user->isBanned() ? 'unban' : 'ban')),
@ -71,13 +77,21 @@
$user->isBanned() ? 'user-unban' : 'user-ban', $user->isBanned() ? 'user-unban' : 'user-ban',
$user->id, $user->id,
), ),
['variant' => 'warning', 'size' => 'small'], [
['class' => 'mr-2'], 'variant' => 'warning',
'size' => 'small',
],
[
'class' => 'mr-2',
],
) . ) .
button( button(
lang('User.delete'), lang('User.delete'),
route_to('user-delete', $user->id), route_to('user-delete', $user->id),
['variant' => 'danger', 'size' => 'small'], [
'variant' => 'danger',
'size' => 'small',
],
); );
}, },
], ],

View File

@ -1,12 +1,16 @@
<?= $this->extend('_layout') ?> <?= $this->extend('_layout') ?>
<?= $this->section('title') ?> <?= $this->section('title') ?>
<?= lang('User.view', ['username' => $user->username]) ?> <?= lang('User.view', [
'username' => $user->username,
]) ?>
<?= $this->endSection() ?> <?= $this->endSection() ?>
<?= $this->section('content') ?> <?= $this->section('content') ?>
<?= view('_partials/_user_info.php', ['user' => $user]) ?> <?= view('_partials/_user_info.php', [
'user' => $user,
]) ?>
<?= $this->endSection() ?> <?= $this->endSection() ?>

View File

@ -1,6 +1,7 @@
<?= helper('page') ?> <?= helper('page') ?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="<?= service('request')->getLocale() ?>"> <html lang="<?= service('request')
->getLocale() ?>">
<head> <head>
<meta charset="UTF-8"/> <meta charset="UTF-8"/>
@ -9,8 +10,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="shortcut icon" type="image/png" href="/favicon.ico" /> <link rel="shortcut icon" type="image/png" href="/favicon.ico" />
<?= service('vite')->asset('styles/index.css', 'css') ?> <?= service('vite')
<?= service('vite')->asset('js/audio-player.ts', 'js') ?> ->asset('styles/index.css', 'css') ?>
<?= service('vite')
->asset('js/audio-player.ts', 'js') ?>
</head> </head>
<body class="flex flex-col min-h-screen mx-auto bg-gray-100"> <body class="flex flex-col min-h-screen mx-auto bg-gray-100">

View File

@ -1,5 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="<?= service('request')->getLocale() ?>"> <html lang="<?= service('request')
->getLocale() ?>">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
@ -9,31 +10,33 @@
) ?>" /> ) ?>" />
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" /> <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
<link rel="canonical" href="<?= $episode->link ?>" /> <link rel="canonical" href="<?= $episode->link ?>" />
<?= service('vite')->asset('styles/index.css', 'css') ?> <?= service('vite')
<?= service('vite')->asset('js/embed.ts', 'js') ?> ->asset('styles/index.css', 'css') ?>
<?= service('vite')
->asset('js/embed.ts', 'js') ?>
</head> </head>
<body class="flex w-full h-screen" style="background: <?= $themeData[ <body class="flex w-full h-screen" style="background: <?= $themeData[
'background' 'background'
] ?>; color: <?= $themeData['text'] ?>;"> ] ?>; color: <?= $themeData['text'] ?>;">
<img src="<?= $episode->image <img src="<?= $episode->image
->thumbnail_url ?>" alt="<?= $episode->title ?>" class="flex-shrink w-36 h-36" /> ->thumbnail_url ?>" alt="<?= $episode->title ?>" class="flex-shrink w-36 h-36" />
<div class="flex flex-col flex-1 min-w-0 px-4 py-2 h-36"> <div class="flex flex-col flex-1 min-w-0 px-4 py-2 h-36">
<div class="flex items-center"> <div class="flex items-center">
<a href="<?= route_to( <a href="<?= route_to(
'podcast-activity', 'podcast-activity',
$podcast->handle, $podcast->handle,
) ?>" style="color: <?= $themeData[ ) ?>" style="color: <?= $themeData[
'text' 'text'
] ?>;" class="mr-2 text-xs tracking-wider uppercase truncate opacity-75 hover:opacity-100" target="_blank"> ] ?>;" class="mr-2 text-xs tracking-wider uppercase truncate opacity-75 hover:opacity-100" target="_blank">
<?= $podcast->title ?> <?= $podcast->title ?>
</a> </a>
<a href="https://castopod.org/" class="ml-auto text-3xl text-pine-700 hover:opacity-75" title="<?= lang( <a href="https://castopod.org/" class="ml-auto text-3xl text-pine-700 hover:opacity-75" title="<?= lang(
'Common.powered_by', 'Common.powered_by',
[ [
'castopod' => 'Castopod', 'castopod' => 'Castopod',
], ],
) ?>" target="_blank" rel="noopener noreferrer"> ) ?>" target="_blank" rel="noopener noreferrer">
<?= icon('podcasting/castopod') ?> <?= icon('podcasting/castopod') ?>
</a> </a>
</div> </div>
@ -44,11 +47,11 @@
<?= $episode->title ?> <?= $episode->title ?>
</h1> </h1>
<?= episode_numbering( <?= episode_numbering(
$episode->number, $episode->number,
$episode->season_number, $episode->season_number,
'text-xs', 'text-xs',
true, true,
) ?> ) ?>
</a> </a>
<vm-player <vm-player
id="castopod-vm-player" id="castopod-vm-player"

View File

@ -1,6 +1,7 @@
<?= helper('page') ?> <?= helper('page') ?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="<?= service('request')->getLocale() ?>"> <html lang="<?= service('request')
->getLocale() ?>">
<head> <head>
<meta charset="UTF-8"/> <meta charset="UTF-8"/>
@ -8,22 +9,23 @@
<meta name="description" content="Castopod is an open-source hosting platform made for podcasters who want engage and interact with their audience."/> <meta name="description" content="Castopod is an open-source hosting platform made for podcasters who want engage and interact with their audience."/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="shortcut icon" type="image/png" href="/favicon.ico" /> <link rel="shortcut icon" type="image/png" href="/favicon.ico" />
<?= service('vite')->asset('styles/index.css', 'css') ?> <?= service('vite')
->asset('styles/index.css', 'css') ?>
</head> </head>
<body class="flex flex-col min-h-screen mx-auto bg-pine-50"> <body class="flex flex-col min-h-screen mx-auto bg-pine-50">
<header class="py-8 text-white border-b bg-pine-800"> <header class="py-8 text-white border-b bg-pine-800">
<div class="container flex items-center justify-between px-2 py-4 mx-auto"> <div class="container flex items-center justify-between px-2 py-4 mx-auto">
<a href="<?= route_to( <a href="<?= route_to(
'home', 'home',
) ?>" class="inline-flex items-baseline text-3xl font-semibold font-display"><?= 'castopod' . ) ?>" class="inline-flex items-baseline text-3xl font-semibold font-display"><?= 'castopod' .
svg('castopod-logo', 'h-6 ml-2') ?></a> svg('castopod-logo', 'h-6 ml-2') ?></a>
</div> </div>
</header> </header>
<main class="container flex-1 px-4 py-10 mx-auto"> <main class="container flex-1 px-4 py-10 mx-auto">
<h1 class="mb-2 text-xl"><?= lang('Home.all_podcasts') ?> (<?= count( <h1 class="mb-2 text-xl"><?= lang('Home.all_podcasts') ?> (<?= count(
$podcasts, $podcasts,
) ?>)</h1> ) ?>)</h1>
<section class="grid gap-4 grid-cols-podcasts"> <section class="grid gap-4 grid-cols-podcasts">
<?php if ($podcasts): ?> <?php if ($podcasts): ?>
<?php foreach ($podcasts as $podcast): ?> <?php foreach ($podcasts as $podcast): ?>

View File

@ -1,13 +1,15 @@
<?= helper('page') ?> <?= helper('page') ?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="<?= service('request')->getLocale() ?>"> <html lang="<?= service('request')
->getLocale() ?>">
<head> <head>
<meta charset="UTF-8"/> <meta charset="UTF-8"/>
<title><?= $page->title ?></title> <title><?= $page->title ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="shortcut icon" type="image/png" href="/favicon.ico" /> <link rel="shortcut icon" type="image/png" href="/favicon.ico" />
<?= service('vite')->asset('styles/index.css', 'css') ?> <?= service('vite')
->asset('styles/index.css', 'css') ?>
</head> </head>
<body class="flex flex-col min-h-screen mx-auto"> <body class="flex flex-col min-h-screen mx-auto">
@ -15,9 +17,9 @@
<div class="container flex flex-col px-2 py-4 mx-auto"> <div class="container flex flex-col px-2 py-4 mx-auto">
<a href="<?= route_to('home') ?>" <a href="<?= route_to('home') ?>"
class="inline-flex items-center mb-2"><?= icon( class="inline-flex items-center mb-2"><?= icon(
'arrow-left', 'arrow-left',
'mr-2', 'mr-2',
) . lang('Page.back_to_home') ?></a> ) . lang('Page.back_to_home') ?></a>
<h1 class="text-3xl font-semibold"><?= $page->title ?></h1> <h1 class="text-3xl font-semibold"><?= $page->title ?></h1>
</div> </div>
</header> </header>

View File

@ -1,7 +1,8 @@
<?= helper('page') ?> <?= helper('page') ?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="<?= service('request')->getLocale() ?>"> <html lang="<?= service('request')
->getLocale() ?>">
<head> <head>
<meta charset="UTF-8"/> <meta charset="UTF-8"/>
@ -13,9 +14,12 @@
<meta name="monetization" content="<?= $podcast->payment_pointer ?>" /> <meta name="monetization" content="<?= $podcast->payment_pointer ?>" />
<?php endif; ?> <?php endif; ?>
<?= service('vite')->asset('styles/index.css', 'css') ?> <?= service('vite')
<?= service('vite')->asset('js/podcast.ts', 'js') ?> ->asset('styles/index.css', 'css') ?>
<?= service('vite')->asset('js/audio-player.ts', 'js') ?> <?= service('vite')
->asset('js/podcast.ts', 'js') ?>
<?= service('vite')
->asset('js/audio-player.ts', 'js') ?>
</head> </head>
<body class="flex w-full min-h-screen pb-20 overflow-x-hidden lg:mx-auto lg:container bg-pine-50 sm:pb-0"> <body class="flex w-full min-h-screen pb-20 overflow-x-hidden lg:mx-auto lg:container bg-pine-50 sm:pb-0">
@ -28,32 +32,32 @@
data-toggle-class="sticky -translate-x-full" data-toggle-class="sticky -translate-x-full"
class="flex-shrink-0 mr-3 overflow-hidden rounded-full focus:ring-2 focus:outline-none focus:ring-pine-50"> class="flex-shrink-0 mr-3 overflow-hidden rounded-full focus:ring-2 focus:outline-none focus:ring-pine-50">
<img src="<?= $podcast->image <img src="<?= $podcast->image
->thumbnail_url ?>" alt="<?= $podcast->title ?>" class="h-10"/> ->thumbnail_url ?>" alt="<?= $podcast->title ?>" class="h-10"/>
</button> </button>
<p class="flex flex-col flex-1 min-w-0 mr-2 text-white"> <p class="flex flex-col flex-1 min-w-0 mr-2 text-white">
<span class="text-sm font-semibold truncate"><?= $podcast->title ?></span> <span class="text-sm font-semibold truncate"><?= $podcast->title ?></span>
<span class="text-xs">@<?= $podcast->handle ?></span> <span class="text-xs">@<?= $podcast->handle ?></span>
</p> </p>
<?= anchor_popup( <?= anchor_popup(
route_to('follow', $podcast->handle), route_to('follow', $podcast->handle),
icon( icon(
'social/castopod', 'social/castopod',
'mr-2 text-xl text-pink-200 group-hover:text-pink-50', 'mr-2 text-xl text-pink-200 group-hover:text-pink-50',
) . lang('Podcast.follow'), ) . lang('Podcast.follow'),
[ [
'width' => 420, 'width' => 420,
'height' => 620, 'height' => 620,
'class' => 'class' =>
'group inline-flex mr-2 items-center px-3 py-1 text-xs tracking-wider font-semibold text-white uppercase rounded-full shadow focus:outline-none focus:ring bg-rose-600', 'group inline-flex mr-2 items-center px-3 py-1 text-xs tracking-wider font-semibold text-white uppercase rounded-full shadow focus:outline-none focus:ring bg-rose-600',
], ],
) ?> ) ?>
<button <button
data-toggle="main-sidebar" data-toggle="main-sidebar"
data-toggle-class="translate-x-full" data-toggle-class="translate-x-full"
data-toggle-body-class="-ml-64" data-toggle-body-class="-ml-64"
class="p-2 text-xl rounded-full focus:outline-none focus:ring-2 focus:ring-pine-600 text-pine-200 hover:text-pine-50"><?= icon( class="p-2 text-xl rounded-full focus:outline-none focus:ring-2 focus:ring-pine-600 text-pine-200 hover:text-pine-50"><?= icon(
'menu', 'menu',
) ?><span class="sr-only"><?= lang('Podcast.toggle_podcast_sidebar') ?></span></button> ) ?><span class="sr-only"><?= lang('Podcast.toggle_podcast_sidebar') ?></span></button>
</nav> </nav>
<?= $this->renderSection('content') ?> <?= $this->renderSection('content') ?>
</main> </main>
@ -65,10 +69,10 @@
data-toggle-class="translate-x-full" data-toggle-class="translate-x-full"
data-toggle-body-class="-ml-64" data-toggle-body-class="-ml-64"
class="fixed z-40 hidden p-4 text-xl rounded-full shadow-2xl sm:block lg:hidden bottom-4 left-4 bg-pine-800 focus:outline-none focus:ring-2 focus:ring-pine-600 text-pine-200 hover:text-pine-50"><?= icon( class="fixed z-40 hidden p-4 text-xl rounded-full shadow-2xl sm:block lg:hidden bottom-4 left-4 bg-pine-800 focus:outline-none focus:ring-2 focus:ring-pine-600 text-pine-200 hover:text-pine-50"><?= icon(
'menu', 'menu',
) ?><span class="sr-only"><?= lang( ) ?><span class="sr-only"><?= lang(
'Podcast.toggle_podcast_sidebar', 'Podcast.toggle_podcast_sidebar',
) ?></span></button> ) ?></span></button>
<!-- Funding links modal --> <!-- Funding links modal -->
<div id="funding-links" class="fixed top-0 left-0 z-50 flex items-center justify-center hidden w-screen h-screen"> <div id="funding-links" class="fixed top-0 left-0 z-50 flex items-center justify-center hidden w-screen h-screen">
@ -81,9 +85,11 @@
<div class="z-10 w-full max-w-xl bg-white rounded-lg shadow-2xl"> <div class="z-10 w-full max-w-xl bg-white rounded-lg shadow-2xl">
<div class="flex justify-between px-4 py-2 border-b"> <div class="flex justify-between px-4 py-2 border-b">
<h3 class="self-center text-lg"><?= lang( <h3 class="self-center text-lg"><?= lang(
'Podcast.funding_links', 'Podcast.funding_links',
['podcastTitle' => $podcast->title], [
) ?></h3> 'podcastTitle' => $podcast->title,
],
) ?></h3>
<button <button
data-toggle="funding-links" data-toggle="funding-links"
data-toggle-class="hidden" data-toggle-class="hidden"
@ -103,11 +109,11 @@
rel="noopener noreferrer" rel="noopener noreferrer"
class="inline-flex items-center font-semibold text-pine-900"> class="inline-flex items-center font-semibold text-pine-900">
<?= icon( <?= icon(
$fundingPlatform->type . $fundingPlatform->type .
'/' . '/' .
$fundingPlatform->slug, $fundingPlatform->slug,
'mr-2', 'mr-2',
) . $fundingPlatform->link_url ?> ) . $fundingPlatform->link_url ?>
</a> </a>
<?php endif; ?> <?php endif; ?>
<?php endforeach; ?> <?php endforeach; ?>

View File

@ -1,7 +1,8 @@
<?= helper('page') ?> <?= helper('page') ?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="<?= service('request')->getLocale() ?>"> <html lang="<?= service('request')
->getLocale() ?>">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
@ -13,9 +14,12 @@
<meta name="monetization" content="<?= $podcast->payment_pointer ?>" /> <meta name="monetization" content="<?= $podcast->payment_pointer ?>" />
<?php endif; ?> <?php endif; ?>
<?= service('vite')->asset('styles/index.css', 'css') ?> <?= service('vite')
<?= service('vite')->asset('js/podcast.ts', 'js') ?> ->asset('styles/index.css', 'css') ?>
<?= service('vite')->asset('js/audio-player.ts', 'js') ?> <?= service('vite')
->asset('js/podcast.ts', 'js') ?>
<?= service('vite')
->asset('js/audio-player.ts', 'js') ?>
</head> </head>
<body class="flex w-full min-h-screen pt-12 pb-20 overflow-x-hidden bg-pine-50 lg:mx-auto lg:container sm:pb-0"> <body class="flex w-full min-h-screen pt-12 pb-20 overflow-x-hidden bg-pine-50 lg:mx-auto lg:container sm:pb-0">
@ -31,32 +35,33 @@
<?php if (user()->podcasts !== []): ?> <?php if (user()->podcasts !== []): ?>
<button type="button" class="inline-flex items-center px-6 py-2 mt-auto font-semibold outline-none focus:ring" id="interact-as-dropdown" data-dropdown="button" data-dropdown-target="interact-as-dropdown-menu" aria-haspopup="true" aria-expanded="false"> <button type="button" class="inline-flex items-center px-6 py-2 mt-auto font-semibold outline-none focus:ring" id="interact-as-dropdown" data-dropdown="button" data-dropdown-target="interact-as-dropdown-menu" aria-haspopup="true" aria-expanded="false">
<img src="<?= interact_as_actor() <img src="<?= interact_as_actor()
->avatar_image_url ?>" class="w-8 h-8 mr-2 rounded-full" /> ->avatar_image_url ?>" class="w-8 h-8 mr-2 rounded-full" />
<?= '@' . interact_as_actor()->username ?> <?= '@' . interact_as_actor()->username ?>
<?= icon('caret-down', 'ml-auto') ?> <?= icon('caret-down', 'ml-auto') ?>
</button> </button>
<nav id="interact-as-dropdown-menu" class="absolute z-50 flex flex-col py-2 text-black whitespace-no-wrap bg-white border rounded shadow" aria-labelledby="my-accountDropdown" data-dropdown="menu" data-dropdown-placement="bottom-end"> <nav id="interact-as-dropdown-menu" class="absolute z-50 flex flex-col py-2 text-black whitespace-no-wrap bg-white border rounded shadow" aria-labelledby="my-accountDropdown" data-dropdown="menu" data-dropdown-placement="bottom-end">
<span class="px-4 text-xs tracking-wider text-gray-700 uppercase"><?= lang( <span class="px-4 text-xs tracking-wider text-gray-700 uppercase"><?= lang(
'Admin.choose_interact', 'Admin.choose_interact',
) ?></span> ) ?></span>
<form action="<?= route_to( <form action="<?= route_to(
'interact-as-actor', 'interact-as-actor',
) ?>" method="POST" class="flex flex-col"> ) ?>" method="POST" class="flex flex-col">
<?= csrf_field() ?> <?= csrf_field() ?>
<?php foreach (user()->podcasts as $userPodcast): ?> <?php foreach (user()->podcasts as $userPodcast): ?>
<button class="inline-flex items-center w-full px-4 py-1 hover:bg-gray-100" id="<?= "interact-as-actor-{$userPodcast->id}" ?>" name="actor_id" value="<?= $userPodcast->actor_id ?>"> <button class="inline-flex items-center w-full px-4 py-1 hover:bg-gray-100" id="<?= "interact-as-actor-{$userPodcast->id}" ?>" name="actor_id" value="<?= $userPodcast->actor_id ?>">
<span class="inline-flex items-center flex-1"> <span class="inline-flex items-center flex-1">
<img src="<?= $userPodcast->image <img src="<?= $userPodcast->image
->thumbnail_url ?>" class="w-8 h-8 mr-2 rounded-full" /><?= $userPodcast->title ?> ->thumbnail_url ?>" class="w-8 h-8 mr-2 rounded-full" /><?= $userPodcast->title ?>
<?php if ( <?php if (
interact_as_actor()->id === interact_as_actor()
->id ===
$userPodcast->actor_id $userPodcast->actor_id
): ?> ): ?>
</span> </span>
<?= icon( <?= icon(
'check', 'check',
'ml-4 bg-pine-800 text-white rounded-full', 'ml-4 bg-pine-800 text-white rounded-full',
) ?> ) ?>
<?php endif; ?> <?php endif; ?>
</button> </button>
<?php endforeach; ?> <?php endforeach; ?>
@ -73,32 +78,32 @@
data-toggle-class="sticky -translate-x-full" data-toggle-class="sticky -translate-x-full"
class="flex-shrink-0 mr-3 overflow-hidden rounded-full focus:ring-2 focus:outline-none focus:ring-pine-50"> class="flex-shrink-0 mr-3 overflow-hidden rounded-full focus:ring-2 focus:outline-none focus:ring-pine-50">
<img src="<?= $podcast->image <img src="<?= $podcast->image
->thumbnail_url ?>" alt="<?= $podcast->title ?>" class="h-10"/> ->thumbnail_url ?>" alt="<?= $podcast->title ?>" class="h-10"/>
</button> </button>
<p class="flex flex-col flex-1 min-w-0 mr-2 text-white"> <p class="flex flex-col flex-1 min-w-0 mr-2 text-white">
<span class="text-sm font-semibold truncate"><?= $podcast->title ?></span> <span class="text-sm font-semibold truncate"><?= $podcast->title ?></span>
<span class="text-xs">@<?= $podcast->handle ?></span> <span class="text-xs">@<?= $podcast->handle ?></span>
</p> </p>
<?= anchor_popup( <?= anchor_popup(
route_to('follow', $podcast->handle), route_to('follow', $podcast->handle),
icon( icon(
'social/castopod', 'social/castopod',
'mr-2 text-xl text-pink-200 group-hover:text-pink-50', 'mr-2 text-xl text-pink-200 group-hover:text-pink-50',
) . lang('Podcast.follow'), ) . lang('Podcast.follow'),
[ [
'width' => 420, 'width' => 420,
'height' => 620, 'height' => 620,
'class' => 'class' =>
'group inline-flex mr-2 items-center px-3 py-1 text-xs tracking-wider font-semibold text-white uppercase rounded-full shadow focus:outline-none focus:ring bg-rose-600', 'group inline-flex mr-2 items-center px-3 py-1 text-xs tracking-wider font-semibold text-white uppercase rounded-full shadow focus:outline-none focus:ring bg-rose-600',
], ],
) ?> ) ?>
<button <button
data-toggle="main-sidebar" data-toggle="main-sidebar"
data-toggle-class="translate-x-full" data-toggle-class="translate-x-full"
data-toggle-body-class="-ml-64" data-toggle-body-class="-ml-64"
class="p-2 text-xl rounded-full focus:outline-none focus:ring-2 focus:ring-pine-600 text-pine-200 hover:text-pine-50"><?= icon( class="p-2 text-xl rounded-full focus:outline-none focus:ring-2 focus:ring-pine-600 text-pine-200 hover:text-pine-50"><?= icon(
'menu', 'menu',
) ?><span class="sr-only"><?= lang('Podcast.toggle_podcast_sidebar') ?></span></button> ) ?><span class="sr-only"><?= lang('Podcast.toggle_podcast_sidebar') ?></span></button>
</nav> </nav>
<?= $this->renderSection('content') ?> <?= $this->renderSection('content') ?>
</main> </main>
@ -106,10 +111,10 @@
<?= $this->include('podcast/_partials/sidebar') ?> <?= $this->include('podcast/_partials/sidebar') ?>
<button data-toggle="main-sidebar" data-toggle-class="translate-x-full" data-toggle-body-class="-ml-64" class="fixed z-40 hidden p-4 text-xl rounded-full shadow-2xl sm:block lg:hidden bottom-4 left-4 bg-pine-800 focus:outline-none focus:ring-2 focus:ring-pine-600 text-pine-200 hover:text-pine-50"><?= icon( <button data-toggle="main-sidebar" data-toggle-class="translate-x-full" data-toggle-body-class="-ml-64" class="fixed z-40 hidden p-4 text-xl rounded-full shadow-2xl sm:block lg:hidden bottom-4 left-4 bg-pine-800 focus:outline-none focus:ring-2 focus:ring-pine-600 text-pine-200 hover:text-pine-50"><?= icon(
'menu', 'menu',
) ?><span class="sr-only"><?= lang( ) ?><span class="sr-only"><?= lang(
'Podcast.toggle_podcast_sidebar', 'Podcast.toggle_podcast_sidebar',
) ?></span></button> ) ?></span></button>
<!-- Funding links modal --> <!-- Funding links modal -->
<div id="funding-links" class="fixed top-0 left-0 z-50 flex items-center justify-center hidden w-screen h-screen"> <div id="funding-links" class="fixed top-0 left-0 z-50 flex items-center justify-center hidden w-screen h-screen">
@ -119,12 +124,14 @@
<div class="z-10 w-full max-w-xl bg-white rounded-lg shadow-2xl"> <div class="z-10 w-full max-w-xl bg-white rounded-lg shadow-2xl">
<div class="flex justify-between px-4 py-2 border-b"> <div class="flex justify-between px-4 py-2 border-b">
<h3 class="self-center text-lg"><?= lang( <h3 class="self-center text-lg"><?= lang(
'Podcast.funding_links', 'Podcast.funding_links',
['podcastTitle' => $podcast->title], [
) ?></h3> 'podcastTitle' => $podcast->title,
],
) ?></h3>
<button data-toggle="funding-links" data-toggle-class="hidden" aria-label="<?= lang( <button data-toggle="funding-links" data-toggle-class="hidden" aria-label="<?= lang(
'Common.close', 'Common.close',
) ?>" class="self-start p-1 text-2xl"> ) ?>" class="self-start p-1 text-2xl">
<?= icon('close') ?> <?= icon('close') ?>
</button> </button>
</div> </div>
@ -136,11 +143,11 @@
<?php if ($fundingPlatform->is_visible): ?> <?php if ($fundingPlatform->is_visible): ?>
<a href="<?= $fundingPlatform->link_url ?>" title="<?= $fundingPlatform->link_content ?>" target="_blank" rel="noopener noreferrer" class="inline-flex items-center font-semibold text-pine-900"> <a href="<?= $fundingPlatform->link_url ?>" title="<?= $fundingPlatform->link_content ?>" target="_blank" rel="noopener noreferrer" class="inline-flex items-center font-semibold text-pine-900">
<?= icon( <?= icon(
$fundingPlatform->type . $fundingPlatform->type .
'/' . '/' .
$fundingPlatform->slug, $fundingPlatform->slug,
'text-2xl text-gray-400 mr-2', 'text-2xl text-gray-400 mr-2',
) . $fundingPlatform->link_url ?> ) . $fundingPlatform->link_url ?>
</a> </a>
<?php endif; ?> <?php endif; ?>
<?php endforeach; ?> <?php endforeach; ?>

View File

@ -3,7 +3,7 @@
<div class="flex-1"> <div class="flex-1">
<header class="w-full mb-2 text-sm"> <header class="w-full mb-2 text-sm">
<a href="<?= $comment->actor <a href="<?= $comment->actor
->uri ?>" class="flex items-baseline hover:underline" <?= $comment->actor->is_local ->uri ?>" class="flex items-baseline hover:underline" <?= $comment->actor->is_local
? '' ? ''
: 'target="_blank" rel="noopener noreferrer"' ?>> : 'target="_blank" rel="noopener noreferrer"' ?>>
<span class="mr-2 font-semibold truncate"><?= $comment->actor <span class="mr-2 font-semibold truncate"><?= $comment->actor

View File

@ -1,15 +1,19 @@
<footer> <footer>
<button class="inline-flex items-center opacity-50 cursor-not-allowed hover:underline" title="<?= lang( <button class="inline-flex items-center opacity-50 cursor-not-allowed hover:underline" title="<?= lang(
'Comment.like', 'Comment.like',
[ [
'numberOfLikes' => $comment->likes_count, 'numberOfLikes' => $comment->likes_count,
], ],
) ?>"><?= icon('heart', 'text-xl mr-1 text-gray-500') . $comment->likes_count ?></button> ) ?>"><?= icon('heart', 'text-xl mr-1 text-gray-500') . $comment->likes_count ?></button>
<?php if($comment->replies_count): ?> <?php if ($comment->replies_count): ?>
<?= anchor( <?= anchor(
route_to('comment', $podcast->handle, $episode->slug, $comment->id), route_to('comment', $podcast->handle, $episode->slug, $comment->id),
icon('caret-down', 'text-xl mr-1') . lang('Comment.view_replies', ['numberOfReplies' => $comment->replies_count]), icon('caret-down', 'text-xl mr-1') . lang('Comment.view_replies', [
['class' => 'inline-flex items-center text-xs hover:underline'] 'numberOfReplies' => $comment->replies_count,
) ?> ]),
[
'class' => 'inline-flex items-center text-xs hover:underline',
]
) ?>
<?php endif; ?> <?php endif; ?>
</footer> </footer>

View File

@ -1,24 +1,28 @@
<footer> <footer>
<form action="<?= route_to('comment-attempt-like', interact_as_actor()->username, $episode->slug, $comment->id) ?>" method="POST" class="flex items-center gap-x-4"> <form action="<?= route_to('comment-attempt-like', interact_as_actor()->username, $episode->slug, $comment->id) ?>" method="POST" class="flex items-center gap-x-4">
<button type="submit" name="action" class="inline-flex items-center hover:underline group" title="<?= lang( <button type="submit" name="action" class="inline-flex items-center hover:underline group" title="<?= lang(
'Comment.likes', 'Comment.likes',
[ [
'numberOfLikes' => $comment->likes_count, 'numberOfLikes' => $comment->likes_count,
], ],
) ?>"><?= icon('heart', 'text-xl mr-1 text-gray-400 group-hover:text-red-600') . $comment->likes_count ?></button> ) ?>"><?= icon('heart', 'text-xl mr-1 text-gray-400 group-hover:text-red-600') . $comment->likes_count ?></button>
<?= button( <?= button(
lang('Comment.reply'), lang('Comment.reply'),
route_to('comment', $podcast->handle, $episode->slug, $comment->id), route_to('comment', $podcast->handle, $episode->slug, $comment->id),
[ [
'size' => 'small', 'size' => 'small',
], ],
) ?> ) ?>
</form> </form>
<?php if($comment->replies_count): ?> <?php if ($comment->replies_count): ?>
<?= anchor( <?= anchor(
route_to('comment', $podcast->handle, $episode->slug, $comment->id), route_to('comment', $podcast->handle, $episode->slug, $comment->id),
icon('caret-down', 'text-xl mr-1') . lang('Comment.view_replies', ['numberOfReplies' => $comment->replies_count]), icon('caret-down', 'text-xl mr-1') . lang('Comment.view_replies', [
['class' => 'inline-flex items-center text-xs hover:underline'] 'numberOfReplies' => $comment->replies_count,
) ?> ]),
[
'class' => 'inline-flex items-center text-xs hover:underline',
]
) ?>
<?php endif; ?> <?php endif; ?>
</footer> </footer>

View File

@ -1,15 +1,19 @@
<footer> <footer>
<button class="inline-flex items-center opacity-50 cursor-not-allowed hover:underline" title="<?= lang( <button class="inline-flex items-center opacity-50 cursor-not-allowed hover:underline" title="<?= lang(
'Comment.like', 'Comment.like',
[ [
'numberOfLikes' => $comment->likes_count, 'numberOfLikes' => $comment->likes_count,
], ],
) ?>"><?= icon('heart', 'text-xl mr-1 text-gray-500') . $comment->likes_count ?></button> ) ?>"><?= icon('heart', 'text-xl mr-1 text-gray-500') . $comment->likes_count ?></button>
<?php if($comment->replies_count): ?> <?php if ($comment->replies_count): ?>
<?= anchor( <?= anchor(
route_to('post', $podcast->handle, $comment->id), route_to('post', $podcast->handle, $comment->id),
icon('caret-down', 'text-xl mr-1') . lang('Comment.view_replies', ['numberOfReplies' => $comment->replies_count]), icon('caret-down', 'text-xl mr-1') . lang('Comment.view_replies', [
['class' => 'inline-flex items-center text-xs hover:underline'] 'numberOfReplies' => $comment->replies_count,
) ?> ]),
[
'class' => 'inline-flex items-center text-xs hover:underline',
]
) ?>
<?php endif; ?> <?php endif; ?>
</footer> </footer>

View File

@ -1,24 +1,28 @@
<footer> <footer>
<form action="<?= route_to('post-attempt-action', interact_as_actor()->username, $comment->id) ?>" method="POST" class="flex items-center gap-x-4"> <form action="<?= route_to('post-attempt-action', interact_as_actor()->username, $comment->id) ?>" method="POST" class="flex items-center gap-x-4">
<button type="submit" name="action" value="favourite" class="inline-flex items-center hover:underline group" title="<?= lang( <button type="submit" name="action" value="favourite" class="inline-flex items-center hover:underline group" title="<?= lang(
'Comment.likes', 'Comment.likes',
[ [
'numberOfLikes' => $comment->likes_count, 'numberOfLikes' => $comment->likes_count,
], ],
) ?>"><?= icon('heart', 'text-xl mr-1 text-gray-400 group-hover:text-red-600') . $comment->likes_count ?></button> ) ?>"><?= icon('heart', 'text-xl mr-1 text-gray-400 group-hover:text-red-600') . $comment->likes_count ?></button>
<?= button( <?= button(
lang('Comment.reply'), lang('Comment.reply'),
route_to('post', $podcast->handle, $comment->id), route_to('post', $podcast->handle, $comment->id),
[ [
'size' => 'small', 'size' => 'small',
], ],
) ?> ) ?>
</form> </form>
<?php if($comment->replies_count): ?> <?php if ($comment->replies_count): ?>
<?= anchor( <?= anchor(
route_to('post', $podcast->handle, $comment->id), route_to('post', $podcast->handle, $comment->id),
icon('caret-down', 'text-xl mr-1') . lang('Comment.view_replies', ['numberOfReplies' => $comment->replies_count]), icon('caret-down', 'text-xl mr-1') . lang('Comment.view_replies', [
['class' => 'inline-flex items-center text-xs hover:underline'] 'numberOfReplies' => $comment->replies_count,
) ?> ]),
[
'class' => 'inline-flex items-center text-xs hover:underline',
]
) ?>
<?php endif; ?> <?php endif; ?>
</footer> </footer>

View File

@ -3,7 +3,7 @@
<div class="flex-1"> <div class="flex-1">
<header class="w-full mb-2 text-sm"> <header class="w-full mb-2 text-sm">
<a href="<?= $comment->actor <a href="<?= $comment->actor
->uri ?>" class="flex items-baseline hover:underline" <?= $comment->actor->is_local ->uri ?>" class="flex items-baseline hover:underline" <?= $comment->actor->is_local
? '' ? ''
: 'target="_blank" rel="noopener noreferrer"' ?>> : 'target="_blank" rel="noopener noreferrer"' ?>>
<span class="mr-2 font-semibold truncate"><?= $comment->actor <span class="mr-2 font-semibold truncate"><?= $comment->actor

View File

@ -3,7 +3,7 @@
<div class="flex-1"> <div class="flex-1">
<header class="w-full mb-2 text-sm"> <header class="w-full mb-2 text-sm">
<a href="<?= $comment->actor <a href="<?= $comment->actor
->uri ?>" class="flex items-baseline hover:underline" <?= $comment->actor->is_local ->uri ?>" class="flex items-baseline hover:underline" <?= $comment->actor->is_local
? '' ? ''
: 'target="_blank" rel="noopener noreferrer"' ?>> : 'target="_blank" rel="noopener noreferrer"' ?>>
<span class="mr-2 font-semibold truncate"><?= $comment->actor <span class="mr-2 font-semibold truncate"><?= $comment->actor
@ -22,16 +22,16 @@
<?php else: ?> <?php else: ?>
<footer> <footer>
<button class="inline-flex items-center opacity-50 cursor-not-allowed" title="<?= lang( <button class="inline-flex items-center opacity-50 cursor-not-allowed" title="<?= lang(
'Comment.likes', 'Comment.likes',
[ [
'numberOfLikes' => $comment->likes_count, 'numberOfLikes' => $comment->likes_count,
], ],
) ?>"><?= icon('heart', 'text-xl mr-1 text-gray-500') . lang( ) ?>"><?= icon('heart', 'text-xl mr-1 text-gray-500') . lang(
'Comment.likes', 'Comment.likes',
[ [
'numberOfLikes' => $comment->likes_count, 'numberOfLikes' => $comment->likes_count,
], ],
) ?></button> ) ?></button>
</footer> </footer>
<?php endif; ?> <?php endif; ?>
</div> </div>

View File

@ -3,7 +3,7 @@
<div class="flex-1"> <div class="flex-1">
<header class="w-full mb-2 text-sm"> <header class="w-full mb-2 text-sm">
<a href="<?= $comment->actor <a href="<?= $comment->actor
->uri ?>" class="flex items-baseline hover:underline" <?= $comment->actor->is_local ->uri ?>" class="flex items-baseline hover:underline" <?= $comment->actor->is_local
? '' ? ''
: 'target="_blank" rel="noopener noreferrer"' ?>> : 'target="_blank" rel="noopener noreferrer"' ?>>
<span class="mr-2 font-semibold truncate"><?= $comment->actor <span class="mr-2 font-semibold truncate"><?= $comment->actor
@ -23,16 +23,16 @@
<footer> <footer>
<form action="<?= route_to('comment-attempt-like', interact_as_actor()->username, $episode->slug, $comment->id) ?>" method="POST" class="flex items-center gap-x-4"> <form action="<?= route_to('comment-attempt-like', interact_as_actor()->username, $episode->slug, $comment->id) ?>" method="POST" class="flex items-center gap-x-4">
<button type="submit" name="action" class="inline-flex items-center hover:underline group" title="<?= lang( <button type="submit" name="action" class="inline-flex items-center hover:underline group" title="<?= lang(
'Comment.likes', 'Comment.likes',
[ [
'numberOfLikes' => $comment->likes_count, 'numberOfLikes' => $comment->likes_count,
], ],
) ?>"><?= icon('heart', 'text-xl mr-1 text-gray-400 group-hover:text-red-600') . lang( ) ?>"><?= icon('heart', 'text-xl mr-1 text-gray-400 group-hover:text-red-600') . lang(
'Comment.likes', 'Comment.likes',
[ [
'numberOfLikes' => $comment->likes_count, 'numberOfLikes' => $comment->likes_count,
], ],
) ?></button> ) ?></button>
</form> </form>
</footer> </footer>
<?php endif; ?> <?php endif; ?>

View File

@ -4,12 +4,12 @@
<div class="flex flex-col flex-1 min-w-0"> <div class="flex flex-col flex-1 min-w-0">
<header class="flex items-center mb-2"> <header class="flex items-center mb-2">
<a href="<?= $reply->actor <a href="<?= $reply->actor
->uri ?>" class="mr-2 text-base font-semibold truncate hover:underline" <?= $reply ->uri ?>" class="mr-2 text-base font-semibold truncate hover:underline" <?= $reply
->actor->is_local ->actor->is_local
? '' ? ''
: 'target="_blank" rel="noopener noreferrer"' ?>><?= $reply->actor : 'target="_blank" rel="noopener noreferrer"' ?>><?= $reply->actor
->display_name ?><span class="ml-1 text-sm font-normal text-gray-600">@<?= $reply ->display_name ?><span class="ml-1 text-sm font-normal text-gray-600">@<?= $reply
->actor->username . ->actor->username .
($reply->actor->is_local ? '' : '@' . $reply->actor->domain) ?></span></a> ($reply->actor->is_local ? '' : '@' . $reply->actor->domain) ?></span></a>
<?= relative_time($reply->created_at, 'flex-shrink-0 ml-auto text-xs text-gray-600') ?> <?= relative_time($reply->created_at, 'flex-shrink-0 ml-auto text-xs text-gray-600') ?>
</header> </header>

View File

@ -1,20 +1,20 @@
<footer class="flex items-center gap-x-4"> <footer class="flex items-center gap-x-4">
<button type="submit" name="action" class="inline-flex items-center opacity-50 cursor-not-allowed" disabled="disabled" title="<?= lang( <button type="submit" name="action" class="inline-flex items-center opacity-50 cursor-not-allowed" disabled="disabled" title="<?= lang(
'Comment.likes', 'Comment.likes',
[ [
'numberOfLikes' => $reply->likes_count, 'numberOfLikes' => $reply->likes_count,
], ],
) ?>"><?= icon('heart', 'text-xl mr-1 text-gray-500') . $reply->likes_count ?></button> ) ?>"><?= icon('heart', 'text-xl mr-1 text-gray-500') . $reply->likes_count ?></button>
<?php if($reply->replies_count): ?> <?php if ($reply->replies_count): ?>
<?= anchor( <?= anchor(
route_to('comment', $podcast->handle, $episode->slug, $reply->id), route_to('comment', $podcast->handle, $episode->slug, $reply->id),
icon('chat', 'text-2xl mr-1 text-gray-400') . $reply->replies_count, icon('chat', 'text-2xl mr-1 text-gray-400') . $reply->replies_count,
[ [
'class' => 'inline-flex items-center hover:underline', 'class' => 'inline-flex items-center hover:underline',
'title' => lang('Comment.replies', [ 'title' => lang('Comment.replies', [
'numberOfReplies' => $reply->replies_count, 'numberOfReplies' => $reply->replies_count,
]), ]),
], ],
) ?> ) ?>
<?php endif; ?> <?php endif; ?>
</footer> </footer>

View File

@ -1,17 +1,17 @@
<footer> <footer>
<form action="<?= route_to('comment-attempt-like', interact_as_actor()->username, $episode->slug, $reply->id) ?>" method="POST" class="flex items-center gap-x-4"> <form action="<?= route_to('comment-attempt-like', interact_as_actor()->username, $episode->slug, $reply->id) ?>" method="POST" class="flex items-center gap-x-4">
<button type="submit" name="action" class="inline-flex items-center hover:underline group" title="<?= lang( <button type="submit" name="action" class="inline-flex items-center hover:underline group" title="<?= lang(
'Comment.likes', 'Comment.likes',
[ [
'numberOfLikes' => $reply->likes_count, 'numberOfLikes' => $reply->likes_count,
], ],
) ?>"><?= icon('heart', 'text-xl mr-1 text-gray-400 group-hover:text-red-600') . $reply->likes_count ?></button> ) ?>"><?= icon('heart', 'text-xl mr-1 text-gray-400 group-hover:text-red-600') . $reply->likes_count ?></button>
<?= button( <?= button(
lang('Comment.reply'), lang('Comment.reply'),
route_to('comment', $podcast->handle, $episode->slug, $reply->id), route_to('comment', $podcast->handle, $episode->slug, $reply->id),
[ [
'size' => 'small', 'size' => 'small',
], ],
) ?> ) ?>
</form> </form>
</footer> </footer>

View File

@ -4,12 +4,12 @@
<div class="flex flex-col flex-1 min-w-0"> <div class="flex flex-col flex-1 min-w-0">
<header class="flex items-center mb-2"> <header class="flex items-center mb-2">
<a href="<?= $reply->actor <a href="<?= $reply->actor
->uri ?>" class="mr-2 text-base font-semibold truncate hover:underline" <?= $reply ->uri ?>" class="mr-2 text-base font-semibold truncate hover:underline" <?= $reply
->actor->is_local ->actor->is_local
? '' ? ''
: 'target="_blank" rel="noopener noreferrer"' ?>><?= $reply->actor : 'target="_blank" rel="noopener noreferrer"' ?>><?= $reply->actor
->display_name ?><span class="ml-1 text-sm font-normal text-gray-600">@<?= $reply ->display_name ?><span class="ml-1 text-sm font-normal text-gray-600">@<?= $reply
->actor->username . ->actor->username .
($reply->actor->is_local ? '' : '@' . $reply->actor->domain) ?></span></a> ($reply->actor->is_local ? '' : '@' . $reply->actor->domain) ?></span></a>
<?= relative_time($reply->created_at, 'flex-shrink-0 ml-auto text-xs text-gray-600') ?> <?= relative_time($reply->created_at, 'flex-shrink-0 ml-auto text-xs text-gray-600') ?>
</header> </header>

View File

@ -2,7 +2,9 @@
<div class="-mt-2 overflow-hidden border-b border-l border-r post-replies rounded-b-xl"> <div class="-mt-2 overflow-hidden border-b border-l border-r post-replies rounded-b-xl">
<?php foreach ($comment->replies as $reply): ?> <?php foreach ($comment->replies as $reply): ?>
<?= view('podcast/_partials/comment_reply', ['reply' => $reply]) ?> <?= view('podcast/_partials/comment_reply', [
'reply' => $reply,
]) ?>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>

View File

@ -11,31 +11,34 @@
->display_name ?>" class="w-12 h-12 mr-4 rounded-full ring-gray-50 ring-2" /> ->display_name ?>" class="w-12 h-12 mr-4 rounded-full ring-gray-50 ring-2" />
<div class="flex flex-col flex-1"> <div class="flex flex-col flex-1">
<?= form_textarea( <?= form_textarea(
[ [
'id' => 'message', 'id' => 'message',
'name' => 'message', 'name' => 'message',
'class' => 'form-textarea mb-4 w-full', 'class' => 'form-textarea mb-4 w-full',
'required' => 'required', 'required' => 'required',
'placeholder' => lang('Comment.form.reply_to_placeholder', [ 'placeholder' => lang('Comment.form.reply_to_placeholder', [
'actorUsername' => $comment->actor->username, 'actorUsername' => $comment->actor->username,
]), ]),
], ],
old('message', '', false), old('message', '', false),
[ [
'rows' => 1, 'rows' => 1,
], ],
) ?> ) ?>
<?= button( <?= button(
lang('Comment.form.submit_reply'), lang('Comment.form.submit_reply'),
'', '',
['variant' => 'primary', 'size' => 'small'], [
[ 'variant' => 'primary',
'type' => 'submit', 'size' => 'small',
'class' => 'self-end', ],
'name' => 'action', [
'value' => 'reply', 'type' => 'submit',
], 'class' => 'self-end',
) ?> 'name' => 'action',
'value' => 'reply',
],
) ?>
</div> </div>
<?= form_close() ?> <?= form_close() ?>

View File

@ -3,11 +3,11 @@
<div class="relative mr-2"> <div class="relative mr-2">
<time class="absolute px-1 text-xs font-semibold text-white rounded bottom-2 right-2 bg-black/50" datetime="PT<?= $episode->audio_file_duration ?>S"> <time class="absolute px-1 text-xs font-semibold text-white rounded bottom-2 right-2 bg-black/50" datetime="PT<?= $episode->audio_file_duration ?>S">
<?= format_duration( <?= format_duration(
$episode->audio_file_duration, $episode->audio_file_duration,
) ?> ) ?>
</time> </time>
<img loading="lazy" src="<?= $episode->image <img loading="lazy" src="<?= $episode->image
->thumbnail_url ?>" alt="<?= $episode->title ?>" class="object-cover w-20 h-20 rounded-lg" /> ->thumbnail_url ?>" alt="<?= $episode->title ?>" class="object-cover w-20 h-20 rounded-lg" />
</div> </div>
<div class="flex flex-col flex-1"> <div class="flex flex-col flex-1">
<a class="flex justify-between text-sm" href="<?= $episode->link ?>"> <a class="flex justify-between text-sm" href="<?= $episode->link ?>">
@ -26,16 +26,16 @@
<div class="flex mt-auto gap-x-4"> <div class="flex mt-auto gap-x-4">
<?= play_episode_button($episode->id, $episode->image->thumbnail_url, $episode->title, $podcast->title, $episode->audio_file_web_url, $episode->audio_file_mimetype, 'mt-auto') ?> <?= play_episode_button($episode->id, $episode->image->thumbnail_url, $episode->title, $podcast->title, $episode->audio_file_web_url, $episode->audio_file_mimetype, 'mt-auto') ?>
<?= anchor( <?= anchor(
route_to('episode', $podcast->handle, $episode->slug), route_to('episode', $podcast->handle, $episode->slug),
icon('chat', 'text-xl mr-1 text-gray-400') . icon('chat', 'text-xl mr-1 text-gray-400') .
$episode->comments_count, $episode->comments_count,
[ [
'class' => 'class' =>
'inline-flex items-center hover:underline', 'inline-flex items-center hover:underline',
'title' => lang('Episode.number_of_comments', [ 'title' => lang('Episode.number_of_comments', [
'numberOfComments' => $episode->comments_count, 'numberOfComments' => $episode->comments_count,
]), ]),
], ],
) ?> ) ?>
</div> </div>
</div> </div>

View File

@ -11,11 +11,11 @@
<a href="<?= $episode->link ?>" class="flex justify-between flex-1"> <a href="<?= $episode->link ?>" class="flex justify-between flex-1">
<div class="flex items-baseline font-semibold"> <div class="flex items-baseline font-semibold">
<?= episode_numbering( <?= episode_numbering(
$episode->number, $episode->number,
$episode->season_number, $episode->season_number,
'text-xs font-semibold text-gray-600', 'text-xs font-semibold text-gray-600',
true, true,
) ?> ) ?>
<span class="mx-1">-</span> <span class="mx-1">-</span>
<?= $episode->title ?> <?= $episode->title ?>
</div> </div>

View File

@ -1,22 +1,22 @@
<header id="main-header" class="fixed top-0 left-0 flex-col flex-shrink-0 h-screen transform -translate-x-full sm:left-auto sm:-translate-x-0 sm:sticky w-80 sm:w-64 lg:w-80 xl:w-112 sm:flex"> <header id="main-header" class="fixed top-0 left-0 flex-col flex-shrink-0 h-screen transform -translate-x-full sm:left-auto sm:-translate-x-0 sm:sticky w-80 sm:w-64 lg:w-80 xl:w-112 sm:flex">
<img src="<?= $podcast->actor <img src="<?= $podcast->actor
->cover_image_url ?>" alt="" class="object-cover w-full h-48 bg-pine-800"/> ->cover_image_url ?>" alt="" class="object-cover w-full h-48 bg-pine-800"/>
<div class="flex items-center justify-between px-4 py-2 mb-4 lg:px-6 -mt-14 lg:-mt-16 xl:-mt-20"> <div class="flex items-center justify-between px-4 py-2 mb-4 lg:px-6 -mt-14 lg:-mt-16 xl:-mt-20">
<img src="<?= $podcast->image <img src="<?= $podcast->image
->thumbnail_url ?>" alt="<?= $podcast->title ?>" class="h-24 rounded-full shadow-xl xl:h-36 lg:h-28 ring-4 ring-pine-50" /> ->thumbnail_url ?>" alt="<?= $podcast->title ?>" class="h-24 rounded-full shadow-xl xl:h-36 lg:h-28 ring-4 ring-pine-50" />
<?= anchor_popup( <?= anchor_popup(
route_to('follow', $podcast->handle), route_to('follow', $podcast->handle),
icon( icon(
'social/castopod', 'social/castopod',
'mr-2 text-xl text-pink-200 group-hover:text-pink-50', 'mr-2 text-xl text-pink-200 group-hover:text-pink-50',
) . lang('Podcast.follow'), ) . lang('Podcast.follow'),
[ [
'width' => 420, 'width' => 420,
'height' => 620, 'height' => 620,
'class' => 'class' =>
'group inline-flex items-center px-4 py-2 text-xs tracking-wider font-semibold text-white uppercase rounded-full shadow focus:outline-none focus:ring bg-rose-600', 'group inline-flex items-center px-4 py-2 text-xs tracking-wider font-semibold text-white uppercase rounded-full shadow focus:outline-none focus:ring bg-rose-600',
], ],
) ?> ) ?>
</div> </div>
<div class="px-6"> <div class="px-6">
<h1 class="inline-flex items-center text-2xl font-bold leading-none font-display"><?= $podcast->title . <h1 class="inline-flex items-center text-2xl font-bold leading-none font-display"><?= $podcast->title .
@ -37,8 +37,8 @@
<?php foreach ($podcast->other_categories as $other_category): ?> <?php foreach ($podcast->other_categories as $other_category): ?>
<span class="px-2 py-1 text-sm text-gray-800 bg-gray-200"> <span class="px-2 py-1 text-sm text-gray-800 bg-gray-200">
<?= lang( <?= lang(
'Podcast.category_options.' . $other_category->code, 'Podcast.category_options.' . $other_category->code,
) ?> ) ?>
</span> </span>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
@ -51,8 +51,8 @@
'podcast-activity', 'podcast-activity',
$podcast->handle, $podcast->handle,
) ?>" class="hover:underline"><?= lang('Podcast.posts', [ ) ?>" class="hover:underline"><?= lang('Podcast.posts', [
'numberOfPosts' => $podcast->actor->posts_count, 'numberOfPosts' => $podcast->actor->posts_count,
]) ?></a> ]) ?></a>
</div> </div>
</div> </div>
</header> </header>

View File

@ -1,17 +1,17 @@
<article class="relative z-10 w-full bg-white shadow rounded-2xl"> <article class="relative z-10 w-full bg-white shadow rounded-2xl">
<header class="flex px-6 py-4"> <header class="flex px-6 py-4">
<img src="<?= $post->actor <img src="<?= $post->actor
->avatar_image_url ?>" alt="<?= $post->actor->display_name ?>" class="w-12 h-12 mr-4 rounded-full" /> ->avatar_image_url ?>" alt="<?= $post->actor->display_name ?>" class="w-12 h-12 mr-4 rounded-full" />
<div class="flex flex-col min-w-0"> <div class="flex flex-col min-w-0">
<a href="<?= $post->actor <a href="<?= $post->actor
->uri ?>" class="flex items-baseline hover:underline" <?= $post ->uri ?>" class="flex items-baseline hover:underline" <?= $post
->actor->is_local ->actor->is_local
? '' ? ''
: 'target="_blank" rel="noopener noreferrer"' ?>> : 'target="_blank" rel="noopener noreferrer"' ?>>
<span class="mr-2 font-semibold truncate"><?= $post->actor <span class="mr-2 font-semibold truncate"><?= $post->actor
->display_name ?></span> ->display_name ?></span>
<span class="text-sm text-gray-500 truncate">@<?= $post->actor <span class="text-sm text-gray-500 truncate">@<?= $post->actor
->username . ->username .
($post->actor->is_local ($post->actor->is_local
? '' ? ''
: '@' . $post->actor->domain) ?></span> : '@' . $post->actor->domain) ?></span>

View File

@ -1,36 +1,36 @@
<footer class="flex justify-around px-6 py-3"> <footer class="flex justify-around px-6 py-3">
<?= anchor( <?= anchor(
route_to('post', $podcast->handle, $post->id), route_to('post', $podcast->handle, $post->id),
icon('chat', 'text-2xl mr-1 text-gray-400') . $post->replies_count, icon('chat', 'text-2xl mr-1 text-gray-400') . $post->replies_count,
[ [
'class' => 'inline-flex items-center hover:underline', 'class' => 'inline-flex items-center hover:underline',
'title' => lang('Post.replies', [ 'title' => lang('Post.replies', [
'numberOfReplies' => $post->replies_count, 'numberOfReplies' => $post->replies_count,
]), ]),
], ],
) ?> ) ?>
<?= anchor_popup( <?= anchor_popup(
route_to('post-remote-action', $podcast->handle, $post->id, 'reblog'), route_to('post-remote-action', $podcast->handle, $post->id, 'reblog'),
icon('repeat', 'text-2xl mr-1 text-gray-400') . $post->reblogs_count, icon('repeat', 'text-2xl mr-1 text-gray-400') . $post->reblogs_count,
[ [
'class' => 'inline-flex items-center hover:underline', 'class' => 'inline-flex items-center hover:underline',
'width' => 420, 'width' => 420,
'height' => 620, 'height' => 620,
'title' => lang('Post.reblogs', [ 'title' => lang('Post.reblogs', [
'numberOfReblogs' => $post->reblogs_count, 'numberOfReblogs' => $post->reblogs_count,
]), ]),
], ],
) ?> ) ?>
<?= anchor_popup( <?= anchor_popup(
route_to('post-remote-action', $podcast->handle, $post->id, 'favourite'), route_to('post-remote-action', $podcast->handle, $post->id, 'favourite'),
icon('heart', 'text-2xl mr-1 text-gray-400') . $post->favourites_count, icon('heart', 'text-2xl mr-1 text-gray-400') . $post->favourites_count,
[ [
'class' => 'inline-flex items-center hover:underline', 'class' => 'inline-flex items-center hover:underline',
'width' => 420, 'width' => 420,
'height' => 620, 'height' => 620,
'title' => lang('Post.favourites', [ 'title' => lang('Post.favourites', [
'numberOfFavourites' => $post->favourites_count, 'numberOfFavourites' => $post->favourites_count,
]), ]),
], ],
) ?> ) ?>
</footer> </footer>

View File

@ -1,88 +1,91 @@
<footer class="px-6 py-3"> <footer class="px-6 py-3">
<form action="<?= route_to( <form action="<?= route_to(
'post-attempt-action', 'post-attempt-action',
interact_as_actor()->username, interact_as_actor()
$post->id, ->username,
) ?>" method="POST" class="flex justify-around"> $post->id,
) ?>" method="POST" class="flex justify-around">
<?= csrf_field() ?> <?= csrf_field() ?>
<?= anchor( <?= anchor(
route_to('post', $podcast->handle, $post->id), route_to('post', $podcast->handle, $post->id),
icon('chat', 'text-2xl mr-1 text-gray-400') . $post->replies_count, icon('chat', 'text-2xl mr-1 text-gray-400') . $post->replies_count,
[ [
'class' => 'inline-flex items-center hover:underline', 'class' => 'inline-flex items-center hover:underline',
'title' => lang('Post.replies', [ 'title' => lang('Post.replies', [
'numberOfReplies' => $post->replies_count, 'numberOfReplies' => $post->replies_count,
]), ]),
], ],
) ?> ) ?>
<button type="submit" name="action" value="reblog" class="inline-flex items-center hover:underline" title="<?= lang( <button type="submit" name="action" value="reblog" class="inline-flex items-center hover:underline" title="<?= lang(
'Post.reblogs', 'Post.reblogs',
[ [
'numberOfReblogs' => $post->reblogs_count, 'numberOfReblogs' => $post->reblogs_count,
], ],
) ?>"><?= icon('repeat', 'text-2xl mr-1 text-gray-400') . ) ?>"><?= icon('repeat', 'text-2xl mr-1 text-gray-400') .
$post->reblogs_count ?></button> $post->reblogs_count ?></button>
<button type="submit" name="action" value="favourite" class="inline-flex items-center hover:underline" title="<?= lang( <button type="submit" name="action" value="favourite" class="inline-flex items-center hover:underline" title="<?= lang(
'Post.favourites', 'Post.favourites',
[ [
'numberOfFavourites' => $post->favourites_count, 'numberOfFavourites' => $post->favourites_count,
], ],
) ?>"><?= icon('heart', 'text-2xl mr-1 text-gray-400') . ) ?>"><?= icon('heart', 'text-2xl mr-1 text-gray-400') .
$post->favourites_count ?></button> $post->favourites_count ?></button>
<button id="<?= $post->id . <button id="<?= $post->id .
'-more-dropdown' ?>" type="button" class="px-2 py-1 text-2xl text-gray-500 outline-none focus:ring" data-dropdown="button" data-dropdown-target="<?= $post->id . '-more-dropdown' ?>" type="button" class="px-2 py-1 text-2xl text-gray-500 outline-none focus:ring" data-dropdown="button" data-dropdown-target="<?= $post->id .
'-more-dropdown-menu' ?>" aria-label="<?= lang( '-more-dropdown-menu' ?>" aria-label="<?= lang(
'Common.more', 'Common.more',
) ?>" aria-haspopup="true" aria-expanded="false"><?= icon('more') ?> ) ?>" aria-haspopup="true" aria-expanded="false"><?= icon('more') ?>
</button> </button>
</form> </form>
<nav id="<?= $post->id . <nav id="<?= $post->id .
'-more-dropdown-menu' ?>" class="flex flex-col py-2 text-sm bg-white border rounded-lg shadow" aria-labelledby="<?= $post->id . '-more-dropdown-menu' ?>" class="flex flex-col py-2 text-sm bg-white border rounded-lg shadow" aria-labelledby="<?= $post->id .
'-more-dropdown' ?>" data-dropdown="menu" data-dropdown-placement="bottom"> '-more-dropdown' ?>" data-dropdown="menu" data-dropdown-placement="bottom">
<?= anchor( <?= anchor(
route_to('post', $podcast->handle, $post->id), route_to('post', $podcast->handle, $post->id),
lang('Post.expand'), lang('Post.expand'),
[ [
'class' => 'px-4 py-1 hover:bg-gray-100', 'class' => 'px-4 py-1 hover:bg-gray-100',
], ],
) ?> ) ?>
<form action="<?= route_to( <form action="<?= route_to(
'post-attempt-block-actor', 'post-attempt-block-actor',
interact_as_actor()->username, interact_as_actor()
$post->id, ->username,
) ?>" method="POST"> $post->id,
) ?>" method="POST">
<?= csrf_field() ?> <?= csrf_field() ?>
<button class="w-full px-4 py-1 text-left hover:bg-gray-100"><?= lang( <button class="w-full px-4 py-1 text-left hover:bg-gray-100"><?= lang(
'Post.block_actor', 'Post.block_actor',
[ [
'actorUsername' => $post->actor->username, 'actorUsername' => $post->actor->username,
], ],
) ?></button> ) ?></button>
</form> </form>
<form action="<?= route_to( <form action="<?= route_to(
'post-attempt-block-domain', 'post-attempt-block-domain',
interact_as_actor()->username, interact_as_actor()
$post->id, ->username,
) ?>" method="POST"> $post->id,
) ?>" method="POST">
<?= csrf_field() ?> <?= csrf_field() ?>
<button class="w-full px-4 py-1 text-left hover:bg-gray-100"><?= lang( <button class="w-full px-4 py-1 text-left hover:bg-gray-100"><?= lang(
'Post.block_domain', 'Post.block_domain',
[ [
'actorDomain' => $post->actor->domain, 'actorDomain' => $post->actor->domain,
], ],
) ?></button> ) ?></button>
</form> </form>
<?php if ($post->actor->is_local): ?> <?php if ($post->actor->is_local): ?>
<hr class="my-2" /> <hr class="my-2" />
<form action="<?= route_to( <form action="<?= route_to(
'post-attempt-delete', 'post-attempt-delete',
$post->actor->username, $post->actor->username,
$post->id, $post->id,
) ?>" method="POST"> ) ?>" method="POST">
<?= csrf_field() ?> <?= csrf_field() ?>
<button class="w-full px-4 py-1 font-semibold text-left text-red-600 hover:bg-gray-100"><?= lang( <button class="w-full px-4 py-1 font-semibold text-left text-red-600 hover:bg-gray-100"><?= lang(
'Post.delete', 'Post.delete',
) ?></button> ) ?></button>
</form> </form>
<?php endif; ?> <?php endif; ?>
</nav> </nav>

View File

@ -1,17 +1,17 @@
<article class="relative z-10 w-full bg-white shadow rounded-2xl"> <article class="relative z-10 w-full bg-white shadow rounded-2xl">
<header class="flex px-6 py-4"> <header class="flex px-6 py-4">
<img src="<?= $post->actor <img src="<?= $post->actor
->avatar_image_url ?>" alt="<?= $post->actor->display_name ?>" class="w-12 h-12 mr-4 rounded-full" /> ->avatar_image_url ?>" alt="<?= $post->actor->display_name ?>" class="w-12 h-12 mr-4 rounded-full" />
<div class="flex flex-col min-w-0"> <div class="flex flex-col min-w-0">
<a href="<?= $post->actor <a href="<?= $post->actor
->uri ?>" class="flex items-baseline hover:underline" <?= $post ->uri ?>" class="flex items-baseline hover:underline" <?= $post
->actor->is_local ->actor->is_local
? '' ? ''
: 'target="_blank" rel="noopener noreferrer"' ?>> : 'target="_blank" rel="noopener noreferrer"' ?>>
<span class="mr-2 font-semibold truncate"><?= $post->actor <span class="mr-2 font-semibold truncate"><?= $post->actor
->display_name ?></span> ->display_name ?></span>
<span class="text-sm text-gray-500 truncate">@<?= $post->actor <span class="text-sm text-gray-500 truncate">@<?= $post->actor
->username . ->username .
($post->actor->is_local ($post->actor->is_local
? '' ? ''
: '@' . $post->actor->domain) ?></span> : '@' . $post->actor->domain) ?></span>

View File

@ -4,7 +4,9 @@
<div class="px-6 pt-8 pb-4 bg-gray-50"> <div class="px-6 pt-8 pb-4 bg-gray-50">
<?= anchor_popup( <?= anchor_popup(
route_to('post-remote-action', $podcast->handle, $post->id, 'reply'), route_to('post-remote-action', $podcast->handle, $post->id, 'reply'),
lang('Post.reply_to', ['actorUsername' => $post->actor->username]), lang('Post.reply_to', [
'actorUsername' => $post->actor->username,
]),
[ [
'class' => 'class' =>
'text-center justify-center font-semibold rounded-full shadow relative z-10 px-4 py-2 w-full bg-rose-600 text-white inline-flex items-center hover:bg-rose-700', 'text-center justify-center font-semibold rounded-full shadow relative z-10 px-4 py-2 w-full bg-rose-600 text-white inline-flex items-center hover:bg-rose-700',
@ -17,7 +19,9 @@
<?php if ($post->has_replies): ?> <?php if ($post->has_replies): ?>
<?php foreach ($post->replies as $reply): ?> <?php foreach ($post->replies as $reply): ?>
<?= view('podcast/_partials/reply', ['reply' => $reply]) ?> <?= view('podcast/_partials/reply', [
'reply' => $reply,
]) ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?> <?php endif; ?>
</div> </div>

View File

@ -11,31 +11,34 @@
->display_name ?>" class="w-12 h-12 mr-4 rounded-full ring-gray-50 ring-2" /> ->display_name ?>" class="w-12 h-12 mr-4 rounded-full ring-gray-50 ring-2" />
<div class="flex flex-col flex-1"> <div class="flex flex-col flex-1">
<?= form_textarea( <?= form_textarea(
[ [
'id' => 'message', 'id' => 'message',
'name' => 'message', 'name' => 'message',
'class' => 'form-textarea mb-4 w-full', 'class' => 'form-textarea mb-4 w-full',
'required' => 'required', 'required' => 'required',
'placeholder' => lang('Post.form.reply_to_placeholder', [ 'placeholder' => lang('Post.form.reply_to_placeholder', [
'actorUsername' => $post->actor->username, 'actorUsername' => $post->actor->username,
]), ]),
], ],
old('message', '', false), old('message', '', false),
[ [
'rows' => 1, 'rows' => 1,
], ],
) ?> ) ?>
<?= button( <?= button(
lang('Post.form.submit_reply'), lang('Post.form.submit_reply'),
'', '',
['variant' => 'primary', 'size' => 'small'], [
[ 'variant' => 'primary',
'type' => 'submit', 'size' => 'small',
'class' => 'self-end', ],
'name' => 'action', [
'value' => 'reply', 'type' => 'submit',
], 'class' => 'self-end',
) ?> 'name' => 'action',
'value' => 'reply',
],
) ?>
</div> </div>
<?= form_close() ?> <?= form_close() ?>

View File

@ -1,11 +1,13 @@
<?php if ($preview_card->type === 'image'): ?> <?php declare(strict_types=1);
if ($preview_card->type === 'image'): ?>
<a href="<?= $preview_card->url ?>" class="flex flex-col bg-gray-100" target="_blank" rel="noopener noreferrer"> <a href="<?= $preview_card->url ?>" class="flex flex-col bg-gray-100" target="_blank" rel="noopener noreferrer">
<?php if ($preview_card->image): ?> <?php if ($preview_card->image): ?>
<div class="relative group"> <div class="relative group">
<?= icon( <?= icon(
'external-link', 'external-link',
'absolute inset-0 m-auto text-6xl bg-pine-800 ring-4 ring-white bg-opacity-50 group-hover:bg-opacity-75 text-white rounded-full p-2', 'absolute inset-0 m-auto text-6xl bg-pine-800 ring-4 ring-white bg-opacity-50 group-hover:bg-opacity-75 text-white rounded-full p-2',
) ?> ) ?>
<img src="<?= $preview_card->image ?>" alt="<?= $preview_card->title ?>" class="object-cover w-full h-80" /> <img src="<?= $preview_card->image ?>" alt="<?= $preview_card->title ?>" class="object-cover w-full h-80" />
</div> </div>
<?php endif; ?> <?php endif; ?>
@ -19,9 +21,9 @@
<?php if ($preview_card->image): ?> <?php if ($preview_card->image): ?>
<div class="relative group"> <div class="relative group">
<?= icon( <?= icon(
'play', 'play',
'absolute inset-0 m-auto text-6xl bg-pine-800 ring-4 ring-white bg-opacity-50 group-hover:bg-opacity-75 text-white rounded-full p-2', 'absolute inset-0 m-auto text-6xl bg-pine-800 ring-4 ring-white bg-opacity-50 group-hover:bg-opacity-75 text-white rounded-full p-2',
) ?> ) ?>
<img class="object-cover w-full h-80" src="<?= $preview_card->image ?>" alt="<?= $preview_card->title ?>" /> <img class="object-cover w-full h-80" src="<?= $preview_card->image ?>" alt="<?= $preview_card->title ?>" />
</div> </div>
<?php endif; ?> <?php endif; ?>

View File

@ -1,8 +1,8 @@
<article class="relative z-10 w-full bg-white shadow rounded-2xl"> <article class="relative z-10 w-full bg-white shadow rounded-2xl">
<p class="inline-flex px-6 pt-4 text-xs text-gray-700"><?= icon( <p class="inline-flex px-6 pt-4 text-xs text-gray-700"><?= icon(
'repeat', 'repeat',
'text-lg mr-2 text-gray-400', 'text-lg mr-2 text-gray-400',
) . ) .
lang('Post.actor_shared', [ lang('Post.actor_shared', [
'actor' => $post->actor->display_name, 'actor' => $post->actor->display_name,
]) ?></p> ]) ?></p>
@ -11,14 +11,14 @@
->avatar_image_url ?>" alt="<?= $post->display_name ?>" class="w-12 h-12 mr-4 rounded-full" /> ->avatar_image_url ?>" alt="<?= $post->display_name ?>" class="w-12 h-12 mr-4 rounded-full" />
<div class="flex flex-col min-w-0"> <div class="flex flex-col min-w-0">
<a href="<?= $post->actor <a href="<?= $post->actor
->uri ?>" class="flex items-baseline hover:underline" <?= $post ->uri ?>" class="flex items-baseline hover:underline" <?= $post
->actor->is_local ->actor->is_local
? '' ? ''
: 'target="_blank" rel="noopener noreferrer"' ?>> : 'target="_blank" rel="noopener noreferrer"' ?>>
<span class="mr-2 font-semibold truncate"><?= $post->actor <span class="mr-2 font-semibold truncate"><?= $post->actor
->display_name ?></span> ->display_name ?></span>
<span class="text-sm text-gray-500 truncate">@<?= $post->actor <span class="text-sm text-gray-500 truncate">@<?= $post->actor
->username . ->username .
($post->actor->is_local ($post->actor->is_local
? '' ? ''
: '@' . $post->actor->domain) ?></span> : '@' . $post->actor->domain) ?></span>

View File

@ -1,8 +1,8 @@
<article class="relative z-10 w-full bg-white shadow rounded-2xl"> <article class="relative z-10 w-full bg-white shadow rounded-2xl">
<p class="inline-flex px-6 pt-4 text-xs text-gray-700"><?= icon( <p class="inline-flex px-6 pt-4 text-xs text-gray-700"><?= icon(
'repeat', 'repeat',
'text-lg mr-2 text-gray-400', 'text-lg mr-2 text-gray-400',
) . ) .
lang('Post.actor_shared', [ lang('Post.actor_shared', [
'actor' => $post->actor->display_name, 'actor' => $post->actor->display_name,
]) ?></p> ]) ?></p>
@ -11,14 +11,14 @@
->avatar_image_url ?>" alt="<?= $post->display_name ?>" class="w-12 h-12 mr-4 rounded-full" /> ->avatar_image_url ?>" alt="<?= $post->display_name ?>" class="w-12 h-12 mr-4 rounded-full" />
<div class="flex flex-col min-w-0"> <div class="flex flex-col min-w-0">
<a href="<?= $post->actor <a href="<?= $post->actor
->uri ?>" class="flex items-baseline hover:underline" <?= $post ->uri ?>" class="flex items-baseline hover:underline" <?= $post
->actor->is_local ->actor->is_local
? '' ? ''
: 'target="_blank" rel="noopener noreferrer"' ?>> : 'target="_blank" rel="noopener noreferrer"' ?>>
<span class="mr-2 font-semibold truncate"><?= $post->actor <span class="mr-2 font-semibold truncate"><?= $post->actor
->display_name ?></span> ->display_name ?></span>
<span class="text-sm text-gray-500 truncate">@<?= $post->actor <span class="text-sm text-gray-500 truncate">@<?= $post->actor
->username . ->username .
($post->actor->is_local ($post->actor->is_local
? '' ? ''
: '@' . $post->actor->domain) ?></span> : '@' . $post->actor->domain) ?></span>

View File

@ -4,12 +4,12 @@
<div class="flex flex-col flex-1 min-w-0"> <div class="flex flex-col flex-1 min-w-0">
<header class="flex items-center mb-2"> <header class="flex items-center mb-2">
<a href="<?= $reply->actor <a href="<?= $reply->actor
->uri ?>" class="mr-2 text-base font-semibold truncate hover:underline" <?= $reply ->uri ?>" class="mr-2 text-base font-semibold truncate hover:underline" <?= $reply
->actor->is_local ->actor->is_local
? '' ? ''
: 'target="_blank" rel="noopener noreferrer"' ?>><?= $reply->actor : 'target="_blank" rel="noopener noreferrer"' ?>><?= $reply->actor
->display_name ?><span class="ml-1 text-sm font-normal text-gray-600">@<?= $reply ->display_name ?><span class="ml-1 text-sm font-normal text-gray-600">@<?= $reply
->actor->username . ->actor->username .
($reply->actor->is_local ? '' : '@' . $reply->actor->domain) ?></span></a> ($reply->actor->is_local ? '' : '@' . $reply->actor->domain) ?></span></a>
<?= relative_time($post->published_at, 'flex-shrink-0 ml-auto text-xs text-gray-600') ?> <?= relative_time($post->published_at, 'flex-shrink-0 ml-auto text-xs text-gray-600') ?>
</header> </header>

View File

@ -1,36 +1,36 @@
<footer class="mt-2 space-x-6 text-sm"> <footer class="mt-2 space-x-6 text-sm">
<?= anchor( <?= anchor(
route_to('post', $podcast->handle, $reply->id), route_to('post', $podcast->handle, $reply->id),
icon('chat', 'text-xl mr-1 text-gray-400') . $reply->replies_count, icon('chat', 'text-xl mr-1 text-gray-400') . $reply->replies_count,
[ [
'class' => 'inline-flex items-center hover:underline', 'class' => 'inline-flex items-center hover:underline',
'title' => lang('Post.replies', [ 'title' => lang('Post.replies', [
'numberOfReplies' => $reply->replies_count, 'numberOfReplies' => $reply->replies_count,
]), ]),
], ],
) ?> ) ?>
<?= anchor_popup( <?= anchor_popup(
route_to('post-remote-action', $podcast->handle, $reply->id, 'reblog'), route_to('post-remote-action', $podcast->handle, $reply->id, 'reblog'),
icon('repeat', 'text-xl mr-1 text-gray-400') . $reply->reblogs_count, icon('repeat', 'text-xl mr-1 text-gray-400') . $reply->reblogs_count,
[ [
'class' => 'inline-flex items-center hover:underline', 'class' => 'inline-flex items-center hover:underline',
'width' => 420, 'width' => 420,
'height' => 620, 'height' => 620,
'title' => lang('Post.reblogs', [ 'title' => lang('Post.reblogs', [
'numberOfReblogs' => $reply->reblogs_count, 'numberOfReblogs' => $reply->reblogs_count,
]), ]),
], ],
) ?> ) ?>
<?= anchor_popup( <?= anchor_popup(
route_to('post-remote-action', $podcast->handle, $reply->id, 'favourite'), route_to('post-remote-action', $podcast->handle, $reply->id, 'favourite'),
icon('heart', 'text-xl mr-1 text-gray-400') . $reply->favourites_count, icon('heart', 'text-xl mr-1 text-gray-400') . $reply->favourites_count,
[ [
'class' => 'inline-flex items-center hover:underline', 'class' => 'inline-flex items-center hover:underline',
'width' => 420, 'width' => 420,
'height' => 620, 'height' => 620,
'title' => lang('Post.favourites', [ 'title' => lang('Post.favourites', [
'numberOfFavourites' => $reply->favourites_count, 'numberOfFavourites' => $reply->favourites_count,
]), ]),
], ],
) ?> ) ?>
</footer> </footer>

View File

@ -1,88 +1,91 @@
<footer class="mt-2 text-sm"> <footer class="mt-2 text-sm">
<form action="<?= route_to( <form action="<?= route_to(
'post-attempt-action', 'post-attempt-action',
interact_as_actor()->username, interact_as_actor()
$reply->id, ->username,
) ?>" method="POST" class="flex items-start"> $reply->id,
) ?>" method="POST" class="flex items-start">
<?= csrf_field() ?> <?= csrf_field() ?>
<?= anchor( <?= anchor(
route_to('post', $podcast->handle, $reply->id), route_to('post', $podcast->handle, $reply->id),
icon('chat', 'text-xl mr-1 text-gray-400') . $reply->replies_count, icon('chat', 'text-xl mr-1 text-gray-400') . $reply->replies_count,
[ [
'class' => 'inline-flex items-center mr-6 hover:underline', 'class' => 'inline-flex items-center mr-6 hover:underline',
'title' => lang('Post.replies', [ 'title' => lang('Post.replies', [
'numberOfReplies' => $reply->replies_count, 'numberOfReplies' => $reply->replies_count,
]), ]),
], ],
) ?> ) ?>
<button type="submit" name="action" value="reblog" class="inline-flex items-center mr-6 hover:underline" title="<?= lang( <button type="submit" name="action" value="reblog" class="inline-flex items-center mr-6 hover:underline" title="<?= lang(
'Post.reblogs', 'Post.reblogs',
[ [
'numberOfReblogs' => $reply->reblogs_count, 'numberOfReblogs' => $reply->reblogs_count,
], ],
) ?>"><?= icon('repeat', 'text-xl mr-1 text-gray-400') . ) ?>"><?= icon('repeat', 'text-xl mr-1 text-gray-400') .
$reply->reblogs_count ?></button> $reply->reblogs_count ?></button>
<button type="submit" name="action" value="favourite" class="inline-flex items-center mr-6 hover:underline" title="<?= lang( <button type="submit" name="action" value="favourite" class="inline-flex items-center mr-6 hover:underline" title="<?= lang(
'Post.favourites', 'Post.favourites',
[ [
'numberOfFavourites' => $reply->favourites_count, 'numberOfFavourites' => $reply->favourites_count,
], ],
) ?>"><?= icon('heart', 'text-xl mr-1 text-gray-400') . ) ?>"><?= icon('heart', 'text-xl mr-1 text-gray-400') .
$reply->favourites_count ?></button> $reply->favourites_count ?></button>
<button id="<?= $reply->id . <button id="<?= $reply->id .
'-more-dropdown' ?>" type="button" class="text-xl text-gray-500 outline-none focus:ring" data-dropdown="button" data-dropdown-target="<?= $reply->id . '-more-dropdown' ?>" type="button" class="text-xl text-gray-500 outline-none focus:ring" data-dropdown="button" data-dropdown-target="<?= $reply->id .
'-more-dropdown-menu' ?>" aria-label="<?= lang( '-more-dropdown-menu' ?>" aria-label="<?= lang(
'Common.more', 'Common.more',
) ?>" aria-haspopup="true" aria-expanded="false"><?= icon('more') ?> ) ?>" aria-haspopup="true" aria-expanded="false"><?= icon('more') ?>
</button> </button>
</form> </form>
<nav id="<?= $reply->id . <nav id="<?= $reply->id .
'-more-dropdown-menu' ?>" class="flex flex-col py-2 text-sm bg-white border rounded-lg shadow" aria-labelledby="<?= $reply->id . '-more-dropdown-menu' ?>" class="flex flex-col py-2 text-sm bg-white border rounded-lg shadow" aria-labelledby="<?= $reply->id .
'-more-dropdown' ?>" data-dropdown="menu" data-dropdown-placement="bottom"> '-more-dropdown' ?>" data-dropdown="menu" data-dropdown-placement="bottom">
<?= anchor( <?= anchor(
route_to('post', $podcast->handle, $reply->id), route_to('post', $podcast->handle, $reply->id),
lang('Post.expand'), lang('Post.expand'),
[ [
'class' => 'px-4 py-1 hover:bg-gray-100', 'class' => 'px-4 py-1 hover:bg-gray-100',
], ],
) ?> ) ?>
<form action="<?= route_to( <form action="<?= route_to(
'post-attempt-block-actor', 'post-attempt-block-actor',
interact_as_actor()->username, interact_as_actor()
$reply->id, ->username,
) ?>" method="POST"> $reply->id,
) ?>" method="POST">
<?= csrf_field() ?> <?= csrf_field() ?>
<button class="w-full px-4 py-1 text-left hover:bg-gray-100"><?= lang( <button class="w-full px-4 py-1 text-left hover:bg-gray-100"><?= lang(
'Post.block_actor', 'Post.block_actor',
[ [
'actorUsername' => $reply->actor->username, 'actorUsername' => $reply->actor->username,
], ],
) ?></button> ) ?></button>
</form> </form>
<form action="<?= route_to( <form action="<?= route_to(
'post-attempt-block-domain', 'post-attempt-block-domain',
interact_as_actor()->username, interact_as_actor()
$reply->id, ->username,
) ?>" method="POST"> $reply->id,
) ?>" method="POST">
<?= csrf_field() ?> <?= csrf_field() ?>
<button class="w-full px-4 py-1 text-left hover:bg-gray-100"><?= lang( <button class="w-full px-4 py-1 text-left hover:bg-gray-100"><?= lang(
'Post.block_domain', 'Post.block_domain',
[ [
'actorDomain' => $reply->actor->domain, 'actorDomain' => $reply->actor->domain,
], ],
) ?></button> ) ?></button>
</form> </form>
<?php if ($reply->actor->is_local): ?> <?php if ($reply->actor->is_local): ?>
<hr class="my-2" /> <hr class="my-2" />
<form action="<?= route_to( <form action="<?= route_to(
'post-attempt-delete', 'post-attempt-delete',
$reply->actor->username, $reply->actor->username,
$reply->id, $reply->id,
) ?>" method="POST"> ) ?>" method="POST">
<?= csrf_field() ?> <?= csrf_field() ?>
<button class="w-full px-4 py-1 font-semibold text-left text-red-600 hover:bg-gray-100"><?= lang( <button class="w-full px-4 py-1 font-semibold text-left text-red-600 hover:bg-gray-100"><?= lang(
'Post.delete', 'Post.delete',
) ?></button> ) ?></button>
</form> </form>
<?php endif; ?> <?php endif; ?>
</nav> </nav>

View File

@ -4,12 +4,12 @@
<div class="flex flex-col flex-1 min-w-0"> <div class="flex flex-col flex-1 min-w-0">
<header class="flex items-center mb-2"> <header class="flex items-center mb-2">
<a href="<?= $reply->actor <a href="<?= $reply->actor
->uri ?>" class="mr-2 text-base font-semibold truncate hover:underline" <?= $reply ->uri ?>" class="mr-2 text-base font-semibold truncate hover:underline" <?= $reply
->actor->is_local ->actor->is_local
? '' ? ''
: 'target="_blank" rel="noopener noreferrer"' ?>><?= $reply->actor : 'target="_blank" rel="noopener noreferrer"' ?>><?= $reply->actor
->display_name ?><span class="ml-1 text-sm font-normal text-gray-600">@<?= $reply ->display_name ?><span class="ml-1 text-sm font-normal text-gray-600">@<?= $reply
->actor->username . ->actor->username .
($reply->actor->is_local ? '' : '@' . $reply->actor->domain) ?></span></a> ($reply->actor->is_local ? '' : '@' . $reply->actor->domain) ?></span></a>
<?= relative_time($post->published_at, 'flex-shrink-0 ml-auto text-xs text-gray-600') ?> <?= relative_time($post->published_at, 'flex-shrink-0 ml-auto text-xs text-gray-600') ?>
</header> </header>

View File

@ -1,6 +1,6 @@
<aside id="main-sidebar" class="fixed top-0 right-0 flex flex-col items-start flex-shrink-0 w-64 h-screen px-6 py-4 overflow-y-auto transform translate-x-full lg:sticky lg:translate-x-0"> <aside id="main-sidebar" class="fixed top-0 right-0 flex flex-col items-start flex-shrink-0 w-64 h-screen px-6 py-4 overflow-y-auto transform translate-x-full lg:sticky lg:translate-x-0">
<?php if ( <?php if (
in_array(true, array_column($podcast->fundingPlatforms, 'is_visible')) in_array(true, array_column($podcast->fundingPlatforms, 'is_visible'), true)
): ?> ): ?>
<h2 class="mb-2 text-sm font-semibold"><?= lang( <h2 class="mb-2 text-sm font-semibold"><?= lang(
'Podcast.sponsor_title', 'Podcast.sponsor_title',
@ -13,7 +13,7 @@
<?php endif; ?> <?php endif; ?>
<?php if ( <?php if (
in_array(true, array_column($podcast->socialPlatforms, 'is_visible')) in_array(true, array_column($podcast->socialPlatforms, 'is_visible'), true)
): ?> ): ?>
<h2 class="mb-2 text-sm font-semibold"> <?= lang('Podcast.find_on', [ <h2 class="mb-2 text-sm font-semibold"> <?= lang('Podcast.find_on', [
'podcastTitle' => $podcast->title, 'podcastTitle' => $podcast->title,
@ -22,17 +22,17 @@
<?php foreach ($podcast->socialPlatforms as $socialPlatform): ?> <?php foreach ($podcast->socialPlatforms as $socialPlatform): ?>
<?php if ($socialPlatform->is_visible): ?> <?php if ($socialPlatform->is_visible): ?>
<?= anchor( <?= anchor(
$socialPlatform->link_url, $socialPlatform->link_url,
icon($socialPlatform->type . '/' . $socialPlatform->slug), icon($socialPlatform->type . '/' . $socialPlatform->slug),
[ [
'class' => 'text-2xl text-gray-500 hover:text-gray-700', 'class' => 'text-2xl text-gray-500 hover:text-gray-700',
'target' => '_blank', 'target' => '_blank',
'rel' => 'noopener noreferrer', 'rel' => 'noopener noreferrer',
'data-toggle' => 'tooltip', 'data-toggle' => 'tooltip',
'data-placement' => 'bottom', 'data-placement' => 'bottom',
'title' => $socialPlatform->label, 'title' => $socialPlatform->label,
], ],
) ?> ) ?>
<?php endif; ?> <?php endif; ?>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
@ -52,21 +52,21 @@
<?php foreach ($podcast->podcastingPlatforms as $podcastingPlatform): ?> <?php foreach ($podcast->podcastingPlatforms as $podcastingPlatform): ?>
<?php if ($podcastingPlatform->is_visible): ?> <?php if ($podcastingPlatform->is_visible): ?>
<?= anchor( <?= anchor(
$podcastingPlatform->link_url, $podcastingPlatform->link_url,
icon( icon(
$podcastingPlatform->type . $podcastingPlatform->type .
'/' . '/' .
$podcastingPlatform->slug, $podcastingPlatform->slug,
), ),
[ [
'class' => 'text-2xl text-gray-500 hover:text-gray-700', 'class' => 'text-2xl text-gray-500 hover:text-gray-700',
'target' => '_blank', 'target' => '_blank',
'rel' => 'noopener noreferrer', 'rel' => 'noopener noreferrer',
'data-toggle' => 'tooltip', 'data-toggle' => 'tooltip',
'data-placement' => 'bottom', 'data-placement' => 'bottom',
'title' => $podcastingPlatform->label, 'title' => $podcastingPlatform->label,
], ],
) ?> ) ?>
<?php endif; ?> <?php endif; ?>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>

View File

@ -15,28 +15,31 @@
<meta property="og:site_name" content="<?= $podcast->title ?>" /> <meta property="og:site_name" content="<?= $podcast->title ?>" />
<meta property="og:url" content="<?= current_url() ?>" /> <meta property="og:url" content="<?= current_url() ?>" />
<meta property="og:image" content="<?= $podcast->image->large_url ?>" /> <meta property="og:image" content="<?= $podcast->image->large_url ?>" />
<meta property="og:image:width" content="<?= config('Images')->largeSize ?>" /> <meta property="og:image:width" content="<?= config('Images')
<meta property="og:image:height" content="<?= config('Images')->largeSize ?>" /> ->largeSize ?>" />
<meta property="og:image:height" content="<?= config('Images')
->largeSize ?>" />
<meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:card" content="summary_large_image" />
<?= service('vite')->asset('styles/index.css', 'css') ?> <?= service('vite')
->asset('styles/index.css', 'css') ?>
<?= $this->endSection() ?> <?= $this->endSection() ?>
<?= $this->section('content') ?> <?= $this->section('content') ?>
<nav class="sticky z-20 flex justify-center pt-2 text-lg sm:top-0 top-12 bg-pine-50"> <nav class="sticky z-20 flex justify-center pt-2 text-lg sm:top-0 top-12 bg-pine-50">
<a href="<?= route_to( <a href="<?= route_to(
'podcast-activity', 'podcast-activity',
$podcast->handle, $podcast->handle,
) ?>" class="px-4 py-1 mr-8 font-semibold border-b-4 text-pine-800 border-pine-500"><?= lang( ) ?>" class="px-4 py-1 mr-8 font-semibold border-b-4 text-pine-800 border-pine-500"><?= lang(
'Podcast.activity', 'Podcast.activity',
) ?></a> ) ?></a>
<a href="<?= route_to( <a href="<?= route_to(
'podcast-episodes', 'podcast-episodes',
$podcast->handle, $podcast->handle,
) ?>" class="px-4 py-1 rounded-full hover:bg-pine-100"><?= lang( ) ?>" class="px-4 py-1 rounded-full hover:bg-pine-100"><?= lang(
'Podcast.episodes', 'Podcast.episodes',
) ?></a> ) ?></a>
</nav> </nav>
<section class="max-w-2xl px-6 py-8 mx-auto space-y-8"> <section class="max-w-2xl px-6 py-8 mx-auto space-y-8">
<?php foreach ($posts as $post): ?> <?php foreach ($posts as $post): ?>
@ -45,7 +48,9 @@
'post' => $post->reblog_of_post, 'post' => $post->reblog_of_post,
]) ?> ]) ?>
<?php else: ?> <?php else: ?>
<?= view('podcast/_partials/post', ['post' => $post]) ?> <?= view('podcast/_partials/post', [
'post' => $post,
]) ?>
<?php endif; ?> <?php endif; ?>
<?php endforeach; ?> <?php endforeach; ?>
</section> </section>

View File

@ -15,28 +15,31 @@
<meta property="og:site_name" content="<?= $podcast->title ?>" /> <meta property="og:site_name" content="<?= $podcast->title ?>" />
<meta property="og:url" content="<?= current_url() ?>" /> <meta property="og:url" content="<?= current_url() ?>" />
<meta property="og:image" content="<?= $podcast->image->large_url ?>" /> <meta property="og:image" content="<?= $podcast->image->large_url ?>" />
<meta property="og:image:width" content="<?= config('Images')->largeSize ?>" /> <meta property="og:image:width" content="<?= config('Images')
<meta property="og:image:height" content="<?= config('Images')->largeSize ?>" /> ->largeSize ?>" />
<meta property="og:image:height" content="<?= config('Images')
->largeSize ?>" />
<meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:card" content="summary_large_image" />
<?= service('vite')->asset('styles/index.css', 'css') ?> <?= service('vite')
->asset('styles/index.css', 'css') ?>
<?= $this->endSection() ?> <?= $this->endSection() ?>
<?= $this->section('content') ?> <?= $this->section('content') ?>
<nav class="sticky z-20 flex justify-center pt-2 text-lg top-12 sm:top-0 bg-pine-50"> <nav class="sticky z-20 flex justify-center pt-2 text-lg top-12 sm:top-0 bg-pine-50">
<a href="<?= route_to( <a href="<?= route_to(
'podcast-activity', 'podcast-activity',
$podcast->handle, $podcast->handle,
) ?>" class="px-4 py-1 mr-8 font-semibold border-b-4 text-pine-800 border-pine-500"><?= lang( ) ?>" class="px-4 py-1 mr-8 font-semibold border-b-4 text-pine-800 border-pine-500"><?= lang(
'Podcast.activity', 'Podcast.activity',
) ?></a> ) ?></a>
<a href="<?= route_to( <a href="<?= route_to(
'podcast-episodes', 'podcast-episodes',
$podcast->handle, $podcast->handle,
) ?>" class="px-4 py-1 rounded-full hover:bg-pine-100"><?= lang( ) ?>" class="px-4 py-1 rounded-full hover:bg-pine-100"><?= lang(
'Podcast.episodes', 'Podcast.episodes',
) ?></a> ) ?></a>
</nav> </nav>
<section class="max-w-2xl px-6 py-8 mx-auto"> <section class="max-w-2xl px-6 py-8 mx-auto">
@ -49,7 +52,7 @@
<img src="<?= interact_as_actor() <img src="<?= interact_as_actor()
->avatar_image_url ?>" alt="<?= interact_as_actor() ->avatar_image_url ?>" alt="<?= interact_as_actor()
->display_name ?>" class="w-12 h-12 mr-4 rounded-full" /> ->display_name ?>" class="w-12 h-12 mr-4 rounded-full" />
<div class="flex flex-col flex-1 min-w-0"> <div class="flex flex-col flex-1 min-w-0">
<?= form_textarea( <?= form_textarea(
[ [
@ -60,7 +63,9 @@
'placeholder' => lang('Post.form.message_placeholder'), 'placeholder' => lang('Post.form.message_placeholder'),
], ],
old('message', '', false), old('message', '', false),
['rows' => 2], [
'rows' => 2,
],
) ?> ) ?>
<?= form_input([ <?= form_input([
'id' => 'episode_url', 'id' => 'episode_url',
@ -77,8 +82,14 @@
<?= button( <?= button(
lang('Post.form.submit'), lang('Post.form.submit'),
'', '',
['variant' => 'primary', 'size' => 'small'], [
['type' => 'submit', 'class' => 'self-end'], 'variant' => 'primary',
'size' => 'small',
],
[
'type' => 'submit',
'class' => 'self-end',
],
) ?> ) ?>
</div> </div>
<?= form_close() ?> <?= form_close() ?>
@ -91,7 +102,9 @@
'post' => $post->reblog_of_post, 'post' => $post->reblog_of_post,
]) ?> ]) ?>
<?php else: ?> <?php else: ?>
<?= view('podcast/_partials/post_authenticated', ['post' => $post]) ?> <?= view('podcast/_partials/post_authenticated', [
'post' => $post,
]) ?>
<?php endif; ?> <?php endif; ?>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>

View File

@ -22,9 +22,9 @@
<nav class="py-3"> <nav class="py-3">
<a href="<?= route_to('episode', $podcast->handle, $episode->slug) ?>" <a href="<?= route_to('episode', $podcast->handle, $episode->slug) ?>"
class="inline-flex items-center px-4 py-2 text-sm"><?= icon( class="inline-flex items-center px-4 py-2 text-sm"><?= icon(
'arrow-left', 'arrow-left',
'mr-2 text-lg', 'mr-2 text-lg',
) . ) .
lang('Comment.back_to_episode', [ lang('Comment.back_to_episode', [
'episodeTitle' => $episode->title, 'episodeTitle' => $episode->title,
]) ?></a> ]) ?></a>

View File

@ -2,13 +2,14 @@
<?= $this->section('meta-tags') ?> <?= $this->section('meta-tags') ?>
<title><?= lang('Comment.title', [ <title><?= lang('Comment.title', [
'actorDisplayName' => $comment->actor->display_name, 'actorDisplayName' => $comment->actor->display_name,
'episodeTitle' => $episode->title 'episodeTitle' => $episode->title,
]) ?></title> ]) ?></title>
<meta name="description" content="<?= $comment->message ?>"/> <meta name="description" content="<?= $comment->message ?>"/>
<meta property="og:title" content="<?= lang('Comment.title', [ <meta property="og:title" content="<?= lang('Comment.title', [
'actorDisplayName' => $comment->actor->display_name, 'actorDisplayName' => $comment->actor->display_name,
'episodeTitle' => $episode->title ]) ?>"/> 'episodeTitle' => $episode->title,
]) ?>"/>
<meta property="og:locale" content="<?= service( <meta property="og:locale" content="<?= service(
'request', 'request',
)->getLocale() ?>" /> )->getLocale() ?>" />
@ -23,17 +24,17 @@
<nav class="py-3"> <nav class="py-3">
<a href="<?= route_to('episode', $podcast->handle, $episode->slug) ?>" <a href="<?= route_to('episode', $podcast->handle, $episode->slug) ?>"
class="inline-flex items-center px-4 py-2 text-sm"><?= icon( class="inline-flex items-center px-4 py-2 text-sm"><?= icon(
'arrow-left', 'arrow-left',
'mr-2 text-lg', 'mr-2 text-lg',
) . ) .
lang('Comment.back_to_episode', [ lang('Comment.back_to_episode', [
'episodeTitle' => $episode->title, 'episodeTitle' => $episode->title,
]) ?></a> ]) ?></a>
</nav> </nav>
<div class="pb-12"> <div class="pb-12">
<?= $this->include( <?= $this->include(
'podcast/_partials/comment_with_replies_authenticated', 'podcast/_partials/comment_with_replies_authenticated',
) ?> ) ?>
</div> </div>
</div> </div>

View File

@ -12,19 +12,21 @@
<meta property="og:site_name" content="<?= $podcast->title ?>" /> <meta property="og:site_name" content="<?= $podcast->title ?>" />
<meta property="og:url" content="<?= current_url() ?>" /> <meta property="og:url" content="<?= current_url() ?>" />
<meta property="og:image" content="<?= $episode->image->large_url ?>" /> <meta property="og:image" content="<?= $episode->image->large_url ?>" />
<meta property="og:image:width" content="<?= config('Images')->largeSize ?>" /> <meta property="og:image:width" content="<?= config('Images')
<meta property="og:image:height" content="<?= config('Images')->largeSize ?>" /> ->largeSize ?>" />
<meta property="og:image:height" content="<?= config('Images')
->largeSize ?>" />
<meta property="og:description" content="$description" /> <meta property="og:description" content="$description" />
<meta property="article:published_time" content="<?= $episode->published_at ?>" /> <meta property="article:published_time" content="<?= $episode->published_at ?>" />
<meta property="article:modified_time" content="<?= $episode->updated_at ?>" /> <meta property="article:modified_time" content="<?= $episode->updated_at ?>" />
<meta property="og:audio" content="<?= $episode->audio_file_opengraph_url ?>" /> <meta property="og:audio" content="<?= $episode->audio_file_opengraph_url ?>" />
<meta property="og:audio:type" content="<?= $episode->audio_file_mimetype ?>" /> <meta property="og:audio:type" content="<?= $episode->audio_file_mimetype ?>" />
<link rel="alternate" type="application/json+oembed" href="<?= base_url( <link rel="alternate" type="application/json+oembed" href="<?= base_url(
route_to('episode-oembed-json', $podcast->handle, $episode->slug), route_to('episode-oembed-json', $podcast->handle, $episode->slug),
) ?>" title="<?= $episode->title ?> oEmbed json" /> ) ?>" title="<?= $episode->title ?> oEmbed json" />
<link rel="alternate" type="text/xml+oembed" href="<?= base_url( <link rel="alternate" type="text/xml+oembed" href="<?= base_url(
route_to('episode-oembed-xml', $podcast->handle, $episode->slug), route_to('episode-oembed-xml', $podcast->handle, $episode->slug),
) ?>" title="<?= $episode->title ?> oEmbed xml" /> ) ?>" title="<?= $episode->title ?> oEmbed xml" />
<meta name="twitter:title" content="<?= $episode->title ?>" /> <meta name="twitter:title" content="<?= $episode->title ?>" />
<meta name="twitter:description" content="<?= $episode->description ?>" /> <meta name="twitter:description" content="<?= $episode->description ?>" />
<meta name="twitter:image" content="<?= $episode->image->large_url ?>" /> <meta name="twitter:image" content="<?= $episode->image->large_url ?>" />
@ -32,8 +34,8 @@
<meta property="twitter:audio:partner" content="<?= $podcast->publisher ?>" /> <meta property="twitter:audio:partner" content="<?= $podcast->publisher ?>" />
<meta property="twitter:audio:artist_name" content="<?= $podcast->owner_name ?>" /> <meta property="twitter:audio:artist_name" content="<?= $podcast->owner_name ?>" />
<meta name="twitter:player" content="<?= $episode->getEmbeddablePlayerUrl( <meta name="twitter:player" content="<?= $episode->getEmbeddablePlayerUrl(
'light', 'light',
) ?>" /> ) ?>" />
<meta name="twitter:player:width" content="600" /> <meta name="twitter:player:width" content="600" />
<meta name="twitter:player:height" content="200" /> <meta name="twitter:player:height" content="200" />
<?= $this->endSection() ?> <?= $this->endSection() ?>
@ -44,20 +46,22 @@
'podcast-episodes', 'podcast-episodes',
$podcast->handle, $podcast->handle,
) ?>" class="inline-flex items-center px-4 py-2 mb-2 text-sm"><?= icon( ) ?>" class="inline-flex items-center px-4 py-2 mb-2 text-sm"><?= icon(
'arrow-left', 'arrow-left',
'mr-2 text-lg', 'mr-2 text-lg',
) . lang('Episode.back_to_episodes', ['podcast' => $podcast->title]) ?></a> ) . lang('Episode.back_to_episodes', [
'podcast' => $podcast->title,
]) ?></a>
<header class="flex flex-col px-6 mb-4 rounded-b-xl"> <header class="flex flex-col px-6 mb-4 rounded-b-xl">
<div class="flex flex-wrap items-start"> <div class="flex flex-wrap items-start">
<img src="<?= $episode->image <img src="<?= $episode->image
->medium_url ?>" alt="<?= $episode->title ?>" class="mb-4 mr-6 rounded-xl w-52" /> ->medium_url ?>" alt="<?= $episode->title ?>" class="mb-4 mr-6 rounded-xl w-52" />
<div class="flex flex-col items-start flex-1 mb-4" style="min-width: 14rem"> <div class="flex flex-col items-start flex-1 mb-4" style="min-width: 14rem">
<h1 class="text-xl font-bold leading-none font-display line-clamp-2"><?= $episode->title ?></h1> <h1 class="text-xl font-bold leading-none font-display line-clamp-2"><?= $episode->title ?></h1>
<?= episode_numbering( <?= episode_numbering(
$episode->number, $episode->number,
$episode->season_number, $episode->season_number,
'text-gray-700', 'text-gray-700',
) ?> ) ?>
<div class="mb-4 text-xs"> <div class="mb-4 text-xs">
<?= relative_time($episode->published_at) ?> <?= relative_time($episode->published_at) ?>
<span class="mx-1"></span> <span class="mx-1"></span>
@ -85,12 +89,16 @@
<div class="tab-panels"> <div class="tab-panels">
<section id="comments" class="space-y-6 tab-panel"> <section id="comments" class="space-y-6 tab-panel">
<?php foreach ($episode->comments as $comment): ?> <?php foreach ($episode->comments as $comment): ?>
<?= view('podcast/_partials/comment', ['comment' => $comment]) ?> <?= view('podcast/_partials/comment', [
'comment' => $comment,
]) ?>
<?php endforeach; ?> <?php endforeach; ?>
</section> </section>
<section id="activity" class="space-y-8 tab-panel"> <section id="activity" class="space-y-8 tab-panel">
<?php foreach ($episode->posts as $post): ?> <?php foreach ($episode->posts as $post): ?>
<?= view('podcast/_partials/post', ['post' => $post]) ?> <?= view('podcast/_partials/post', [
'post' => $post,
]) ?>
<?php endforeach; ?> <?php endforeach; ?>
</section> </section>
<section id="description" class="prose tab-panel"> <section id="description" class="prose tab-panel">

View File

@ -12,19 +12,21 @@
<meta property="og:site_name" content="<?= $podcast->title ?>" /> <meta property="og:site_name" content="<?= $podcast->title ?>" />
<meta property="og:url" content="<?= current_url() ?>" /> <meta property="og:url" content="<?= current_url() ?>" />
<meta property="og:image" content="<?= $episode->image->large_url ?>" /> <meta property="og:image" content="<?= $episode->image->large_url ?>" />
<meta property="og:image:width" content="<?= config('Images')->largeSize ?>" /> <meta property="og:image:width" content="<?= config('Images')
<meta property="og:image:height" content="<?= config('Images')->largeSize ?>" /> ->largeSize ?>" />
<meta property="og:image:height" content="<?= config('Images')
->largeSize ?>" />
<meta property="og:description" content="$description" /> <meta property="og:description" content="$description" />
<meta property="article:published_time" content="<?= $episode->published_at ?>" /> <meta property="article:published_time" content="<?= $episode->published_at ?>" />
<meta property="article:modified_time" content="<?= $episode->updated_at ?>" /> <meta property="article:modified_time" content="<?= $episode->updated_at ?>" />
<meta property="og:audio" content="<?= $episode->audio_file_opengraph_url ?>" /> <meta property="og:audio" content="<?= $episode->audio_file_opengraph_url ?>" />
<meta property="og:audio:type" content="<?= $episode->audio_file_mimetype ?>" /> <meta property="og:audio:type" content="<?= $episode->audio_file_mimetype ?>" />
<link rel="alternate" type="application/json+oembed" href="<?= base_url( <link rel="alternate" type="application/json+oembed" href="<?= base_url(
route_to('episode-oembed-json', $podcast->handle, $episode->slug), route_to('episode-oembed-json', $podcast->handle, $episode->slug),
) ?>" title="<?= $episode->title ?> oEmbed json" /> ) ?>" title="<?= $episode->title ?> oEmbed json" />
<link rel="alternate" type="text/xml+oembed" href="<?= base_url( <link rel="alternate" type="text/xml+oembed" href="<?= base_url(
route_to('episode-oembed-xml', $podcast->handle, $episode->slug), route_to('episode-oembed-xml', $podcast->handle, $episode->slug),
) ?>" title="<?= $episode->title ?> oEmbed xml" /> ) ?>" title="<?= $episode->title ?> oEmbed xml" />
<meta name="twitter:title" content="<?= $episode->title ?>" /> <meta name="twitter:title" content="<?= $episode->title ?>" />
<meta name="twitter:description" content="<?= $episode->description ?>" /> <meta name="twitter:description" content="<?= $episode->description ?>" />
<meta name="twitter:image" content="<?= $episode->image->large_url ?>" /> <meta name="twitter:image" content="<?= $episode->image->large_url ?>" />
@ -32,8 +34,8 @@
<meta property="twitter:audio:partner" content="<?= $podcast->publisher ?>" /> <meta property="twitter:audio:partner" content="<?= $podcast->publisher ?>" />
<meta property="twitter:audio:artist_name" content="<?= $podcast->owner_name ?>" /> <meta property="twitter:audio:artist_name" content="<?= $podcast->owner_name ?>" />
<meta name="twitter:player" content="<?= $episode->getEmbeddablePlayerUrl( <meta name="twitter:player" content="<?= $episode->getEmbeddablePlayerUrl(
'light', 'light',
) ?>" /> ) ?>" />
<meta name="twitter:player:width" content="600" /> <meta name="twitter:player:width" content="600" />
<meta name="twitter:player:height" content="200" /> <meta name="twitter:player:height" content="200" />
<?= $this->endSection() ?> <?= $this->endSection() ?>
@ -44,20 +46,22 @@
'podcast-episodes', 'podcast-episodes',
$podcast->handle, $podcast->handle,
) ?>" class="inline-flex items-center px-4 py-2 mb-2 text-sm"><?= icon( ) ?>" class="inline-flex items-center px-4 py-2 mb-2 text-sm"><?= icon(
'arrow-left', 'arrow-left',
'mr-2 mb- text-lg', 'mr-2 mb- text-lg',
) . lang('Episode.back_to_episodes', ['podcast' => $podcast->title]) ?></a> ) . lang('Episode.back_to_episodes', [
'podcast' => $podcast->title,
]) ?></a>
<header class="flex flex-col px-6 mb-4 rounded-b-xl"> <header class="flex flex-col px-6 mb-4 rounded-b-xl">
<div class="flex flex-wrap items-start"> <div class="flex flex-wrap items-start">
<img src="<?= $episode->image <img src="<?= $episode->image
->medium_url ?>" alt="<?= $episode->title ?>" class="mb-4 mr-6 rounded-xl w-52" /> ->medium_url ?>" alt="<?= $episode->title ?>" class="mb-4 mr-6 rounded-xl w-52" />
<div class="flex flex-col items-start flex-1 mb-4" style="min-width: 14rem"> <div class="flex flex-col items-start flex-1 mb-4" style="min-width: 14rem">
<h1 class="text-xl font-bold leading-none font-display line-clamp-2"><?= $episode->title ?></h1> <h1 class="text-xl font-bold leading-none font-display line-clamp-2"><?= $episode->title ?></h1>
<?= episode_numbering( <?= episode_numbering(
$episode->number, $episode->number,
$episode->season_number, $episode->season_number,
'text-gray-700', 'text-gray-700',
) ?> ) ?>
<div class="mb-4 text-xs"> <div class="mb-4 text-xs">
<?= relative_time($episode->published_at) ?> <?= relative_time($episode->published_at) ?>
<span class="mx-1"></span> <span class="mx-1"></span>
@ -77,7 +81,7 @@
<label for="comments"><?= lang('Episode.comments') . '(' . $episode->comments_count . ')' ?></label> <label for="comments"><?= lang('Episode.comments') . '(' . $episode->comments_count . ')' ?></label>
<input type="radio" name="tabset" id="activity" aria-controls="activity" /> <input type="radio" name="tabset" id="activity" aria-controls="activity" />
<label for="activity"><?= lang('Episode.activity') . '('. $episode->posts_count .')' ?></label> <label for="activity"><?= lang('Episode.activity') . '(' . $episode->posts_count . ')' ?></label>
<input type="radio" name="tabset" id="description" aria-controls="description" /> <input type="radio" name="tabset" id="description" aria-controls="description" />
<label for="description"><?= lang('Episode.description') ?></label> <label for="description"><?= lang('Episode.description') ?></label>
@ -85,14 +89,15 @@
<div class="tab-panels"> <div class="tab-panels">
<section id="comments" class="space-y-6 tab-panel"> <section id="comments" class="space-y-6 tab-panel">
<?= form_open(route_to('comment-attempt-create', $podcast->id, $episode->id), [ <?= form_open(route_to('comment-attempt-create', $podcast->id, $episode->id), [
'class' => 'flex p-4', 'class' => 'flex p-4',
]) ?> ]) ?>
<?= csrf_field() ?> <?= csrf_field() ?>
<?= view('_message_block') ?> <?= view('_message_block') ?>
<img src="<?= interact_as_actor() <img src="<?= interact_as_actor()
->avatar_image_url ?>" alt="<?= interact_as_actor()->display_name ?>" class="w-12 h-12 mr-4 rounded-full" /> ->avatar_image_url ?>" alt="<?= interact_as_actor()
->display_name ?>" class="w-12 h-12 mr-4 rounded-full" />
<div class="flex flex-col flex-1 min-w-0"> <div class="flex flex-col flex-1 min-w-0">
<?= form_textarea( <?= form_textarea(
[ [
@ -113,13 +118,21 @@
<?= button( <?= button(
lang('Comment.form.submit'), lang('Comment.form.submit'),
'', '',
['variant' => 'primary', 'size' => 'small'], [
['type' => 'submit', 'class' => 'self-end'], 'variant' => 'primary',
'size' => 'small',
],
[
'type' => 'submit',
'class' => 'self-end',
],
) ?> ) ?>
</div> </div>
<?= form_close() ?> <?= form_close() ?>
<?php foreach ($episode->comments as $comment): ?> <?php foreach ($episode->comments as $comment): ?>
<?= view('podcast/_partials/comment_authenticated', ['comment' => $comment]) ?> <?= view('podcast/_partials/comment_authenticated', [
'comment' => $comment,
]) ?>
<?php endforeach; ?> <?php endforeach; ?>
</section> </section>
<section id="activity" class="space-y-8 tab-panel"> <section id="activity" class="space-y-8 tab-panel">
@ -131,7 +144,8 @@
<?= view('_message_block') ?> <?= view('_message_block') ?>
<img src="<?= interact_as_actor() <img src="<?= interact_as_actor()
->avatar_image_url ?>" alt="<?= interact_as_actor()->display_name ?>" class="w-12 h-12 mr-4 rounded-full" /> ->avatar_image_url ?>" alt="<?= interact_as_actor()
->display_name ?>" class="w-12 h-12 mr-4 rounded-full" />
<div class="flex flex-col flex-1 min-w-0"> <div class="flex flex-col flex-1 min-w-0">
<?= form_textarea( <?= form_textarea(
[ [
@ -157,8 +171,14 @@
<?= button( <?= button(
lang('Post.form.submit'), lang('Post.form.submit'),
'', '',
['variant' => 'primary', 'size' => 'small'], [
['type' => 'submit', 'class' => 'self-end'], 'variant' => 'primary',
'size' => 'small',
],
[
'type' => 'submit',
'class' => 'self-end',
],
) ?> ) ?>
</div> </div>
<?= form_close() ?> <?= form_close() ?>

Some files were not shown because too many files have changed in this diff Show More