mirror of
https://code.castopod.org/adaures/castopod.git
synced 2024-09-27 20:21:59 +02:00
fix(podcast-form): move fediverse section below author section
This commit is contained in:
parent
18e2633a49
commit
1861d67971
@ -688,4 +688,16 @@ class Episode extends Entity
|
|||||||
|
|
||||||
return url_to('episode-preview', (string) $this->preview_id);
|
return url_to('episode-preview', (string) $this->preview_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the episode's clip count
|
||||||
|
*/
|
||||||
|
public function getClipCount(): int|string
|
||||||
|
{
|
||||||
|
if ($this->id === null) {
|
||||||
|
throw new RuntimeException('Episode must be created before getting number of video clips.');
|
||||||
|
}
|
||||||
|
|
||||||
|
return (new ClipModel())->getClipCount($this->podcast_id, $this->id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -173,6 +173,16 @@ class ClipModel extends Model
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getClipCount(int $podcastId, int $episodeId): int
|
||||||
|
{
|
||||||
|
return $this
|
||||||
|
->where([
|
||||||
|
'podcast_id' => $podcastId,
|
||||||
|
'episode_id' => $episodeId,
|
||||||
|
])
|
||||||
|
->countAllResults();
|
||||||
|
}
|
||||||
|
|
||||||
public function clearVideoClipCache(int $clipId): void
|
public function clearVideoClipCache(int $clipId): void
|
||||||
{
|
{
|
||||||
cache()
|
cache()
|
||||||
|
@ -6,9 +6,11 @@ $episodeNavigation = [
|
|||||||
'items' => ['episode-view', 'episode-edit', 'episode-persons-manage', 'embed-add'],
|
'items' => ['episode-view', 'episode-edit', 'episode-persons-manage', 'embed-add'],
|
||||||
],
|
],
|
||||||
'clips' => [
|
'clips' => [
|
||||||
'icon' => 'clapperboard',
|
'icon' => 'clapperboard',
|
||||||
'items' => ['video-clips-list', 'video-clips-create', 'soundbites-list', 'soundbites-create'],
|
'items' => ['video-clips-list', 'video-clips-create', 'soundbites-list', 'soundbites-create'],
|
||||||
'add-cta' => 'video-clips-create',
|
'count' => $episode->getClipCount(),
|
||||||
|
'count-route' => 'video-clips-list',
|
||||||
|
'add-cta' => 'video-clips-create',
|
||||||
],
|
],
|
||||||
]; ?>
|
]; ?>
|
||||||
|
|
||||||
|
@ -56,27 +56,6 @@
|
|||||||
isChecked="false" ><?= lang('Podcast.form.type.serial') ?></Forms.RadioButton>
|
isChecked="false" ><?= lang('Podcast.form.type.serial') ?></Forms.RadioButton>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
</Forms.Section>
|
|
||||||
|
|
||||||
<Forms.Section
|
|
||||||
title="<?= lang('Podcast.form.fediverse_section_title') ?>"
|
|
||||||
subtitle="<?= lang('Podcast.form.fediverse_section_subtitle') ?>" >
|
|
||||||
|
|
||||||
<div class="flex flex-col">
|
|
||||||
<Forms.Label for="handle" hint="<?= lang('Podcast.form.handle_hint') ?>"><?= lang('Podcast.form.handle') ?></Forms.Label>
|
|
||||||
<div class="relative">
|
|
||||||
<Icon glyph="at" class="absolute inset-0 h-full text-xl opacity-40 left-3" />
|
|
||||||
<Forms.Input name="handle" class="w-full pl-8" required="true" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Forms.Field
|
|
||||||
name="banner"
|
|
||||||
label="<?= lang('Podcast.form.banner') ?>"
|
|
||||||
helper="<?= lang('Podcast.form.banner_size_hint') ?>"
|
|
||||||
type="file"
|
|
||||||
accept=".jpg,.jpeg,.png" />
|
|
||||||
</Forms.Section>
|
</Forms.Section>
|
||||||
|
|
||||||
<Forms.Section
|
<Forms.Section
|
||||||
@ -153,6 +132,25 @@
|
|||||||
|
|
||||||
</Forms.Section>
|
</Forms.Section>
|
||||||
|
|
||||||
|
<Forms.Section
|
||||||
|
title="<?= lang('Podcast.form.fediverse_section_title') ?>" >
|
||||||
|
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<Forms.Label for="handle" hint="<?= lang('Podcast.form.handle_hint') ?>"><?= lang('Podcast.form.handle') ?></Forms.Label>
|
||||||
|
<div class="relative">
|
||||||
|
<Icon glyph="at" class="absolute inset-0 h-full text-xl opacity-40 left-3" />
|
||||||
|
<Forms.Input name="handle" class="w-full pl-8" required="true" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Forms.Field
|
||||||
|
name="banner"
|
||||||
|
label="<?= lang('Podcast.form.banner') ?>"
|
||||||
|
helper="<?= lang('Podcast.form.banner_size_hint') ?>"
|
||||||
|
type="file"
|
||||||
|
accept=".jpg,.jpeg,.png" />
|
||||||
|
</Forms.Section>
|
||||||
|
|
||||||
<Forms.Section title="<?= lang('Podcast.form.premium') ?>">
|
<Forms.Section title="<?= lang('Podcast.form.premium') ?>">
|
||||||
<Forms.Toggler class="mt-2" name="premium_by_default" value="yes" checked="false" hint="<?= lang('Podcast.form.premium_by_default_hint') ?>">
|
<Forms.Toggler class="mt-2" name="premium_by_default" value="yes" checked="false" hint="<?= lang('Podcast.form.premium_by_default_hint') ?>">
|
||||||
<?= lang('Podcast.form.premium_by_default') ?></Forms.Toggler>
|
<?= lang('Podcast.form.premium_by_default') ?></Forms.Toggler>
|
||||||
|
@ -78,27 +78,6 @@
|
|||||||
isChecked="<?= $podcast->type === 'serial' ? 'true' : 'false' ?>" ><?= lang('Podcast.form.type.serial') ?></Forms.RadioButton>
|
isChecked="<?= $podcast->type === 'serial' ? 'true' : 'false' ?>" ><?= lang('Podcast.form.type.serial') ?></Forms.RadioButton>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
</Forms.Section>
|
|
||||||
|
|
||||||
<Forms.Section
|
|
||||||
title="<?= lang('Podcast.form.fediverse_section_title') ?>" >
|
|
||||||
|
|
||||||
<div class="flex flex-col">
|
|
||||||
<Forms.Label for="handle" hint="<?= lang('Podcast.form.handle_hint') ?>"><?= lang('Podcast.form.handle') ?></Forms.Label>
|
|
||||||
<div class="relative">
|
|
||||||
<Icon glyph="at" class="absolute inset-0 h-full text-xl opacity-40 left-3" />
|
|
||||||
<Forms.Input name="handle" value="<?= $podcast->handle ?>" class="w-full pl-8" required="true" readonly="true" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Forms.Field
|
|
||||||
name="banner"
|
|
||||||
label="<?= lang('Podcast.form.banner') ?>"
|
|
||||||
helper="<?= lang('Podcast.form.banner_size_hint') ?>"
|
|
||||||
type="file"
|
|
||||||
accept=".jpg,.jpeg,.png" />
|
|
||||||
|
|
||||||
</Forms.Section>
|
</Forms.Section>
|
||||||
|
|
||||||
<Forms.Section
|
<Forms.Section
|
||||||
@ -181,6 +160,26 @@
|
|||||||
|
|
||||||
</Forms.Section>
|
</Forms.Section>
|
||||||
|
|
||||||
|
<Forms.Section
|
||||||
|
title="<?= lang('Podcast.form.fediverse_section_title') ?>" >
|
||||||
|
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<Forms.Label for="handle" hint="<?= lang('Podcast.form.handle_hint') ?>"><?= lang('Podcast.form.handle') ?></Forms.Label>
|
||||||
|
<div class="relative">
|
||||||
|
<Icon glyph="at" class="absolute inset-0 h-full text-xl opacity-40 left-3" />
|
||||||
|
<Forms.Input name="handle" value="<?= $podcast->handle ?>" class="w-full pl-8" required="true" readonly="true" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Forms.Field
|
||||||
|
name="banner"
|
||||||
|
label="<?= lang('Podcast.form.banner') ?>"
|
||||||
|
helper="<?= lang('Podcast.form.banner_size_hint') ?>"
|
||||||
|
type="file"
|
||||||
|
accept=".jpg,.jpeg,.png" />
|
||||||
|
|
||||||
|
</Forms.Section>
|
||||||
|
|
||||||
<Forms.Section title="<?= lang('Podcast.form.premium') ?>">
|
<Forms.Section title="<?= lang('Podcast.form.premium') ?>">
|
||||||
<Forms.Toggler class="mt-2" name="premium_by_default" value="yes" checked="<?= $podcast->is_premium_by_default ? 'true' : 'false' ?>" hint="<?= lang('Podcast.form.premium_by_default_hint') ?>">
|
<Forms.Toggler class="mt-2" name="premium_by_default" value="yes" checked="<?= $podcast->is_premium_by_default ? 'true' : 'false' ?>" hint="<?= lang('Podcast.form.premium_by_default_hint') ?>">
|
||||||
<?= lang('Podcast.form.premium_by_default') ?></Forms.Toggler>
|
<?= lang('Podcast.form.premium_by_default') ?></Forms.Toggler>
|
||||||
|
Loading…
Reference in New Issue
Block a user