Loading app/Resources/js/modules/permalink-edit.ts +6 −1 Original line number Diff line number Diff line Loading @@ -25,6 +25,9 @@ export class PermalinkEdit extends LitElement { @property({ attribute: "copy-label" }) copyLabel = "Copy"; @property({ attribute: "permalink-base" }) permalinkBase = ""; @state() isEditable = false; Loading Loading @@ -68,6 +71,8 @@ export class PermalinkEdit extends LitElement { } firstUpdated(): void { this.permalinkBase += this.permalinkBase.endsWith("/") ? "" : "/"; // set permalink value this.setPermalink(); Loading Loading @@ -130,7 +135,7 @@ export class PermalinkEdit extends LitElement { } setPermalink(): void { this.permalink = this._domain[0].innerHTML + this._slugInput[0].value; this.permalink = this.permalinkBase + this._slugInput[0].value; } static styles = css` Loading modules/Admin/Controllers/EpisodeController.php +2 −0 Original line number Diff line number Diff line Loading @@ -135,6 +135,7 @@ class EpisodeController extends BaseController public function attemptCreate(): RedirectResponse { $rules = [ 'slug' => 'max_length[128]', 'audio_file' => 'uploaded[audio_file]|ext_in[audio_file,mp3,m4a]', 'cover' => 'is_image[cover]|ext_in[cover,jpg,png]|min_dims[cover,1400,1400]|is_image_ratio[cover,1,1]', Loading Loading @@ -272,6 +273,7 @@ class EpisodeController extends BaseController public function attemptEdit(): RedirectResponse { $rules = [ 'slug' => 'max_length[128]', 'audio_file' => 'uploaded[audio_file]|ext_in[audio_file,mp3,m4a]|permit_empty', 'cover' => Loading themes/cp_admin/episode/create.php +2 −2 Original line number Diff line number Diff line Loading @@ -45,8 +45,8 @@ <div> <Forms.Label for="slug"><?= lang('Episode.form.permalink') ?></Forms.Label> <permalink-edit class="inline-flex items-center text-xs" edit-label="<?= lang('Common.edit') ?>" copy-label="<?= lang('Common.copy') ?>" copied-label="<?= lang('Common.copied') ?>"> <span slot="domain"><?= base_url('/@' . esc($podcast->handle) . '/episodes') . '/' ?></span> <permalink-edit class="inline-flex items-center w-full text-xs" edit-label="<?= lang('Common.edit') ?>" copy-label="<?= lang('Common.copy') ?>" copied-label="<?= lang('Common.copied') ?>" permalink-base="<?= url_to('podcast-episodes', $podcast->handle) ?>"> <span slot="domain"><?= '…/' . esc($podcast->at_handle) . '/' ?></span> <Forms.Input name="slug" required="true" data-slugify="slug" slot="slug-input" class="flex-1 text-xs" /> </permalink-edit> </div> Loading themes/cp_admin/episode/edit.php +2 −2 Original line number Diff line number Diff line Loading @@ -49,8 +49,8 @@ <div> <Forms.Label for="slug"><?= lang('Episode.form.permalink') ?></Forms.Label> <permalink-edit class="inline-flex items-center text-xs" edit-label="<?= lang('Common.edit') ?>" copy-label="<?= lang('Common.copy') ?>" copied-label="<?= lang('Common.copied') ?>"> <span slot="domain"><?= base_url('/@' . esc($podcast->handle) . '/episodes') . '/' ?></span> <permalink-edit class="inline-flex items-center w-full text-xs" edit-label="<?= lang('Common.edit') ?>" copy-label="<?= lang('Common.copy') ?>" copied-label="<?= lang('Common.copied') ?>" permalink-base="<?= url_to('podcast-episodes', esc($podcast->handle)) ?>"> <span slot="domain"><?= '…/' . esc($podcast->handle) . '/' ?></span> <Forms.Input name="slug" value="<?= esc($episode->slug) ?>" required="true" data-slugify="slug" slot="slug-input" class="flex-1 text-xs" /> </permalink-edit> </div> Loading themes/cp_admin/page/create.php +2 −2 Original line number Diff line number Diff line Loading @@ -23,8 +23,8 @@ <div class="flex flex-col max-w-sm"> <Forms.Label for="slug"><?= lang('Page.form.permalink') ?></Forms.Label> <permalink-edit class="inline-flex items-center text-xs" edit-label="<?= lang('Common.edit') ?>" copy-label="<?= lang('Common.copy') ?>" copied-label="<?= lang('Common.copied') ?>"> <span slot="domain" class="flex-shrink-0"><?= base_url('pages') . '/' ?></span> <permalink-edit class="inline-flex items-center w-full text-xs" edit-label="<?= lang('Common.edit') ?>" copy-label="<?= lang('Common.copy') ?>" copied-label="<?= lang('Common.copied') ?>" permalink-base="<?= base_url('pages') ?>"> <span slot="domain" class="flex-shrink-0">…/pages/</span> <Forms.Input name="slug" required="true" data-slugify="slug" slot="slug-input" class="flex-1 text-xs" /> </permalink-edit> </div> Loading Loading
app/Resources/js/modules/permalink-edit.ts +6 −1 Original line number Diff line number Diff line Loading @@ -25,6 +25,9 @@ export class PermalinkEdit extends LitElement { @property({ attribute: "copy-label" }) copyLabel = "Copy"; @property({ attribute: "permalink-base" }) permalinkBase = ""; @state() isEditable = false; Loading Loading @@ -68,6 +71,8 @@ export class PermalinkEdit extends LitElement { } firstUpdated(): void { this.permalinkBase += this.permalinkBase.endsWith("/") ? "" : "/"; // set permalink value this.setPermalink(); Loading Loading @@ -130,7 +135,7 @@ export class PermalinkEdit extends LitElement { } setPermalink(): void { this.permalink = this._domain[0].innerHTML + this._slugInput[0].value; this.permalink = this.permalinkBase + this._slugInput[0].value; } static styles = css` Loading
modules/Admin/Controllers/EpisodeController.php +2 −0 Original line number Diff line number Diff line Loading @@ -135,6 +135,7 @@ class EpisodeController extends BaseController public function attemptCreate(): RedirectResponse { $rules = [ 'slug' => 'max_length[128]', 'audio_file' => 'uploaded[audio_file]|ext_in[audio_file,mp3,m4a]', 'cover' => 'is_image[cover]|ext_in[cover,jpg,png]|min_dims[cover,1400,1400]|is_image_ratio[cover,1,1]', Loading Loading @@ -272,6 +273,7 @@ class EpisodeController extends BaseController public function attemptEdit(): RedirectResponse { $rules = [ 'slug' => 'max_length[128]', 'audio_file' => 'uploaded[audio_file]|ext_in[audio_file,mp3,m4a]|permit_empty', 'cover' => Loading
themes/cp_admin/episode/create.php +2 −2 Original line number Diff line number Diff line Loading @@ -45,8 +45,8 @@ <div> <Forms.Label for="slug"><?= lang('Episode.form.permalink') ?></Forms.Label> <permalink-edit class="inline-flex items-center text-xs" edit-label="<?= lang('Common.edit') ?>" copy-label="<?= lang('Common.copy') ?>" copied-label="<?= lang('Common.copied') ?>"> <span slot="domain"><?= base_url('/@' . esc($podcast->handle) . '/episodes') . '/' ?></span> <permalink-edit class="inline-flex items-center w-full text-xs" edit-label="<?= lang('Common.edit') ?>" copy-label="<?= lang('Common.copy') ?>" copied-label="<?= lang('Common.copied') ?>" permalink-base="<?= url_to('podcast-episodes', $podcast->handle) ?>"> <span slot="domain"><?= '…/' . esc($podcast->at_handle) . '/' ?></span> <Forms.Input name="slug" required="true" data-slugify="slug" slot="slug-input" class="flex-1 text-xs" /> </permalink-edit> </div> Loading
themes/cp_admin/episode/edit.php +2 −2 Original line number Diff line number Diff line Loading @@ -49,8 +49,8 @@ <div> <Forms.Label for="slug"><?= lang('Episode.form.permalink') ?></Forms.Label> <permalink-edit class="inline-flex items-center text-xs" edit-label="<?= lang('Common.edit') ?>" copy-label="<?= lang('Common.copy') ?>" copied-label="<?= lang('Common.copied') ?>"> <span slot="domain"><?= base_url('/@' . esc($podcast->handle) . '/episodes') . '/' ?></span> <permalink-edit class="inline-flex items-center w-full text-xs" edit-label="<?= lang('Common.edit') ?>" copy-label="<?= lang('Common.copy') ?>" copied-label="<?= lang('Common.copied') ?>" permalink-base="<?= url_to('podcast-episodes', esc($podcast->handle)) ?>"> <span slot="domain"><?= '…/' . esc($podcast->handle) . '/' ?></span> <Forms.Input name="slug" value="<?= esc($episode->slug) ?>" required="true" data-slugify="slug" slot="slug-input" class="flex-1 text-xs" /> </permalink-edit> </div> Loading
themes/cp_admin/page/create.php +2 −2 Original line number Diff line number Diff line Loading @@ -23,8 +23,8 @@ <div class="flex flex-col max-w-sm"> <Forms.Label for="slug"><?= lang('Page.form.permalink') ?></Forms.Label> <permalink-edit class="inline-flex items-center text-xs" edit-label="<?= lang('Common.edit') ?>" copy-label="<?= lang('Common.copy') ?>" copied-label="<?= lang('Common.copied') ?>"> <span slot="domain" class="flex-shrink-0"><?= base_url('pages') . '/' ?></span> <permalink-edit class="inline-flex items-center w-full text-xs" edit-label="<?= lang('Common.edit') ?>" copy-label="<?= lang('Common.copy') ?>" copied-label="<?= lang('Common.copied') ?>" permalink-base="<?= base_url('pages') ?>"> <span slot="domain" class="flex-shrink-0">…/pages/</span> <Forms.Input name="slug" required="true" data-slugify="slug" slot="slug-input" class="flex-1 text-xs" /> </permalink-edit> </div> Loading