Commit 1861d679 authored by Yassine Doghri's avatar Yassine Doghri
Browse files

fix(podcast-form): move fediverse section below author section

parent 18e2633a
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -688,4 +688,16 @@ class Episode extends Entity

        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);
    }
}
+10 −0
Original line number Diff line number Diff line
@@ -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
    {
        cache()
+5 −3
Original line number Diff line number Diff line
@@ -8,6 +8,8 @@ $episodeNavigation = [
    'clips' => [
        'icon'        => 'clapperboard',
        'items'       => ['video-clips-list', 'video-clips-create', 'soundbites-list', 'soundbites-create'],
        'count'       => $episode->getClipCount(),
        'count-route' => 'video-clips-list',
        'add-cta'     => 'video-clips-create',
    ],
]; ?>
+19 −21
Original line number Diff line number Diff line
@@ -56,27 +56,6 @@
            isChecked="false" ><?= lang('Podcast.form.type.serial') ?></Forms.RadioButton>
    </div>
</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
@@ -153,6 +132,25 @@

</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.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>
+20 −21
Original line number Diff line number Diff line
@@ -78,27 +78,6 @@
            isChecked="<?= $podcast->type === 'serial' ? 'true' : 'false' ?>" ><?= lang('Podcast.form.type.serial') ?></Forms.RadioButton>
    </div>
</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
@@ -181,6 +160,26 @@

</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.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>