From 381107a4380496e38cea6c8437e103ab6d7ac02a Mon Sep 17 00:00:00 2001 From: Yassine Doghri Date: Fri, 26 Apr 2024 17:26:55 +0000 Subject: [PATCH] fix: update php-icons to set default icons for platforms icons --- app/Helpers/components_helper.php | 6 +- app/Resources/icons/funding/_index.php | 20 +++++ app/Resources/icons/funding/donorbox.svg | 5 +- app/Resources/icons/podcasting/_index.php | 58 ++++++++++++ .../icons/podcasting/episodes-fm.svg | 2 +- app/Resources/icons/podcasting/truefans.svg | 2 +- app/Resources/icons/social/_index.php | 28 ++++++ app/Resources/icons/social/telegram.svg | 4 +- composer.json | 7 +- composer.lock | 14 +-- php-icons.php | 5 ++ themes/cp_admin/episode/embed.php | 2 + themes/cp_admin/episode/video_clips_list.php | 13 +-- themes/cp_admin/import/_queue_table.php | 12 +-- themes/cp_admin/podcast/_platform.php | 11 ++- themes/cp_admin/podcast/platforms.php | 89 ------------------- themes/cp_app/podcast/_partials/sidebar.php | 6 +- themes/cp_app/post/post.php | 4 +- 18 files changed, 156 insertions(+), 132 deletions(-) create mode 100644 app/Resources/icons/funding/_index.php create mode 100644 app/Resources/icons/podcasting/_index.php create mode 100644 app/Resources/icons/social/_index.php diff --git a/app/Helpers/components_helper.php b/app/Helpers/components_helper.php index 5837f0b5..9af72667 100644 --- a/app/Helpers/components_helper.php +++ b/app/Helpers/components_helper.php @@ -156,20 +156,20 @@ if (! function_exists('publication_button')) { $label = lang('Episode.publish'); $route = route_to('episode-publish', $podcastId, $episodeId); $variant = 'primary'; - $iconLeft = 'upload-cloud-fill'; + $iconLeft = 'upload-cloud-fill'; // @icon('upload-cloud-fill') break; case 'with_podcast': case 'scheduled': $label = lang('Episode.publish_edit'); $route = route_to('episode-publish_edit', $podcastId, $episodeId); $variant = 'warning'; - $iconLeft = 'upload-cloud-fill'; + $iconLeft = 'upload-cloud-fill'; // @icon('upload-cloud-fill') break; case 'published': $label = lang('Episode.unpublish'); $route = route_to('episode-unpublish', $podcastId, $episodeId); $variant = 'danger'; - $iconLeft = 'cloud-off-fill'; + $iconLeft = 'cloud-off-fill'; // @icon('cloud-off-fill') break; default: $label = ''; diff --git a/app/Resources/icons/funding/_index.php b/app/Resources/icons/funding/_index.php new file mode 100644 index 00000000..4b794349 --- /dev/null +++ b/app/Resources/icons/funding/_index.php @@ -0,0 +1,20 @@ + - - - + \ No newline at end of file diff --git a/app/Resources/icons/podcasting/_index.php b/app/Resources/icons/podcasting/_index.php new file mode 100644 index 00000000..dab636a5 --- /dev/null +++ b/app/Resources/icons/podcasting/_index.php @@ -0,0 +1,58 @@ + + \ No newline at end of file diff --git a/app/Resources/icons/podcasting/truefans.svg b/app/Resources/icons/podcasting/truefans.svg index 63ad8fc7..e8aa9c14 100644 --- a/app/Resources/icons/podcasting/truefans.svg +++ b/app/Resources/icons/podcasting/truefans.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/app/Resources/icons/social/_index.php b/app/Resources/icons/social/_index.php new file mode 100644 index 00000000..4e6a94ac --- /dev/null +++ b/app/Resources/icons/social/_index.php @@ -0,0 +1,28 @@ + - - \ No newline at end of file + \ No newline at end of file diff --git a/composer.json b/composer.json index 3c885da5..ec81313c 100644 --- a/composer.json +++ b/composer.json @@ -63,13 +63,15 @@ "style": "vendor/bin/ecs check --ansi", "style:fix": "vendor/bin/ecs check --fix --ansi", "generate:auth-docs": "php spark auth:generate-docs", + "php-icons": "vendor/bin/php-icons scan", "post-install-cmd": [ "@php vendor/opawg/user-agents-v2-php/src/UserAgentsGenerate.php > vendor/opawg/user-agents-v2-php/src/UserAgents.php", "@php vendor/opawg/user-agents-v2-php/src/UserAgentsRSSGenerate.php > vendor/opawg/user-agents-v2-php/src/UserAgentsRSS.php", "@php vendor/adaures/ipcat-php/src/IpDbGenerate.php > vendor/adaures/ipcat-php/src/IpDb.php", "@php vendor/adaures/podcast-persons-taxonomy/src/TaxonomyGenerate.php https://raw.githubusercontent.com/Podcastindex-org/podcast-namespace/main/taxonomy-en.json > modules/Admin/Language/en/PersonsTaxonomy.php", "@php vendor/adaures/podcast-persons-taxonomy/src/TaxonomyGenerate.php https://raw.githubusercontent.com/Podcastindex-org/podcast-namespace/main/taxonomy-fr.json > modules/Admin/Language/fr/PersonsTaxonomy.php", - "@php vendor/adaures/podcast-persons-taxonomy/src/ReversedTaxonomyGenerate.php https://raw.githubusercontent.com/Podcastindex-org/podcast-namespace/main/taxonomy-en.json > vendor/adaures/podcast-persons-taxonomy/src/ReversedTaxonomy.php" + "@php vendor/adaures/podcast-persons-taxonomy/src/ReversedTaxonomyGenerate.php https://raw.githubusercontent.com/Podcastindex-org/podcast-namespace/main/taxonomy-en.json > vendor/adaures/podcast-persons-taxonomy/src/ReversedTaxonomy.php", + "vendor/bin/php-icons init && vendor/bin/php-icons scan" ], "post-update-cmd": [ "@composer dump-autoload", @@ -78,7 +80,8 @@ "@php vendor/adaures/ipcat-php/src/IpDbGenerate.php > vendor/adaures/ipcat-php/src/IpDb.php", "@php vendor/adaures/podcast-persons-taxonomy/src/TaxonomyGenerate.php https://raw.githubusercontent.com/Podcastindex-org/podcast-namespace/main/taxonomy-en.json > modules/Admin/Language/en/PersonsTaxonomy.php", "@php vendor/adaures/podcast-persons-taxonomy/src/TaxonomyGenerate.php https://raw.githubusercontent.com/Podcastindex-org/podcast-namespace/main/taxonomy-fr.json > modules/Admin/Language/fr/PersonsTaxonomy.php", - "@php vendor/adaures/podcast-persons-taxonomy/src/ReversedTaxonomyGenerate.php https://raw.githubusercontent.com/Podcastindex-org/podcast-namespace/main/taxonomy-en.json > vendor/adaures/podcast-persons-taxonomy/src/ReversedTaxonomy.php" + "@php vendor/adaures/podcast-persons-taxonomy/src/ReversedTaxonomyGenerate.php https://raw.githubusercontent.com/Podcastindex-org/podcast-namespace/main/taxonomy-en.json > vendor/adaures/podcast-persons-taxonomy/src/ReversedTaxonomy.php", + "vendor/bin/php-icons init && vendor/bin/php-icons scan" ] }, "support": { diff --git a/composer.lock b/composer.lock index 6a334b6c..fdc0a69b 100644 --- a/composer.lock +++ b/composer.lock @@ -3341,23 +3341,23 @@ "source": { "type": "git", "url": "https://github.com/yassinedoghri/php-icons.git", - "reference": "d3713f7a902997912a309de2d594fb61abb9d351" + "reference": "976acbd9564f5ba13b11f4086c59b007a9374a4e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/yassinedoghri/php-icons/zipball/d3713f7a902997912a309de2d594fb61abb9d351", - "reference": "d3713f7a902997912a309de2d594fb61abb9d351", + "url": "https://api.github.com/repos/yassinedoghri/php-icons/zipball/976acbd9564f5ba13b11f4086c59b007a9374a4e", + "reference": "976acbd9564f5ba13b11f4086c59b007a9374a4e", "shasum": "" }, "require": { - "adhocore/cli": "^v1.0", + "adhocore/cli": "^v1.7.1", "composer-runtime-api": "^2.2", "nikic/php-parser": "^v4.0", "php": ">=8.1" }, "require-dev": { - "kint-php/kint": "^5.1.0", - "phpstan/phpstan": "^1.10.66", + "kint-php/kint": "^5.1.1", + "phpstan/phpstan": "^1.10.67", "rector/rector": "^1.0.4", "symplify/coding-standard": "^12.1.4", "symplify/easy-coding-standard": "^12.1.14" @@ -3385,7 +3385,7 @@ "issues": "https://github.com/yassinedoghri/php-icons/issues", "source": "https://github.com/yassinedoghri/php-icons/tree/develop" }, - "time": "2024-04-09T22:04:14+00:00" + "time": "2024-04-26T15:47:20+00:00" }, { "name": "yassinedoghri/podcast-feed", diff --git a/php-icons.php b/php-icons.php index b98a8437..64c626a3 100644 --- a/php-icons.php +++ b/php-icons.php @@ -11,5 +11,10 @@ return PHPIconsConfig::configure() 'podcasting' => __DIR__ . '/app/Resources/icons/podcasting', 'social' => __DIR__ . '/app/Resources/icons/social', ]) + ->withDefaultIconPerSet([ + 'funding' => 'funding:default', + 'podcasting' => 'podcasting:default', + 'social' => 'social:default', + ]) ->withDefaultPrefix('ri') ->withPlaceholder('�'); diff --git a/themes/cp_admin/episode/embed.php b/themes/cp_admin/episode/embed.php index aae90743..354de34c 100644 --- a/themes/cp_admin/episode/embed.php +++ b/themes/cp_admin/episode/embed.php @@ -36,11 +36,13 @@ $embedHeight = config(Embed::class)->height;
embed_url}\">") ?>" /> +
+
diff --git a/themes/cp_admin/episode/video_clips_list.php b/themes/cp_admin/episode/video_clips_list.php index 26a32de1..2a0e075c 100644 --- a/themes/cp_admin/episode/video_clips_list.php +++ b/themes/cp_admin/episode/video_clips_list.php @@ -35,12 +35,12 @@ use CodeIgniter\I18n\Time; ]; $pillIconMap = [ - 'queued' => 'timer-fill', - 'pending' => 'pause-fill', - 'running' => 'loader-fill', - 'canceled' => 'forbid-fill', - 'failed' => 'close-fill', - 'passed' => 'check-fill', + 'queued' => 'timer-fill', // @icon('timer-fill') + 'pending' => 'pause-fill', // @icon('pause-fill') + 'running' => 'loader-fill', // @icon('loader-fill') + 'canceled' => 'forbid-fill', // @icon('forbid-fill') + 'failed' => 'close-fill', // @icon('close-fill') + 'passed' => 'check-fill', // @icon('check-fill') ]; $pillIconClassMap = [ @@ -97,6 +97,7 @@ use CodeIgniter\I18n\Time; if ($videoClip->media) { helper('misc'); $filename = 'clip-' . slugify($videoClip->title) . "-{$videoClip->start_time}-{$videoClip->end_time}"; + // @icon('import-fill') $downloadButton = '' . lang('VideoClip.download_clip') . ''; } diff --git a/themes/cp_admin/import/_queue_table.php b/themes/cp_admin/import/_queue_table.php index 0895beaf..eb8070c1 100644 --- a/themes/cp_admin/import/_queue_table.php +++ b/themes/cp_admin/import/_queue_table.php @@ -21,12 +21,12 @@ use Modules\PodcastImport\Entities\TaskStatus; ]; $pillIconMap = [ - 'queued' => 'timer-fill', - 'pending' => 'pause-fill', - 'running' => 'loader-fill', - 'canceled' => 'forbid-fill', - 'failed' => 'close-fill', - 'passed' => 'check-fill', + 'queued' => 'timer-fill', // @icon('timer-fill') + 'pending' => 'pause-fill', // @icon('pause-fill') + 'running' => 'loader-fill', // @icon('loader-fill') + 'canceled' => 'forbid-fill', // @icon('forbid-fill') + 'failed' => 'close-fill', // @icon('close-fill') + 'passed' => 'check-fill', // @icon('check-fill') ]; $pillIconClassMap = [ diff --git a/themes/cp_admin/podcast/_platform.php b/themes/cp_admin/podcast/_platform.php index ffd6e0ca..c292702b 100644 --- a/themes/cp_admin/podcast/_platform.php +++ b/themes/cp_admin/podcast/_platform.php @@ -6,7 +6,9 @@ $platform->type, $platform->slug, ), - icon('delete-bin', 'mx-auto'), + icon('delete-bin-fill', [ + 'class' => 'mx-auto', + ]), [ 'class' => 'absolute right-0 top-0 -mt-4 -mr-4 p-2 border-red-700 border-2 bg-red-100 rounded-full text-red-700 hover:text-red-900', 'data-tooltip' => 'bottom', @@ -18,9 +20,10 @@ : '' ?>
slug), - 'text-skin-muted text-4xl', - $platform->type + sprintf('%s:%s', $platform->type, $platform->slug), + [ + 'class' => 'text-skin-muted text-4xl', + ], ) ?>

label ?>

diff --git a/themes/cp_admin/podcast/platforms.php b/themes/cp_admin/podcast/platforms.php index 7f9bbf1d..e65facde 100644 --- a/themes/cp_admin/podcast/platforms.php +++ b/themes/cp_admin/podcast/platforms.php @@ -1,92 +1,3 @@ - - extend('_layout') ?> section('title') ?> diff --git a/themes/cp_app/podcast/_partials/sidebar.php b/themes/cp_app/podcast/_partials/sidebar.php index 7bb4d2a4..364f7b74 100644 --- a/themes/cp_app/podcast/_partials/sidebar.php +++ b/themes/cp_app/podcast/_partials/sidebar.php @@ -40,11 +40,7 @@ is_visible): ?> link_url), - icon( - esc($podcastingPlatform->slug), - '', - $podcastingPlatform->type - ), + icon(sprintf('%s:%s', $podcastingPlatform->type, $podcastingPlatform->slug)), [ 'class' => 'text-2xl text-skin-muted hover:text-skin-base w-8 h-8 items-center inline-flex justify-center', 'target' => '_blank', diff --git a/themes/cp_app/post/post.php b/themes/cp_app/post/post.php index 27ae5326..bd9f3dfe 100644 --- a/themes/cp_app/post/post.php +++ b/themes/cp_app/post/post.php @@ -5,7 +5,9 @@ 'mr-2 text-lg', + ], ) . lang('Post.back_to_actor_posts', [ 'actor' => esc($post->actor->display_name),