Newer
Older

Yassine Doghri
committed
<?= $this->extend('admin/_layout') ?>
<?= $this->section('title') ?>
<?= lang('Episode.edit') ?>
<?= $this->endSection() ?>
<?= $this->section('pageTitle') ?>
<?= lang('Episode.edit') ?>
<?= $this->endSection() ?>
<?= $this->section('content') ?>
<?= form_open_multipart(route_to('episode-edit', $podcast->id, $episode->id), [
'method' => 'post',
'class' => 'flex flex-col',
]) ?>

Yassine Doghri
committed
<div class="inline-flex w-full p-2 mb-4 text-sm font-semibold text-yellow-800 bg-red-100 border border-red-300 rounded" role="alert">
<?= icon('alert', 'mr-2 text-lg flex-shrink-0') .
lang('Episode.form.warning') ?>
</div>
<?= form_section(
lang('Episode.form.info_section_title'),
'<img
src="' .
$episode->image->medium_url .
'"
alt="' .
$episode->title .
'"
class="w-48"
/>',
) ?>

Yassine Doghri
committed
<?= form_label(
lang('Episode.form.audio_file'),
'audio_file',

Yassine Doghri
committed
[],
lang('Episode.form.audio_file_hint'),

Yassine Doghri
committed
) ?>
<?= form_input([
'id' => 'audio_file',
'name' => 'audio_file',

Yassine Doghri
committed
'class' => 'form-input mb-4',
'type' => 'file',
'accept' => '.mp3,.m4a',
]) ?>
<?= form_label(
lang('Episode.form.image'),
'image',
[],
lang('Episode.form.image_hint'),

Yassine Doghri
committed
true,
<?= form_input([
'id' => 'image',
'name' => 'image',
'class' => 'form-input',
'type' => 'file',
'accept' => '.jpg,.jpeg,.png',
]) ?>
<small class="mb-4 text-gray-600"><?= lang(

Yassine Doghri
committed
'Common.forms.image_size_hint',
<?= form_label(
lang('Episode.form.title'),
'title',
[],

Yassine Doghri
committed
lang('Episode.form.title_hint'),
<?= form_input([
'id' => 'title',
'name' => 'title',
'class' => 'form-input mb-4',
'value' => old('title', $episode->title),
'required' => 'required',
'data-slugify' => 'title',
]) ?>
<?= form_label(
lang('Episode.form.permalink'),
'slug',
[],
) ?>
<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>
<?= form_input([
'id' => 'slug',
'name' => 'slug',
'class' => 'form-input flex-1 w-0 text-xs',
'value' => old('slug', $episode->slug),
'required' => 'required',
'data-slugify' => 'slug',
'slot' => 'slug-input'
]) ?>
</permalink-edit>
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<div class="flex flex-col mb-4 gap-x-2 gap-y-4 md:flex-row">
<div class="flex flex-col flex-1">
<?= form_label(lang('Episode.form.season_number'), 'season_number') ?>
<?= form_input([
'id' => 'season_number',
'name' => 'season_number',
'class' => 'form-input w-full',
'value' => old('season_number', $episode->season_number),
'type' => 'number',
]) ?>
</div>
<div class="flex flex-col flex-1">
<?= form_label(lang('Episode.form.episode_number'), 'episode_number') ?>
<?= form_input([
'id' => 'episode_number',
'name' => 'episode_number',
'class' => 'form-input w-full',
'value' => old('episode_number', $episode->number),
'type' => 'number',
]) ?>
</div>
</div>
<?= form_fieldset('', ['class' => 'flex mb-4 gap-1']) ?>
<legend>
<?= lang('Episode.form.type.label') .
hint_tooltip(lang('Episode.form.type.hint'), 'ml-1') ?>
</legend>
<?= form_radio(
['id' => 'full', 'name' => 'type', 'class' => 'form-radio-btn'],
'full',

Yassine Doghri
committed
old('type') ? old('type') === 'full' : $episode->type === 'full',
) ?>
<label for="full" class="inline-flex items-center">
<?= lang('Episode.form.type.full') ?>
</label>
<?= form_radio(
['id' => 'trailer', 'name' => 'type', 'class' => 'form-radio-btn'],
'trailer',

Yassine Doghri
committed
old('type') ? old('type') === 'trailer' : $episode->type === 'trailer',
) ?>
<label for="trailer" class="inline-flex items-center">
<?= lang('Episode.form.type.trailer') ?>
</label>
<?= form_radio(
['id' => 'bonus', 'name' => 'type', 'class' => 'form-radio-btn'],
'bonus',

Yassine Doghri
committed
old('type') ? old('type') === 'bonus' : $episode->type === 'bonus',
) ?>
<label for="bonus" class="inline-flex items-center">
<?= lang('Episode.form.type.bonus') ?>
</label>
<?= form_fieldset_close() ?>
<?= form_fieldset('', ['class' => 'mb-6']) ?>
<legend>
<?= lang('Episode.form.parental_advisory.label') .
hint_tooltip(lang('Episode.form.parental_advisory.hint'), 'ml-1') ?>
</legend>
<?= form_radio(
[
'id' => 'undefined',
'name' => 'parental_advisory',
'class' => 'form-radio-btn',
],
'undefined',
old('parental_advisory')
? old('parental_advisory') === 'undefined'

Yassine Doghri
committed
: $episode->parental_advisory === null,
) ?>
<label for="undefined"><?= lang(

Yassine Doghri
committed
'Episode.form.parental_advisory.undefined',
) ?></label>
<?= form_radio(
[
'id' => 'clean',
'name' => 'parental_advisory',
'class' => 'form-radio-btn',
],
'clean',
old('parental_advisory')
? old('parental_advisory') === 'clean'

Yassine Doghri
committed
: $episode->parental_advisory === 'clean',
) ?>
<label for="clean"><?= lang(

Yassine Doghri
committed
'Episode.form.parental_advisory.clean',
) ?></label>
<?= form_radio(
[
'id' => 'explicit',
'name' => 'parental_advisory',
'class' => 'form-radio-btn',
],
'explicit',
old('parental_advisory')
? old('parental_advisory') === 'explicit'

Yassine Doghri
committed
: $episode->parental_advisory === 'explicit',
) ?>
<label for="explicit"><?= lang(

Yassine Doghri
committed
'Episode.form.parental_advisory.explicit',
) ?></label>
<?= form_fieldset_close() ?>
<?= form_section_close() ?>
<?= form_section(
lang('Episode.form.show_notes_section_title'),

Yassine Doghri
committed
lang('Episode.form.show_notes_section_subtitle'),
) ?>
<div class="mb-4">
<?= form_label(lang('Episode.form.description'), 'description') ?>

Yassine Doghri
committed
<?= form_markdown_editor(
[
'id' => 'description',
'name' => 'description',
'required' => 'required',
],
old('description', $episode->description_markdown, false),
<div class="mb-4">
<?= form_label(
lang('Episode.form.description_footer'),
'description_footer',
[],

Yassine Doghri
committed
lang('Episode.form.description_footer_hint'),

Yassine Doghri
committed
true

Yassine Doghri
committed
<?= form_markdown_editor(
[
'id' => 'description_footer',
'name' => 'description_footer',
],
old(
'description_footer',
$podcast->episode_description_footer_markdown ?? '',

Yassine Doghri
committed
false,
),
) ?>
</div>
<?= form_section_close() ?>
<?= form_section(
lang('Episode.form.location_section_title'),

Yassine Doghri
committed
lang('Episode.form.location_section_subtitle'),
) ?>
<?= form_label(
lang('Episode.form.location_name'),
'location_name',
[],
lang('Episode.form.location_name_hint'),

Yassine Doghri
committed
true,
) ?>
<?= form_input([
'id' => 'location_name',
'name' => 'location_name',
'class' => 'form-input mb-4',
'value' => old('location_name', $episode->location_name),
]) ?>
<?= form_section_close() ?>
<?= form_section(
lang('Episode.form.additional_files_section_title'),
lang('Episode.form.additional_files_section_subtitle', [
'podcastNamespaceLink' =>
'“<a href="https://github.com/Podcastindex-org/podcast-namespace" target="_blank" rel="noreferrer noopener" style="text-decoration: underline;">podcast namespace</a>”',

Yassine Doghri
committed
]),
<?= form_fieldset('', ['class' => 'flex flex-col mb-4']) ?>
<legend><?= lang('Episode.form.transcript') .
'<small class="ml-1 lowercase">(' .
lang('Common.optional') .
')</small>' .
hint_tooltip(lang('Episode.form.transcript_hint'), 'ml-1') ?></legend>
<div class="mb-4 form-input-tabs">

Yassine Doghri
committed
<input type="radio" name="transcript-choice" id="transcript-file-upload-choice" aria-controls="transcript-file-upload-choice" value="upload-file" <?= $episode->transcript_file_remote_url
? ''
: 'checked' ?> />
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
<label for="transcript-file-upload-choice"><?= lang(
'Common.forms.upload_file',
) ?></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
? 'checked'
: '' ?> />
<label for="transcript-file-remote-url-choice"><?= lang(
'Common.forms.remote_url',
) ?></label>
<div class="py-2 tab-panels">
<section id="transcript-file-upload" class="flex items-center tab-panel">
<?php if ($episode->transcript_file): ?>
<div class="flex justify-between">
<?= anchor(
$episode->transcript_file_url,
icon('file', 'mr-2 text-gray-500') .
$episode->transcript_file,
[
'class' => 'inline-flex items-center text-xs',
'target' => '_blank',
'rel' => 'noreferrer noopener',
],
) .
anchor(
route_to(
'transcript-delete',
$podcast->id,
$episode->id,
),
icon('delete-bin', 'mx-auto'),
[
'class' =>
'p-1 bg-red-200 rounded-full text-red-700 hover:text-red-900',
'data-toggle' => 'tooltip',
'data-placement' => 'bottom',
'title' => lang(
'Episode.form.transcript_file_delete',
),
],
) ?>
</div>
<?php endif; ?>
<?= form_label(
lang('Episode.form.transcript_file'),
'transcript_file',
['class' => 'sr-only'],
lang('Episode.form.transcript_file'),
true,
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
<?= form_input([
'id' => 'transcript_file',
'name' => 'transcript_file',
'class' => 'form-input',
'type' => 'file',
'accept' => '.txt,.html,.srt,.json',
]) ?>
</section>
<section id="transcript-file-remote-url" class="tab-panel">
<?= form_label(
lang('Episode.form.transcript_file_remote_url'),
'transcript_file_remote_url',
['class' => 'sr-only'],
lang('Episode.form.transcript_file_remote_url'),
true,
) ?>
<?= form_input([
'id' => 'transcript_file_remote_url',
'name' => 'transcript_file_remote_url',
'class' => 'form-input w-full',
'type' => 'url',
'placeholder' => 'https://...',
'value' => old(
'transcript_file_remote_url',
$episode->transcript_file_remote_url,
),
]) ?>
</section>
</div>
<?= form_fieldset_close() ?>
<?= form_fieldset('', ['class' => 'flex flex-col mb-4']) ?>
<legend><?= lang('Episode.form.chapters') .
'<small class="ml-1 lowercase">(' .
lang('Common.optional') .
')</small>' .
hint_tooltip(lang('Episode.form.chapters_hint'), 'ml-1') ?></legend>
<div class="mb-4 form-input-tabs">

Yassine Doghri
committed
<input type="radio" name="chapters-choice" id="chapters-file-upload-choice" aria-controls="chapters-file-upload-choice" value="upload-file" <?= $episode->chapters_file_remote_url
? ''
: 'checked' ?> />
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
<label for="chapters-file-upload-choice"><?= lang(
'Common.forms.upload_file',
) ?></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
? 'checked'
: '' ?> />
<label for="chapters-file-remote-url-choice"><?= lang(
'Common.forms.remote_url',
) ?></label>
<div class="py-2 tab-panels">
<section id="chapters-file-upload" class="flex items-center tab-panel">
<?php if ($episode->chapters_file): ?>
<div class="flex justify-between">
<?= anchor(
$episode->chapters_file_url,
icon('file', 'mr-2') . $episode->chapters_file,
[
'class' => 'inline-flex items-center text-xs',
'target' => '_blank',
'rel' => 'noreferrer noopener',
],
) .
anchor(
route_to(
'chapters-delete',
$podcast->id,
$episode->id,
),
icon('delete-bin', 'mx-auto'),
[
'class' =>
'p-1 bg-red-200 rounded-full text-red-700 hover:text-red-900',
'data-toggle' => 'tooltip',
'data-placement' => 'bottom',
'title' => lang(
'Episode.form.chapters_file_delete',
),
],
) ?>
</div>
<?php endif; ?>
<?= form_label(
lang('Episode.form.chapters_file'),
'chapters_file',
['class' => 'sr-only'],
lang('Episode.form.chapters_file'),
true,
) ?>
<?= form_input([
'id' => 'chapters_file',
'name' => 'chapters_file',
'class' => 'form-input',
'type' => 'file',
'accept' => '.json',
]) ?>
</section>
<section id="chapters-file-remote-url" class="tab-panel">
<?= form_label(
lang('Episode.form.chapters_file_remote_url'),
'chapters_file_remote_url',
['class' => 'sr-only'],
lang('Episode.form.chapters_file_remote_url'),
true,
<?= form_input([
'id' => 'chapters_file_remote_url',
'name' => 'chapters_file_remote_url',
'class' => 'form-input w-full',
'type' => 'url',
'placeholder' => 'https://...',
'value' => old(
'chapters_file_remote_url',
$episode->chapters_file_remote_url,
),
]) ?>
</section>
</div>
<?= form_fieldset_close() ?>
<?= form_section_close() ?>

Benjamin Bellamy
committed
<?= form_section(
lang('Episode.form.advanced_section_title'),

Yassine Doghri
committed
lang('Episode.form.advanced_section_subtitle'),

Benjamin Bellamy
committed
) ?>
<?= form_label(
lang('Episode.form.custom_rss'),
'custom_rss',
[],
lang('Episode.form.custom_rss_hint'),

Yassine Doghri
committed
true,

Benjamin Bellamy
committed
) ?>
<?= form_textarea([
'id' => 'custom_rss',
'name' => 'custom_rss',
'class' => 'form-textarea',
'value' => old('custom_rss', $episode->custom_rss_string),
]) ?>
<?= form_section_close() ?>
<?= form_switch(
lang('Episode.form.block') .
hint_tooltip(lang('Episode.form.block_hint'), 'ml-1'),
['id' => 'block', 'name' => 'block'],
'yes',

Yassine Doghri
committed
old('block', $episode->is_blocked),
) ?>
<?= button(
lang('Episode.form.submit_edit'),

Yassine Doghri
committed
'',
['variant' => 'primary'],

Yassine Doghri
committed
['type' => 'submit', 'class' => 'self-end'],
<?= form_close() ?>
<?= $this->endSection() ?>