2021-09-02 16:34:25 +00:00
|
|
|
<?= $this->extend('_layout') ?>
|
2021-04-02 17:20:02 +00:00
|
|
|
|
|
|
|
<?= $this->section('title') ?>
|
2021-06-22 17:59:33 +00:00
|
|
|
<?= lang('Episode.publish_edit') ?>
|
2021-04-02 17:20:02 +00:00
|
|
|
<?= $this->endSection() ?>
|
|
|
|
|
|
|
|
<?= $this->section('pageTitle') ?>
|
2021-06-22 17:59:33 +00:00
|
|
|
<?= lang('Episode.publish_edit') ?>
|
2021-04-02 17:20:02 +00:00
|
|
|
<?= $this->endSection() ?>
|
|
|
|
|
|
|
|
<?= $this->section('content') ?>
|
|
|
|
|
2021-06-22 17:59:33 +00:00
|
|
|
<?= anchor(
|
|
|
|
route_to('episode-view', $podcast->id, $episode->id),
|
|
|
|
icon('arrow-left', 'mr-2 text-lg') . lang('Episode.publish_form.back_to_episode_dashboard'),
|
2021-09-08 15:51:33 +00:00
|
|
|
[
|
|
|
|
'class' => 'inline-flex items-center font-semibold mr-4 text-sm',
|
|
|
|
],
|
2021-06-22 17:59:33 +00:00
|
|
|
) ?>
|
|
|
|
|
2021-04-02 17:20:02 +00:00
|
|
|
<?= form_open(route_to('episode-publish_edit', $podcast->id, $episode->id), [
|
|
|
|
'method' => 'post',
|
2021-06-22 17:59:33 +00:00
|
|
|
'class' => 'mx-auto flex flex-col max-w-xl items-start',
|
2021-09-08 15:51:33 +00:00
|
|
|
'data-submit' => 'validate-message',
|
2021-04-02 17:20:02 +00:00
|
|
|
]) ?>
|
|
|
|
<?= csrf_field() ?>
|
|
|
|
<?= form_hidden('client_timezone', 'UTC') ?>
|
2021-08-13 11:07:29 +00:00
|
|
|
<?= form_hidden('post_id', $post->id) ?>
|
2021-04-02 17:20:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
<label for="message" class="text-lg font-semibold"><?= lang(
|
2021-09-08 15:51:33 +00:00
|
|
|
'Episode.publish_form.post',
|
|
|
|
) ?></label>
|
2021-08-13 11:07:29 +00:00
|
|
|
<small class="max-w-md mb-2 text-gray-600"><?= lang('Episode.publish_form.post_hint') ?></small>
|
2021-04-02 17:20:02 +00:00
|
|
|
<div class="mb-8 overflow-hidden bg-white shadow-md rounded-xl">
|
|
|
|
<div class="flex px-4 py-3">
|
2021-08-19 14:00:14 +00:00
|
|
|
<img src="<?= $podcast->actor->avatar_image_url ?>" alt="<?= $podcast->actor->display_name ?>" class="w-12 h-12 mr-4 rounded-full" />
|
2021-04-02 17:20:02 +00:00
|
|
|
<div class="flex flex-col min-w-0">
|
|
|
|
<p class="flex items-baseline min-w-0">
|
2021-08-19 14:00:14 +00:00
|
|
|
<span class="mr-2 font-semibold truncate"><?= $podcast->actor->display_name ?></span>
|
|
|
|
<span class="text-sm text-gray-500 truncate">@<?= $podcast->actor->username ?></span>
|
2021-04-02 17:20:02 +00:00
|
|
|
</p>
|
2021-08-13 11:07:29 +00:00
|
|
|
<?= relative_time($post->published_at, 'text-xs text-gray-500') ?>
|
2021-04-02 17:20:02 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="px-4 mb-2">
|
|
|
|
<?= form_textarea(
|
2021-09-08 15:51:33 +00:00
|
|
|
[
|
|
|
|
'id' => 'message',
|
|
|
|
'name' => 'message',
|
|
|
|
'class' => 'form-textarea',
|
|
|
|
'placeholder' => 'Write your message...',
|
|
|
|
'autofocus' => '',
|
|
|
|
],
|
|
|
|
old('message', $post->message, false),
|
|
|
|
[
|
|
|
|
'rows' => 2,
|
|
|
|
],
|
|
|
|
) ?>
|
2021-04-02 17:20:02 +00:00
|
|
|
</div>
|
|
|
|
<div class="flex">
|
|
|
|
<img src="<?= $episode->image
|
2021-09-08 15:51:33 +00:00
|
|
|
->thumbnail_url ?>" alt="<?= $episode->title ?>" class="w-24 h-24" />
|
2021-04-02 17:20:02 +00:00
|
|
|
<div class="flex flex-col flex-1">
|
|
|
|
<a href="<?= $episode->link ?>" class="flex-1 px-4 py-2 bg-gray-100">
|
|
|
|
<div class="flex items-baseline">
|
|
|
|
<span class="flex-1 w-0 mr-2 text-sm font-semibold truncate"><?= $episode->title ?></span>
|
|
|
|
<?= episode_numbering(
|
2021-09-08 15:51:33 +00:00
|
|
|
$episode->number,
|
|
|
|
$episode->season_number,
|
|
|
|
'text-xs font-semibold text-gray-600',
|
|
|
|
true,
|
|
|
|
) ?>
|
2021-04-02 17:20:02 +00:00
|
|
|
</div>
|
|
|
|
<div class="text-xs text-gray-600">
|
2021-08-09 15:56:59 +00:00
|
|
|
<?= relative_time($episode->published_at) ?>
|
2021-04-02 17:20:02 +00:00
|
|
|
<span class="mx-1">•</span>
|
2021-05-03 17:39:58 +00:00
|
|
|
<time datetime="PT<?= $episode->audio_file_duration ?>S">
|
|
|
|
<?= format_duration($episode->audio_file_duration) ?>
|
2021-04-02 17:20:02 +00:00
|
|
|
</time>
|
|
|
|
</div>
|
|
|
|
</a>
|
2021-08-09 10:28:16 +00:00
|
|
|
<?= audio_player($episode->audio_file_url, $episode->audio_file_mimetype, 'mt-auto') ?>
|
2021-04-02 17:20:02 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<footer class="flex justify-around px-6 py-3">
|
|
|
|
<span class="inline-flex items-center"><?= icon(
|
2021-09-08 15:51:33 +00:00
|
|
|
'chat',
|
|
|
|
'text-xl mr-1 text-gray-400',
|
|
|
|
) . '0' ?></span>
|
2021-04-02 17:20:02 +00:00
|
|
|
<span class="inline-flex items-center"><?= icon(
|
2021-09-08 15:51:33 +00:00
|
|
|
'repeat',
|
|
|
|
'text-xl mr-1 text-gray-400',
|
|
|
|
) . '0' ?></span>
|
2021-04-02 17:20:02 +00:00
|
|
|
<span class="inline-flex items-center"><?= icon(
|
2021-09-08 15:51:33 +00:00
|
|
|
'heart',
|
|
|
|
'text-xl mr-1 text-gray-400',
|
|
|
|
) . '0' ?></span>
|
2021-04-02 17:20:02 +00:00
|
|
|
</footer>
|
|
|
|
</div>
|
|
|
|
|
2021-09-08 15:51:33 +00:00
|
|
|
<?= form_fieldset('', [
|
|
|
|
'class' => 'flex flex-col mb-4',
|
|
|
|
]) ?>
|
2021-04-02 17:20:02 +00:00
|
|
|
<legend class="text-lg font-semibold"><?= lang(
|
2021-09-08 15:51:33 +00:00
|
|
|
'Episode.publish_form.publication_date',
|
|
|
|
) ?></legend>
|
2021-04-02 17:20:02 +00:00
|
|
|
<label for="now" class="inline-flex items-center">
|
|
|
|
<?= form_radio(
|
2021-09-08 15:51:33 +00:00
|
|
|
[
|
|
|
|
'id' => 'now',
|
|
|
|
'name' => 'publication_method',
|
|
|
|
'class' => 'text-pine-700',
|
|
|
|
],
|
|
|
|
'now',
|
|
|
|
old('publication_method') && old('publish') === 'now',
|
|
|
|
) ?>
|
2021-04-02 17:20:02 +00:00
|
|
|
<span class="ml-2"><?= lang(
|
2021-09-08 15:51:33 +00:00
|
|
|
'Episode.publish_form.publication_method.now',
|
|
|
|
) ?></span>
|
2021-04-02 17:20:02 +00:00
|
|
|
</label>
|
2021-06-22 17:59:33 +00:00
|
|
|
<div class="inline-flex flex-wrap items-center radio-toggler">
|
2021-04-02 17:20:02 +00:00
|
|
|
<?= form_radio(
|
2021-09-08 15:51:33 +00:00
|
|
|
[
|
|
|
|
'id' => 'schedule',
|
|
|
|
'name' => 'publication_method',
|
|
|
|
'class' => 'text-pine-700',
|
|
|
|
],
|
|
|
|
'schedule',
|
|
|
|
old('publication_method')
|
2021-04-02 17:20:02 +00:00
|
|
|
? old('publication_method') === 'schedule'
|
|
|
|
: true,
|
2021-09-08 15:51:33 +00:00
|
|
|
) ?>
|
2021-04-02 17:20:02 +00:00
|
|
|
<label for="schedule" class="ml-2"><?= lang(
|
2021-09-08 15:51:33 +00:00
|
|
|
'Episode.publish_form.publication_method.schedule',
|
|
|
|
) ?></label>
|
2021-04-02 17:20:02 +00:00
|
|
|
<div class="w-full mt-2 radio-toggler-element">
|
|
|
|
<?= form_label(
|
2021-09-08 15:51:33 +00:00
|
|
|
lang('Episode.publish_form.scheduled_publication_date'),
|
|
|
|
'scheduled_publication_date',
|
|
|
|
[],
|
|
|
|
lang('Episode.publish_form.scheduled_publication_date_hint'),
|
|
|
|
) ?>
|
2021-06-22 17:59:33 +00:00
|
|
|
<div class="flex" data-picker="datetime">
|
2021-04-02 17:20:02 +00:00
|
|
|
<?= form_input([
|
|
|
|
'id' => 'scheduled_publication_date',
|
|
|
|
'name' => 'scheduled_publication_date',
|
|
|
|
'class' => 'form-input rounded-r-none flex-1',
|
|
|
|
'value' => old(
|
|
|
|
'scheduled_publication_date',
|
|
|
|
$episode->published_at,
|
|
|
|
),
|
|
|
|
'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" aria-label="<?= lang(
|
2021-08-19 14:00:14 +00:00
|
|
|
'Episode.publish_form.scheduled_publication_date_clear',
|
|
|
|
) ?>" title="<?= lang(
|
|
|
|
'Episode.publish_form.scheduled_publication_date_clear',
|
|
|
|
) ?>" data-clear=""><?= icon('close') ?></button>
|
2021-04-02 17:20:02 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<?= form_fieldset_close() ?>
|
|
|
|
|
2021-06-22 17:59:33 +00:00
|
|
|
<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">
|
|
|
|
<?= icon('alert', 'mr-2 text-lg flex-shrink-0') . lang(
|
2021-09-08 15:51:33 +00:00
|
|
|
'Episode.publish_form.message_warning',
|
|
|
|
) ?></p>
|
2021-06-22 17:59:33 +00:00
|
|
|
<p>
|
|
|
|
<?= lang(
|
2021-09-08 15:51:33 +00:00
|
|
|
'Episode.publish_form.message_warning_hint',
|
|
|
|
) ?>
|
2021-06-22 17:59:33 +00:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="flex items-center justify-between w-full mt-4">
|
2021-04-02 17:20:02 +00:00
|
|
|
<?= anchor(
|
2021-09-08 15:51:33 +00:00
|
|
|
route_to('episode-publish-cancel', $podcast->id, $episode->id),
|
|
|
|
lang('Episode.publish_form.cancel_publication'),
|
|
|
|
[
|
|
|
|
'class' => 'py-2 px-3 rounded-full bg-red-100 text-red-900 font-semibold mr-4',
|
|
|
|
],
|
|
|
|
) ?>
|
2021-04-02 17:20:02 +00:00
|
|
|
|
|
|
|
<?= button(
|
2021-09-08 15:51:33 +00:00
|
|
|
lang('Episode.publish_form.submit_edit'),
|
|
|
|
'',
|
|
|
|
[
|
|
|
|
'variant' => 'primary',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'type' => 'submit',
|
|
|
|
'data-btn-text-warning' => lang('Episode.publish_form.message_warning_submit'),
|
|
|
|
'data-btn-text' => lang('Episode.publish_form.submit_edit'),
|
|
|
|
],
|
|
|
|
) ?>
|
2021-04-02 17:20:02 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<?= form_close() ?>
|
|
|
|
|
2021-08-27 10:58:22 +00:00
|
|
|
<?= $this->endSection() ?>
|