2021-09-02 16:34:25 +00:00
|
|
|
<?= $this->extend('_layout') ?>
|
2020-08-27 10:05:44 +00:00
|
|
|
|
|
|
|
<?= $this->section('title') ?>
|
|
|
|
<?= lang('Platforms.title') ?>
|
|
|
|
<?= $this->endSection() ?>
|
|
|
|
|
2020-10-02 15:38:16 +00:00
|
|
|
<?= $this->section('pageTitle') ?>
|
|
|
|
<?= lang('Platforms.title') ?>
|
|
|
|
<?= $this->endSection() ?>
|
|
|
|
|
2021-09-21 15:51:04 +00:00
|
|
|
<?= $this->section('headerRight') ?>
|
|
|
|
<Button form="platforms-form" variant="primary" type="submit" class="self-end"><?= lang('Platforms.submit') ?></Button>
|
|
|
|
<?= $this->endSection() ?>
|
|
|
|
|
2020-08-27 10:05:44 +00:00
|
|
|
<?= $this->section('content') ?>
|
|
|
|
|
2021-09-21 15:51:04 +00:00
|
|
|
<form id="platforms-form" action="<?= route_to('platforms-save', $podcast->id, $platformType) ?>" method="POST" class="flex flex-col max-w-md">
|
2020-08-27 10:05:44 +00:00
|
|
|
<?= csrf_field() ?>
|
|
|
|
|
|
|
|
<?php foreach ($platforms as $platform): ?>
|
|
|
|
|
2020-11-24 18:21:02 +00:00
|
|
|
<div class="relative flex items-start mb-8">
|
2021-04-02 17:20:02 +00:00
|
|
|
<div class="flex flex-col items-center w-12 mr-4">
|
2022-02-24 14:48:17 +00:00
|
|
|
<?php if ($platform->submit_url === ''): ?>
|
|
|
|
<?= icon(
|
2022-03-04 14:33:48 +00:00
|
|
|
esc($platform->slug),
|
2022-02-24 14:48:17 +00:00
|
|
|
'text-skin-muted text-4xl',
|
|
|
|
$platform->type
|
|
|
|
) ?>
|
|
|
|
<?php else: ?>
|
|
|
|
<?= anchor(
|
2021-09-08 15:51:33 +00:00
|
|
|
$platform->submit_url,
|
|
|
|
icon(
|
2022-03-04 14:33:48 +00:00
|
|
|
esc($platform->slug),
|
2021-11-05 14:36:34 +00:00
|
|
|
'text-skin-muted text-4xl',
|
2022-02-24 14:48:17 +00:00
|
|
|
$platform->type
|
2021-09-08 15:51:33 +00:00
|
|
|
),
|
|
|
|
[
|
2022-02-24 14:48:17 +00:00
|
|
|
'class' => 'text-skin-muted hover:text-skin-base',
|
2021-09-08 15:51:33 +00:00
|
|
|
'target' => '_blank',
|
|
|
|
'rel' => 'noopener noreferrer',
|
2021-11-05 14:36:34 +00:00
|
|
|
'data-tooltip' => 'bottom',
|
2021-09-08 15:51:33 +00:00
|
|
|
'title' => lang('Platforms.submit_url', [
|
|
|
|
'platformName' => $platform->label,
|
|
|
|
]),
|
|
|
|
],
|
|
|
|
) ?>
|
2022-02-24 14:48:17 +00:00
|
|
|
<?php endif; ?>
|
|
|
|
<div class="inline-flex mt-1 bg-highlight">
|
2020-08-27 10:05:44 +00:00
|
|
|
<?= anchor($platform->home_url, icon('external-link', 'mx-auto'), [
|
2021-11-05 14:36:34 +00:00
|
|
|
'class' => 'flex-1 text-skin-muted hover:text-skin-base',
|
2020-08-27 10:05:44 +00:00
|
|
|
'target' => '_blank',
|
|
|
|
'rel' => 'noopener noreferrer',
|
2021-11-05 14:36:34 +00:00
|
|
|
'data-tooltip' => 'bottom',
|
2020-08-27 10:05:44 +00:00
|
|
|
'title' => lang('Platforms.home_url', [
|
|
|
|
'platformName' => $platform->label,
|
|
|
|
]),
|
|
|
|
]) ?>
|
|
|
|
<?= $platform->submit_url
|
2021-04-02 17:20:02 +00:00
|
|
|
? anchor($platform->submit_url, icon('add', 'mx-auto'), [
|
2021-11-05 14:36:34 +00:00
|
|
|
'class' => 'flex-1 text-skin-muted hover:text-skin-base',
|
2020-08-27 10:05:44 +00:00
|
|
|
'target' => '_blank',
|
|
|
|
'rel' => 'noopener noreferrer',
|
2021-11-05 14:36:34 +00:00
|
|
|
'data-tooltip' => 'bottom',
|
2020-08-27 10:05:44 +00:00
|
|
|
'title' => lang('Platforms.submit_url', [
|
|
|
|
'platformName' => $platform->label,
|
|
|
|
]),
|
|
|
|
])
|
|
|
|
: '' ?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="flex flex-col flex-1">
|
|
|
|
<?= $platform->link_url
|
|
|
|
? anchor(
|
2020-11-18 17:17:56 +00:00
|
|
|
route_to(
|
|
|
|
'podcast-platform-remove',
|
|
|
|
$podcast->id,
|
2022-03-04 14:33:48 +00:00
|
|
|
esc($platform->slug),
|
2020-11-18 17:17:56 +00:00
|
|
|
),
|
2020-08-27 10:05:44 +00:00
|
|
|
icon('delete-bin', 'mx-auto'),
|
|
|
|
[
|
|
|
|
'class' =>
|
2021-11-05 14:36:34 +00:00
|
|
|
'absolute right-0 p-1 bg-red-100 rounded-full text-red-700 hover:text-red-900',
|
|
|
|
'data-tooltip' => 'bottom',
|
2020-08-27 10:05:44 +00:00
|
|
|
'title' => lang('Platforms.remove', [
|
|
|
|
'platformName' => $platform->label,
|
|
|
|
]),
|
2021-04-02 17:20:02 +00:00
|
|
|
],
|
2020-08-27 10:05:44 +00:00
|
|
|
)
|
|
|
|
: '' ?>
|
2021-09-15 15:58:21 +00:00
|
|
|
<fieldset>
|
|
|
|
<legend class="mb-2 font-semibold"><?= $platform->label ?></legend>
|
|
|
|
<Forms.Input
|
|
|
|
class="w-full mb-1"
|
2022-03-04 14:33:48 +00:00
|
|
|
id="<?= esc($platform->slug) . '_link_url' ?>"
|
|
|
|
name="<?= 'platforms[' . esc($platform->slug) . '][url]' ?>"
|
|
|
|
value="<?= esc($platform->link_url) ?>"
|
2021-09-15 15:58:21 +00:00
|
|
|
type="url"
|
|
|
|
placeholder="https://…" />
|
|
|
|
<Forms.Input
|
|
|
|
class="w-full mb-1"
|
2022-03-04 14:33:48 +00:00
|
|
|
id="<?= esc($platform->slug) . '_account_id' ?>"
|
|
|
|
name="<?= 'platforms[' . esc($platform->slug) . '][account_id]' ?>"
|
|
|
|
value="<?= esc($platform->account_id) ?>"
|
2021-09-15 15:58:21 +00:00
|
|
|
placeholder="<?= lang("Platforms.description.{$platform->type}") ?>" />
|
2022-03-04 14:33:48 +00:00
|
|
|
<Forms.Toggler size="small" class="text-sm" id="<?= esc($platform->slug) . '_visible' ?>" name="<?= 'platforms[' . esc($platform->slug) . '][visible]'?>" value="yes" checked="<?= old(esc($platform->slug) . '_visible', $platform->is_visible ? 'true' : 'false') ?>"><?= lang('Platforms.visible') ?></Forms.Toggler>
|
2021-09-15 15:58:21 +00:00
|
|
|
</fieldset>
|
2020-08-27 10:05:44 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
2021-09-20 15:45:38 +00:00
|
|
|
</form>
|
2020-08-27 10:05:44 +00:00
|
|
|
|
|
|
|
<?= $this->endSection() ?>
|