Commit 3b3c218b authored by Yassine Doghri's avatar Yassine Doghri
Browse files

fix(episode-form): show warning to set `memory_limit`, `upload_max_filesize` & `post_max_size`

remove undefined "my-podcasts" route

closes #5, #86
parent c37a4af2
Loading
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -90,10 +90,6 @@ $routes->group(
            'as' => 'admin',
        ]);

        $routes->get('my-podcasts', 'Podcast::myPodcasts', [
            'as' => 'my-podcasts',
        ]);

        $routes->group('persons', function ($routes) {
            $routes->get('/', 'Person', [
                'as' => 'person-list',
+4 −4
Original line number Diff line number Diff line
@@ -111,8 +111,8 @@ class Episode extends BaseController
            'enclosure' => 'uploaded[enclosure]|ext_in[enclosure,mp3,m4a]',
            'image' =>
                'is_image[image]|ext_in[image,jpg,png]|min_dims[image,1400,1400]|is_image_squared[image]',
            'transcript' => 'ext_in[transcript,txt,html,srt,json]',
            'chapters' => 'ext_in[chapters,json]',
            'transcript' => 'ext_in[transcript,txt,html,srt,json]|permit_empty',
            'chapters' => 'ext_in[chapters,json]|permit_empty',
        ];

        if (!$this->validate($rules)) {
@@ -205,8 +205,8 @@ class Episode extends BaseController
                'uploaded[enclosure]|ext_in[enclosure,mp3,m4a]|permit_empty',
            'image' =>
                'is_image[image]|ext_in[image,jpg,png]|min_dims[image,1400,1400]|is_image_squared[image]',
            'transcript' => 'ext_in[transcript,txt,html,srt,json]',
            'chapters' => 'ext_in[chapters,json]',
            'transcript' => 'ext_in[transcript,txt,html,srt,json]|permit_empty',
            'chapters' => 'ext_in[chapters,json]|permit_empty',
        ];

        if (!$this->validate($rules)) {
+2 −0
Original line number Diff line number Diff line
@@ -43,6 +43,8 @@ return [
        'not_published' => 'Not published',
    ],
    'form' => [
        'warning' =>
            'In case of fatal error, try increasing the `memory_limit`, `upload_max_filesize` and `post_max_size` values in your php configuration file then restart your web server.<br />These values must be higher than the audio file you wish to upload.',
        'enclosure' => 'Audio file',
        'enclosure_hint' => 'Choose an .mp3 or .m4a audio file.',
        'info_section_title' => 'Episode info',
+2 −0
Original line number Diff line number Diff line
@@ -43,6 +43,8 @@ return [
        'not_published' => 'Non publié',
    ],
    'form' => [
        'warning' =>
            'En cas d’erreur fatale, essayez d’augmenter les valeurs de `memory_limit`, `upload_max_filesize` et `post_max_size` dans votre fichier de configuration php puis redémarrez votre serveur web.<br />Les valeurs doivent être plus grandes que le fichier audio que vous souhaitez téléverser.',
        'enclosure' => 'Fichier audio',
        'enclosure_hint' => 'Sélectionnez un fichier audio .mp3 ou .m4a.',
        'info_section_title' => 'Informations épisode',
+34 −29
Original line number Diff line number Diff line
@@ -18,16 +18,21 @@
<?= csrf_field() ?>
<?= form_hidden('client_timezone', 'UTC') ?>

<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'),
    lang('Episode.form.info_section_subtitle')
    lang('Episode.form.info_section_subtitle'),
) ?>

<?= form_label(
    lang('Episode.form.enclosure'),
    'enclosure',
    [],
    lang('Episode.form.enclosure_hint')
    lang('Episode.form.enclosure_hint'),
) ?>
<?= form_input([
    'id' => 'enclosure',
@@ -43,7 +48,7 @@
    'image',
    [],
    lang('Episode.form.image_hint'),
    true
    true,
) ?>
<?= form_input([
    'id' => 'image',
@@ -53,14 +58,14 @@
    'accept' => '.jpg,.jpeg,.png',
]) ?>
<small class="mb-4 text-gray-600"><?= lang(
    'Common.forms.image_size_hint'
    'Common.forms.image_size_hint',
) ?></small>

<?= form_label(
    lang('Episode.form.title'),
    'title',
    [],
    lang('Episode.form.title_hint')
    lang('Episode.form.title_hint'),
) ?>
<?= form_input([
    'id' => 'title',
@@ -75,7 +80,7 @@
    lang('Episode.form.slug'),
    'slug',
    [],
    lang('Episode.form.slug_hint')
    lang('Episode.form.slug_hint'),
) ?>
<?= form_input([
    'id' => 'slug',
@@ -118,7 +123,7 @@
    <?= form_radio(
        ['id' => 'full', 'name' => 'type', 'class' => 'form-radio-btn'],
        'full',
        old('type') ? old('type') == 'full' : true
        old('type') ? old('type') == 'full' : true,
    ) ?>
    <label for="full" class="inline-flex items-center">
        <?= lang('Episode.form.type.full') ?>
@@ -126,7 +131,7 @@
    <?= form_radio(
        ['id' => 'trailer', 'name' => 'type', 'class' => 'form-radio-btn'],
        'trailer',
        old('type') ? old('type') == 'trailer' : false
        old('type') ? old('type') == 'trailer' : false,
    ) ?>
    <label for="trailer" class="inline-flex items-center">
        <?= lang('Episode.form.type.trailer') ?>
@@ -134,7 +139,7 @@
    <?= form_radio(
        ['id' => 'bonus', 'name' => 'type', 'class' => 'form-radio-btn'],
        'bonus',
        old('type') ? old('type') == 'bonus' : false
        old('type') ? old('type') == 'bonus' : false,
    ) ?>
    <label for="bonus" class="inline-flex items-center">
        <?= lang('Episode.form.type.bonus') ?>
@@ -155,10 +160,10 @@
        'undefined',
        old('parental_advisory')
            ? old('parental_advisory') === 'undefined'
            : true
            : true,
    ) ?>
    <label for="undefined"><?= lang(
        'Episode.form.parental_advisory.undefined'
        'Episode.form.parental_advisory.undefined',
    ) ?></label>
    <?= form_radio(
        [
@@ -167,10 +172,10 @@
            'class' => 'form-radio-btn',
        ],
        'clean',
        old('parental_advisory') ? old('parental_advisory') === 'clean' : false
        old('parental_advisory') ? old('parental_advisory') === 'clean' : false,
    ) ?>
    <label for="clean"><?= lang(
        'Episode.form.parental_advisory.clean'
        'Episode.form.parental_advisory.clean',
    ) ?></label>
    <?= form_radio(
        [
@@ -181,10 +186,10 @@
        'explicit',
        old('parental_advisory')
            ? old('parental_advisory') === 'explicit'
            : false
            : false,
    ) ?>
    <label for="explicit"><?= lang(
        'Episode.form.parental_advisory.explicit'
        'Episode.form.parental_advisory.explicit',
    ) ?></label>
<?= form_fieldset_close() ?>

@@ -193,7 +198,7 @@

<?= form_section(
    lang('Episode.form.show_notes_section_title'),
    lang('Episode.form.show_notes_section_subtitle')
    lang('Episode.form.show_notes_section_subtitle'),
) ?>

<div class="mb-4">
@@ -206,7 +211,7 @@
            'required' => 'required',
        ],
        old('description', '', false),
        'data-editor="markdown"'
        'data-editor="markdown"',
    ) ?>
</div>

@@ -215,7 +220,7 @@
        lang('Episode.form.description_footer'),
        'description_footer',
        [],
        lang('Episode.form.description_footer_hint')
        lang('Episode.form.description_footer_hint'),
    ) ?>
    <?= form_textarea(
        [
@@ -226,9 +231,9 @@
        old(
            'description_footer',
            $podcast->episode_description_footer_markdown ?? '',
            false
            false,
        ),
        'data-editor="markdown"'
        'data-editor="markdown"',
    ) ?>
</div>

@@ -236,7 +241,7 @@

<?= form_section(
    lang('Episode.form.location_section_title'),
    lang('Episode.form.location_section_subtitle')
    lang('Episode.form.location_section_subtitle'),
) ?>

<?= form_label(
@@ -244,7 +249,7 @@
    'location_name',
    [],
    lang('Episode.form.location_name_hint'),
    true
    true,
) ?>
<?= form_input([
    'id' => 'location_name',
@@ -256,14 +261,14 @@

<?= form_section(
    lang('Episode.form.additional_files_section_title'),
    lang('Episode.form.additional_files_section_subtitle')
    lang('Episode.form.additional_files_section_subtitle'),
) ?>
<?= form_label(
    lang('Episode.form.transcript'),
    'transcript',
    [],
    lang('Episode.form.transcript_hint'),
    true
    true,
) ?>
<?= form_input([
    'id' => 'transcript',
@@ -277,7 +282,7 @@
    'chapters',
    [],
    lang('Episode.form.chapters_hint'),
    true
    true,
) ?>
<?= form_input([
    'id' => 'chapters',
@@ -290,14 +295,14 @@

<?= form_section(
    lang('Episode.form.advanced_section_title'),
    lang('Episode.form.advanced_section_subtitle')
    lang('Episode.form.advanced_section_subtitle'),
) ?>
<?= form_label(
    lang('Episode.form.custom_rss'),
    'custom_rss',
    [],
    lang('Episode.form.custom_rss_hint'),
    true
    true,
) ?>
<?= form_textarea([
    'id' => 'custom_rss',
@@ -312,14 +317,14 @@
        hint_tooltip(lang('Episode.form.block_hint'), 'ml-1'),
    ['id' => 'block', 'name' => 'block'],
    'yes',
    old('block', false)
    old('block', false),
) ?>

<?= button(
    lang('Episode.form.submit_create'),
    null,
    ['variant' => 'primary'],
    ['type' => 'submit', 'class' => 'self-end']
    ['type' => 'submit', 'class' => 'self-end'],
) ?>

<?= form_close() ?>
Loading