mirror of
https://code.castopod.org/adaures/castopod
synced 2025-06-06 18:31:05 +00:00
fix(admin-ui): remove button labels on smaller screens in podcast view
- update components renderer regex to include special characters - fix itunes_explicit mapping during import
This commit is contained in:
parent
16a3fdb56e
commit
9cc5ffd143
@ -96,7 +96,7 @@ class ComponentRenderer
|
|||||||
|
|
||||||
private function renderPairedTags(string $output): string
|
private function renderPairedTags(string $output): string
|
||||||
{
|
{
|
||||||
$pattern = '/<\s*(?<name>[A-Z][A-Za-z0-9\.]*?)(?<attributes>[\s\S\=\'\"]*)>(?<slot>.*)<\/\s*\1\s*>/uUsm';
|
$pattern = '/<\s*(?<name>[A-Z][A-Za-z0-9\.]*?)(?<attributes>(\s*[\w\-]+\s*=\s*(\'[^\']*\'|\"[^\"]*\"))+\s*)>(?<slot>.*)<\/\s*\1\s*>/uUsm';
|
||||||
ini_set('pcre.backtrack_limit', '-1');
|
ini_set('pcre.backtrack_limit', '-1');
|
||||||
/*
|
/*
|
||||||
$matches[0] = full tags matched and all of its content
|
$matches[0] = full tags matched and all of its content
|
||||||
|
@ -81,6 +81,10 @@ class Button extends Component
|
|||||||
unset($this->attributes['class']);
|
unset($this->attributes['class']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->iconLeft !== '' || $this->iconRight !== '') {
|
||||||
|
$this->slot = '<span>' . $this->slot . '</span>';
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->iconLeft !== '') {
|
if ($this->iconLeft !== '') {
|
||||||
$this->slot = (new Icon([
|
$this->slot = (new Icon([
|
||||||
'glyph' => $this->iconLeft,
|
'glyph' => $this->iconLeft,
|
||||||
|
@ -209,6 +209,11 @@ class PodcastImport extends BaseCommand
|
|||||||
throw new Exception('Missing podcast cover. Please include an <itunes:image> tag');
|
throw new Exception('Missing podcast cover. Please include an <itunes:image> tag');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$parentalAdvisory = null;
|
||||||
|
if ($this->podcastFeed->channel->itunes_explicit->getValue() !== null) {
|
||||||
|
$parentalAdvisory = $this->podcastFeed->channel->itunes_explicit->getValue() ? 'explicit' : 'clean';
|
||||||
|
}
|
||||||
|
|
||||||
$htmlConverter = new HtmlConverter();
|
$htmlConverter = new HtmlConverter();
|
||||||
$podcast = new Podcast([
|
$podcast = new Podcast([
|
||||||
'created_by' => $this->user->id,
|
'created_by' => $this->user->id,
|
||||||
@ -224,7 +229,7 @@ class PodcastImport extends BaseCommand
|
|||||||
'banner' => null,
|
'banner' => null,
|
||||||
'language_code' => $this->importTask->language,
|
'language_code' => $this->importTask->language,
|
||||||
'category_id' => $this->importTask->category,
|
'category_id' => $this->importTask->category,
|
||||||
'parental_advisory' => $this->podcastFeed->channel->itunes_explicit->getValue(),
|
'parental_advisory' => $parentalAdvisory,
|
||||||
'owner_name' => $this->podcastFeed->channel->itunes_owner->itunes_name->getValue(),
|
'owner_name' => $this->podcastFeed->channel->itunes_owner->itunes_name->getValue(),
|
||||||
'owner_email' => $this->podcastFeed->channel->itunes_owner->itunes_email->getValue(),
|
'owner_email' => $this->podcastFeed->channel->itunes_owner->itunes_email->getValue(),
|
||||||
'publisher' => $this->podcastFeed->channel->itunes_author->getValue(),
|
'publisher' => $this->podcastFeed->channel->itunes_author->getValue(),
|
||||||
@ -439,6 +444,11 @@ class PodcastImport extends BaseCommand
|
|||||||
|
|
||||||
$coverUrl = $this->getCoverUrl($item);
|
$coverUrl = $this->getCoverUrl($item);
|
||||||
|
|
||||||
|
$parentalAdvisory = null;
|
||||||
|
if ($item->itunes_explicit->getValue() !== null) {
|
||||||
|
$parentalAdvisory = $item->itunes_explicit->getValue() ? 'explicit' : 'clean';
|
||||||
|
}
|
||||||
|
|
||||||
$episode = new Episode([
|
$episode = new Episode([
|
||||||
'created_by' => $this->user->id,
|
'created_by' => $this->user->id,
|
||||||
'updated_by' => $this->user->id,
|
'updated_by' => $this->user->id,
|
||||||
@ -455,7 +465,7 @@ class PodcastImport extends BaseCommand
|
|||||||
'description_markdown' => $htmlConverter->convert($showNotes),
|
'description_markdown' => $htmlConverter->convert($showNotes),
|
||||||
'description_html' => $showNotes,
|
'description_html' => $showNotes,
|
||||||
'cover' => $coverUrl ? download_file($coverUrl) : null,
|
'cover' => $coverUrl ? download_file($coverUrl) : null,
|
||||||
'parental_advisory' => $item->itunes_explicit->getValue(),
|
'parental_advisory' => $parentalAdvisory,
|
||||||
'number' => $item->itunes_episode->getValue(),
|
'number' => $item->itunes_episode->getValue(),
|
||||||
'season_number' => $item->itunes_season->getValue(),
|
'season_number' => $item->itunes_season->getValue(),
|
||||||
'type' => $item->itunes_episodeType->getValue(),
|
'type' => $item->itunes_episodeType->getValue(),
|
||||||
|
@ -16,7 +16,7 @@ $userPodcasts = get_podcasts_user_can_interact_with(auth()->user()); ?>
|
|||||||
'home',
|
'home',
|
||||||
) ?>" class="inline-flex items-center h-full px-2 text-sm font-semibold sm:px-6 hover:underline focus:ring-inset focus:ring-accent" title="<?= lang('Navigation.go_to_website') ?>">
|
) ?>" class="inline-flex items-center h-full px-2 text-sm font-semibold sm:px-6 hover:underline focus:ring-inset focus:ring-accent" title="<?= lang('Navigation.go_to_website') ?>">
|
||||||
<span class="hidden sm:block"><?= lang('Navigation.go_to_website') ?></span>
|
<span class="hidden sm:block"><?= lang('Navigation.go_to_website') ?></span>
|
||||||
<?= icon('external-link', 'ml-1 text-xl sm:opacity-60') ?>
|
<?= icon('external-link', 'sm:ml-1 text-xl sm:text-base sm:opacity-60') ?>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="inline-flex items-center h-full ml-auto">
|
<div class="inline-flex items-center h-full ml-auto">
|
||||||
|
@ -9,8 +9,8 @@
|
|||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
<?= $this->section('headerRight') ?>
|
<?= $this->section('headerRight') ?>
|
||||||
<Button uri="<?= route_to('podcast-edit', $podcast->id) ?>" variant="secondary" iconLeft="edit"><?= lang('Podcast.edit') ?></Button>
|
<Button uri="<?= route_to('podcast-edit', $podcast->id) ?>" variant="secondary" class="[&>span]:hidden [&>span]:md:block py-3 md:py-2" iconLeft="edit"><?= lang('Podcast.edit') ?></Button>
|
||||||
<Button uri="<?= route_to('episode-create', $podcast->id) ?>" variant="primary" iconLeft="add"><?= lang('Episode.create') ?></Button>
|
<Button uri="<?= route_to('episode-create', $podcast->id) ?>" variant="primary" class="[&>span]:hidden [&>span]:md:block py-3 md:py-2" iconLeft="add"><?= lang('Episode.create') ?></Button>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user