From 025b2f42e69040a27a134ef876b0ef954f24b919 Mon Sep 17 00:00:00 2001 From: Yassine Doghri <yassine@doghri.fr> Date: Wed, 20 Oct 2021 14:22:58 +0000 Subject: [PATCH] refactor: replace "embeddable-player" occurrences to "embed" --- app/Config/Routes.php | 18 +++---- app/Controllers/EpisodeController.php | 12 ++--- ...17-12-01-160000_add_podcasts_platforms.php | 2 +- app/Entities/Episode.php | 16 ++----- app/Entities/Platform.php | 4 +- app/Helpers/components_helper.php | 11 +++-- app/Language/en/Common.php | 7 --- app/Language/en/Episode.php | 2 +- app/Language/en/Podcast.php | 14 ------ app/Language/fr/Common.php | 7 --- app/Language/fr/Episode.php | 2 +- app/Language/fr/Podcast.php | 16 +------ app/Models/PlatformModel.php | 4 +- app/Resources/js/embed.ts | 16 +++---- app/Resources/js/modules/ThemePicker.ts | 5 +- .../js/modules/play-episode-button.ts | 3 +- app/Resources/styles/formInputTabs.css | 2 +- app/Resources/styles/index.css | 1 - app/Resources/styles/tabs.css | 38 --------------- modules/Admin/Config/Routes.php | 6 +-- .../Admin/Controllers/EpisodeController.php | 4 +- .../Controllers/PodcastPlatformController.php | 7 +-- modules/Admin/Language/en/Breadcrumb.php | 2 +- modules/Admin/Language/en/Common.php | 1 - modules/Admin/Language/en/Episode.php | 4 +- .../Admin/Language/en/EpisodeNavigation.php | 2 +- modules/Admin/Language/en/Platforms.php | 2 +- modules/Admin/Language/fr/Breadcrumb.php | 2 +- modules/Admin/Language/fr/Common.php | 1 - modules/Admin/Language/fr/Episode.php | 4 +- .../Admin/Language/fr/EpisodeNavigation.php | 2 +- modules/Admin/Language/fr/Platforms.php | 2 +- .../EpisodeAnalyticsController.php | 4 +- themes/cp_admin/episode/_sidebar.php | 4 +- .../{embeddable_player.php => embed.php} | 20 ++++---- themes/cp_admin/episode/list.php | 4 +- themes/cp_admin/episode/publish.php | 2 +- themes/cp_admin/episode/publish_edit.php | 2 +- themes/cp_admin/episode/soundbites.php | 11 ++--- .../cp_admin/my_account/change_password.php | 2 +- themes/cp_admin/podcast/latest_episodes.php | 4 +- themes/cp_admin/podcast/platforms.php | 2 +- .../{embeddable_player.php => embed.php} | 47 +++++-------------- themes/cp_app/episode/_layout.php | 2 +- .../cp_app/episode/_partials/comment_card.php | 2 +- .../episode/_partials/comment_reply.php | 2 +- .../_partials/comment_reply_actions.php | 6 +-- .../_partials/comment_with_replies.php | 2 +- themes/cp_app/episode/activity.php | 4 +- themes/cp_app/episode/comments.php | 2 +- themes/cp_app/podcast/_layout.php | 2 +- themes/cp_app/podcast/activity.php | 2 +- .../post/_partials/post_with_replies.php | 2 +- themes/cp_app/post/_partials/reblog.php | 2 +- themes/cp_app/post/_partials/reply.php | 2 +- themes/cp_install/cache_config.php | 2 +- themes/cp_install/create_superadmin.php | 2 +- themes/cp_install/database_config.php | 2 +- themes/cp_install/instance_config.php | 4 +- 59 files changed, 122 insertions(+), 239 deletions(-) delete mode 100644 app/Resources/styles/tabs.css rename themes/cp_admin/episode/{embeddable_player.php => embed.php} (58%) rename themes/cp_app/{embeddable_player.php => embed.php} (57%) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 9234895e8f..45eff6b951 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -36,7 +36,7 @@ $routes->addPlaceholder('slug', '[a-zA-Z0-9\-]{1,128}'); $routes->addPlaceholder('base64', '[A-Za-z0-9\.\_]+\-{0,2}'); $routes->addPlaceholder('platformType', '\bpodcasting|\bsocial|\bfunding'); $routes->addPlaceholder('postAction', '\bfavourite|\breblog|\breply'); -$routes->addPlaceholder('embeddablePlayerTheme', '\blight|\bdark|\blight-transparent|\bdark-transparent'); +$routes->addPlaceholder('embedTheme', '\blight|\bdark|\blight-transparent|\bdark-transparent'); $routes->addPlaceholder( 'uuid', '[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}', @@ -154,17 +154,13 @@ $routes->group('@(:podcastHandle)', function ($routes): void { $routes->get('oembed.xml', 'EpisodeController::oembedXML/$1/$2', [ 'as' => 'episode-oembed-xml', ]); - $routes->group('embeddable-player', function ($routes): void { - $routes->get('/', 'EpisodeController::embeddablePlayer/$1/$2', [ - 'as' => 'embeddable-player', + $routes->group('embed', function ($routes): void { + $routes->get('/', 'EpisodeController::embed/$1/$2', [ + 'as' => 'embed', ]); - $routes->get( - '(:embeddablePlayerTheme)', - 'EpisodeController::embeddablePlayer/$1/$2/$3', - [ - 'as' => 'embeddable-player-theme', - ], - ); + $routes->get('(:embedTheme)', 'EpisodeController::embed/$1/$2/$3', [ + 'as' => 'embed-theme', + ],); }); }); diff --git a/app/Controllers/EpisodeController.php b/app/Controllers/EpisodeController.php index d5ddd9f780..0b439a61f6 100644 --- a/app/Controllers/EpisodeController.php +++ b/app/Controllers/EpisodeController.php @@ -138,7 +138,7 @@ class EpisodeController extends BaseController return $cachedView; } - public function embeddablePlayer(string $theme = 'light-transparent'): string + public function embed(string $theme = 'light-transparent'): string { header('Content-Security-Policy: frame-ancestors http://*:* https://*:*'); @@ -150,13 +150,13 @@ class EpisodeController extends BaseController $session = Services::session(); $session->start(); if (isset($_SERVER['HTTP_REFERER'])) { - $session->set('embeddable_player_domain', parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST)); + $session->set('embed_domain', parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST)); } $locale = service('request') ->getLocale(); - $cacheName = "page_podcast#{$this->podcast->id}_episode#{$this->episode->id}_embeddable_player_{$theme}_{$locale}"; + $cacheName = "page_podcast#{$this->podcast->id}_episode#{$this->episode->id}_embed_{$theme}_{$locale}"; if (! ($cachedView = cache($cacheName))) { $themeData = EpisodeModel::$themes[$theme]; @@ -173,7 +173,7 @@ class EpisodeController extends BaseController ); // The page cache is set to a decade so it is deleted manually upon podcast update - return view('embeddable_player', $data, [ + return view('embed', $data, [ 'cache' => $secondsToNextUnpublishedEpisode ? $secondsToNextUnpublishedEpisode : DECADE, @@ -196,7 +196,7 @@ class EpisodeController extends BaseController 'author_url' => $this->podcast->link, 'html' => '<iframe src="' . - $this->episode->embeddable_player_url . + $this->episode->embed_url . '" width="100%" height="144" frameborder="0" scrolling="no"></iframe>', 'width' => 600, 'height' => 144, @@ -226,7 +226,7 @@ class EpisodeController extends BaseController 'html', htmlentities( '<iframe src="' . - $this->episode->embeddable_player_url . + $this->episode->embed_url . '" width="100%" height="144" frameborder="0" scrolling="no"></iframe>', ), ); diff --git a/app/Database/Migrations/2017-12-01-160000_add_podcasts_platforms.php b/app/Database/Migrations/2017-12-01-160000_add_podcasts_platforms.php index 660f6578a6..febec48182 100644 --- a/app/Database/Migrations/2017-12-01-160000_add_podcasts_platforms.php +++ b/app/Database/Migrations/2017-12-01-160000_add_podcasts_platforms.php @@ -41,7 +41,7 @@ class AddPodcastsPlatforms extends Migration 'constraint' => 1, 'default' => 0, ], - 'is_on_embeddable_player' => [ + 'is_on_embed' => [ 'type' => 'TINYINT', 'constraint' => 1, 'default' => 0, diff --git a/app/Entities/Episode.php b/app/Entities/Episode.php index c01219dd8d..5f2689b88a 100644 --- a/app/Entities/Episode.php +++ b/app/Entities/Episode.php @@ -78,7 +78,7 @@ use RuntimeException; * * @property Person[] $persons; * @property Soundbite[] $soundbites; - * @property string $embeddable_player_url; + * @property string $embed_url; */ class Episode extends Entity { @@ -96,7 +96,7 @@ class Episode extends Entity protected string $audio_file_opengraph_url; - protected string $embeddable_player_url; + protected string $embed_url; protected Image $image; @@ -422,18 +422,12 @@ class Episode extends Entity return url_to('episode', $this->getPodcast()->handle, $this->attributes['slug']); } - public function getEmbeddablePlayerUrl(string $theme = null): string + public function getEmbedUrl(string $theme = null): string { return base_url( $theme - ? route_to( - 'embeddable-player-theme', - $this->getPodcast() - ->handle, - $this->attributes['slug'], - $theme, - ) - : route_to('embeddable-player', $this->getPodcast()->handle, $this->attributes['slug']), + ? route_to('embed-theme', $this->getPodcast() ->handle, $this->attributes['slug'], $theme,) + : route_to('embed', $this->getPodcast()->handle, $this->attributes['slug']), ); } diff --git a/app/Entities/Platform.php b/app/Entities/Platform.php index 34965c9432..0d43f89f34 100644 --- a/app/Entities/Platform.php +++ b/app/Entities/Platform.php @@ -21,7 +21,7 @@ use CodeIgniter\Entity\Entity; * @property string|null $link_url * @property string|null $link_content * @property bool|null $is_visible - * @property bool|null $is_on_embeddable_player + * @property bool|null $is_on_embed */ class Platform extends Entity { @@ -37,6 +37,6 @@ class Platform extends Entity 'link_url' => '?string', 'link_content' => '?string', 'is_visible' => '?boolean', - 'is_on_embeddable_player' => '?boolean', + 'is_on_embed' => '?boolean', ]; } diff --git a/app/Helpers/components_helper.php b/app/Helpers/components_helper.php index 2fd41ade90..00474d3cf2 100644 --- a/app/Helpers/components_helper.php +++ b/app/Helpers/components_helper.php @@ -106,9 +106,9 @@ if (! function_exists('publication_pill')) { { $class = match ($publicationStatus) { 'published' => 'text-pine-600 border-pine-600 bg-pine-50', - 'scheduled' => 'text-red-600 border-red-600 bg-red-50', - 'not_published' => 'text-gray-600 border-gray-600 bg-gray-50', - default => 'text-gray-600 border-gray-600 bg-gray-50', + 'scheduled' => 'text-red-600 border-red-600 bg-red-50', + 'not_published' => 'text-gray-600 border-gray-600 bg-gray-50', + default => 'text-gray-600 border-gray-600 bg-gray-50', }; $label = lang('Episode.publication_status.' . $publicationStatus); @@ -292,7 +292,10 @@ if (! function_exists('audio_player')) { if (! function_exists('relative_time')) { function relative_time(Time $time, string $class = ''): string { - $translatedDate = lang('Common.mediumDate', [$time]); + $formatter = new IntlDateFormatter(service( + 'request' + )->getLocale(), IntlDateFormatter::MEDIUM, IntlDateFormatter::NONE); + $translatedDate = $time->toLocalizedString($formatter->getPattern()); $datetime = $time->format(DateTime::ISO8601); return <<<CODE_SAMPLE diff --git a/app/Language/en/Common.php b/app/Language/en/Common.php index 72a38b4f1b..a29d9e6ce1 100644 --- a/app/Language/en/Common.php +++ b/app/Language/en/Common.php @@ -13,17 +13,10 @@ return [ 'no' => 'No', 'cancel' => 'Cancel', 'optional' => 'Optional', - 'more' => 'More', - 'no_data' => 'No data found!', 'close' => 'Close', - 'edit' => 'Edit', - 'copy' => 'Copy', - 'copied' => 'Copied!', 'home' => 'Home', 'explicit' => 'Explicit', - 'mediumDate' => '{0,date,medium}', 'powered_by' => 'Powered by {castopod}', - 'pageInfo' => 'Page {currentPage} out of {pageCount}', 'go_back' => 'Go back', 'play_episode_button' => [ 'play' => 'Play', diff --git a/app/Language/en/Episode.php b/app/Language/en/Episode.php index 8df3865216..74c32b3f92 100644 --- a/app/Language/en/Episode.php +++ b/app/Language/en/Episode.php @@ -19,7 +19,7 @@ return [ one {# person} other {# persons} }', - 'persons_list' => 'Persons for {episodeTitle}', + 'persons_list' => 'Persons', 'back_to_episodes' => 'Back to episodes of {podcast}', 'comments' => 'Comments', 'activity' => 'Activity', diff --git a/app/Language/en/Podcast.php b/app/Language/en/Podcast.php index 9896a00a46..c3dd50401f 100644 --- a/app/Language/en/Podcast.php +++ b/app/Language/en/Podcast.php @@ -9,21 +9,7 @@ declare(strict_types=1); */ return [ - 'all_podcasts' => 'All podcasts', - 'no_podcast' => 'No podcast found!', - 'create' => 'Create podcast', - 'import' => 'Import podcast', - 'new_episode' => 'New Episode', 'feed' => 'RSS Podcast feed', - 'view' => 'View podcast', - 'edit' => 'Edit podcast', - 'delete' => 'Delete podcast', - 'see_episodes' => 'See episodes', - 'see_contributors' => 'See contributors', - 'go_to_page' => 'Go to page', - 'latest_episodes' => 'Latest episodes', - 'see_all_episodes' => 'See all episodes', - 'by' => 'By {publisher}', 'season' => 'Season {seasonNumber}', 'list_of_episodes_year' => '{year} episodes ({episodeCount})', 'list_of_episodes_season' => diff --git a/app/Language/fr/Common.php b/app/Language/fr/Common.php index c5694c3974..6c28fe3f31 100644 --- a/app/Language/fr/Common.php +++ b/app/Language/fr/Common.php @@ -13,18 +13,11 @@ return [ 'no' => 'Non', 'cancel' => 'Annuler', 'optional' => 'Optionnel', - 'more' => 'Plus', - 'no_data' => 'Aucune donnée trouvée !', 'close' => 'Fermer', 'edit' => 'Modifier', - 'copy' => 'Copier', - 'copied' => 'Copié !', 'home' => 'Accueil', 'explicit' => 'Explicite', - 'mediumDate' => '{0,date,medium}', 'powered_by' => 'Propulsé par {castopod}', - 'actions' => 'Actions', - 'pageInfo' => 'Page {currentPage} sur {pageCount}', 'go_back' => 'Retour en arrière', 'play_episode_button' => [ 'play' => 'Lire', diff --git a/app/Language/fr/Episode.php b/app/Language/fr/Episode.php index ee8a1e4bd2..fc848d9f3b 100644 --- a/app/Language/fr/Episode.php +++ b/app/Language/fr/Episode.php @@ -19,7 +19,7 @@ return [ one {# intervenant·e} other {# intervenant·e·s} }', - 'persons_list' => 'Liste des intervenant·e·s', + 'persons_list' => 'Intervenant·e·s', 'back_to_episodes' => 'Retour aux épisodes de {podcast}', 'comments' => 'Commentaires', 'activity' => 'Activité', diff --git a/app/Language/fr/Podcast.php b/app/Language/fr/Podcast.php index d9d0a35d2b..d74d1f8dab 100644 --- a/app/Language/fr/Podcast.php +++ b/app/Language/fr/Podcast.php @@ -9,21 +9,7 @@ declare(strict_types=1); */ return [ - 'all_podcasts' => 'Tous les podcasts', - 'no_podcast' => 'Aucun podcast trouvé !', - 'create' => 'Créer un podcast', - 'import' => 'Importer un podcast', - 'new_episode' => 'Créer un épisode', 'feed' => 'Podcast RSS feed', - 'view' => 'Voir le podcast', - 'edit' => 'Modifier le podcast', - 'delete' => 'Supprimer le podcast', - 'see_episodes' => 'Voir les épisodes', - 'see_contributors' => 'Voir les contributeurs', - 'go_to_page' => 'Aller à la page', - 'latest_episodes' => 'Derniers épisodes', - 'see_all_episodes' => 'Voir tous les épisodes', - 'by' => 'Par {publisher}', 'season' => 'Saison {seasonNumber}', 'list_of_episodes_year' => 'Épisodes de {year} ({episodeCount})', 'list_of_episodes_season' => @@ -52,5 +38,5 @@ return [ one {# intervenant·e} other {# intervenant·e·s} }', - 'persons_list' => 'Liste des intervenant·e·s', + 'persons_list' => 'Intervenant·e·s', ]; diff --git a/app/Models/PlatformModel.php b/app/Models/PlatformModel.php index 5eb5727939..fb88923c1f 100644 --- a/app/Models/PlatformModel.php +++ b/app/Models/PlatformModel.php @@ -102,7 +102,7 @@ class PlatformModel extends Model ! ($found = cache("podcast#{$podcastId}_platforms_{$platformType}_withLinks")) ) { $found = $this->select( - 'platforms.*, podcasts_platforms.link_url, podcasts_platforms.link_content, podcasts_platforms.is_visible, podcasts_platforms.is_on_embeddable_player', + 'platforms.*, podcasts_platforms.link_url, podcasts_platforms.link_content, podcasts_platforms.is_visible, podcasts_platforms.is_on_embed', ) ->join( 'podcasts_platforms', @@ -127,7 +127,7 @@ class PlatformModel extends Model $cacheName = "podcast#{$podcastId}_platforms_{$platformType}"; if (! ($found = cache($cacheName))) { $found = $this->select( - 'platforms.*, podcasts_platforms.link_url, podcasts_platforms.link_content, podcasts_platforms.is_visible, podcasts_platforms.is_on_embeddable_player', + 'platforms.*, podcasts_platforms.link_url, podcasts_platforms.link_content, podcasts_platforms.is_visible, podcasts_platforms.is_on_embed', ) ->join('podcasts_platforms', 'podcasts_platforms.platform_slug = platforms.slug') ->where('podcasts_platforms.podcast_id', $podcastId) diff --git a/app/Resources/js/embed.ts b/app/Resources/js/embed.ts index 4689cf43ea..9bad25389e 100644 --- a/app/Resources/js/embed.ts +++ b/app/Resources/js/embed.ts @@ -35,6 +35,14 @@ import { import "@vime/core/themes/default.css"; import "@vime/core/themes/light.css"; +// Register Castopod's icons library +const library: HTMLVmIconLibraryElement | null = document.querySelector( + 'vm-icon-library[name="castopod-icons"]' +); +if (library) { + library.resolver = (iconName) => `/assets/icons/${iconName}.svg`; +} + // Vime elements for audio player customElements.define("vm-player", VmPlayer); customElements.define("vm-file", VmFile); @@ -68,11 +76,3 @@ customElements.define("vm-menu-radio-group", VmMenuRadioGroup); customElements.define("vm-menu-radio", VmMenuRadio); customElements.define("vm-settings", VmSettings); customElements.define("vm-skeleton", VmSkeleton); - -// Register Castopod's icons library -const library: HTMLVmIconLibraryElement | null = document.querySelector( - 'vm-icon-library[name="castopod-icons"]' -); -if (library) { - library.resolver = (iconName) => `/assets/icons/${iconName}.svg`; -} diff --git a/app/Resources/js/modules/ThemePicker.ts b/app/Resources/js/modules/ThemePicker.ts index 57b0a75bbc..d302e463be 100644 --- a/app/Resources/js/modules/ThemePicker.ts +++ b/app/Resources/js/modules/ThemePicker.ts @@ -1,9 +1,8 @@ const ThemePicker = (): void => { const buttons: NodeListOf<HTMLButtonElement> | null = document.querySelectorAll("button[data-type='theme-picker']"); - const iframe: HTMLIFrameElement | null = document.querySelector( - `iframe[id="embeddable_player"]` - ); + const iframe: HTMLIFrameElement | null = + document.querySelector(`iframe[id="embed"]`); const iframeTextArea: HTMLFormElement | null = document.querySelector(`[id="iframe"]`); const urlTextArea: HTMLFormElement | null = diff --git a/app/Resources/js/modules/play-episode-button.ts b/app/Resources/js/modules/play-episode-button.ts index d8c51fd490..44f4a87328 100644 --- a/app/Resources/js/modules/play-episode-button.ts +++ b/app/Resources/js/modules/play-episode-button.ts @@ -206,7 +206,8 @@ export class PlayEpisodeButton extends LitElement { } button:focus { - box-shadow: 0 0 0 2px #e7f9e4, 0 0 0 calc(2px + 2px) #009486; + outline: none; + box-shadow: 0 0 0 2px #e7f9e4, 0 0 0 4px #009486; } button.playing { diff --git a/app/Resources/styles/formInputTabs.css b/app/Resources/styles/formInputTabs.css index 38d323df14..fac80a185a 100644 --- a/app/Resources/styles/formInputTabs.css +++ b/app/Resources/styles/formInputTabs.css @@ -31,6 +31,6 @@ } .form-input-tabs > input:checked + label { - @apply font-semibold opacity-100 text-pine-700; + @apply font-semibold opacity-100 text-pine-500; } } diff --git a/app/Resources/styles/index.css b/app/Resources/styles/index.css index ac4f5db5a5..7ac86a77e6 100644 --- a/app/Resources/styles/index.css +++ b/app/Resources/styles/index.css @@ -8,7 +8,6 @@ @import "./switch.css"; @import "./charts.css"; @import "./post.css"; -@import "./tabs.css"; @import "./radioToggler.css"; @import "./formInputTabs.css"; @import "./stickyHeader.css"; diff --git a/app/Resources/styles/tabs.css b/app/Resources/styles/tabs.css deleted file mode 100644 index 4389ead476..0000000000 --- a/app/Resources/styles/tabs.css +++ /dev/null @@ -1,38 +0,0 @@ -@layer components { - .tabset { - @apply grid grid-cols-3; - } - - .tabset > input[type="radio"] { - @apply absolute -left-full; - } - - .tabset .tab-panel { - @apply hidden; - } - - /* Logic for 3 tabs at most */ - .tabset > input:first-child:checked ~ .tab-panels > .tab-panel:first-child, - .tabset > input:nth-child(3):checked ~ .tab-panels > .tab-panel:nth-child(2), - .tabset > input:nth-child(5):checked ~ .tab-panels > .tab-panel:nth-child(3) { - @apply block; - } - - /* Styling */ - .tabset > label { - @apply relative inline-block w-full px-4 py-3 text-center cursor-pointer opacity-70 hover:opacity-100; - } - - .tabset > input:checked + label::after { - @apply absolute inset-x-0 bottom-0 w-1/3 h-1 mx-auto bg-pine-500; - content: ""; - } - - .tabset > input:checked + label { - @apply font-semibold opacity-100 text-pine-700; - } - - .tabset .tab-panels { - @apply col-span-3 p-6; - } -} diff --git a/modules/Admin/Config/Routes.php b/modules/Admin/Config/Routes.php index 626803b719..d259ce905c 100644 --- a/modules/Admin/Config/Routes.php +++ b/modules/Admin/Config/Routes.php @@ -320,10 +320,10 @@ $routes->group( ], ); $routes->get( - 'embeddable-player', - 'EpisodeController::embeddablePlayer/$1/$2', + 'embed', + 'EpisodeController::embed/$1/$2', [ - 'as' => 'embeddable-player-add', + 'as' => 'embed-add', 'filter' => 'permission:podcast_episodes-edit', ], ); diff --git a/modules/Admin/Controllers/EpisodeController.php b/modules/Admin/Controllers/EpisodeController.php index 078fad1cd2..312953217f 100644 --- a/modules/Admin/Controllers/EpisodeController.php +++ b/modules/Admin/Controllers/EpisodeController.php @@ -822,7 +822,7 @@ class EpisodeController extends BaseController return redirect()->route('soundbites-edit', [$this->podcast->id, $this->episode->id]); } - public function embeddablePlayer(): string + public function embed(): string { helper(['form']); @@ -836,7 +836,7 @@ class EpisodeController extends BaseController 0 => $this->podcast->title, 1 => $this->episode->title, ]); - return view('episode/embeddable_player', $data); + return view('episode/embed', $data); } public function attemptCommentCreate(): RedirectResponse diff --git a/modules/Admin/Controllers/PodcastPlatformController.php b/modules/Admin/Controllers/PodcastPlatformController.php index bc49bc374e..d22b626c19 100644 --- a/modules/Admin/Controllers/PodcastPlatformController.php +++ b/modules/Admin/Controllers/PodcastPlatformController.php @@ -85,11 +85,8 @@ class PodcastPlatformController extends BaseController 'is_visible' => array_key_exists('visible', $podcastPlatform) && $podcastPlatform['visible'] === 'yes', - 'is_on_embeddable_player' => - array_key_exists( - 'on_embeddable_player', - $podcastPlatform, - ) && $podcastPlatform['on_embeddable_player'] === 'yes', + 'is_on_embed' => + array_key_exists('on_embed', $podcastPlatform,) && $podcastPlatform['on_embed'] === 'yes', ]; } diff --git a/modules/Admin/Language/en/Breadcrumb.php b/modules/Admin/Language/en/Breadcrumb.php index a8df8411e5..9a1ef1c2f9 100644 --- a/modules/Admin/Language/en/Breadcrumb.php +++ b/modules/Admin/Language/en/Breadcrumb.php @@ -41,5 +41,5 @@ return [ 'listening-time' => 'listening time', 'time-periods' => 'time periods', 'soundbites' => 'soundbites', - 'embeddable-player' => 'embeddable player', + 'embed' => 'embeddable player', ]; diff --git a/modules/Admin/Language/en/Common.php b/modules/Admin/Language/en/Common.php index c5048cb9f3..f3a6a91364 100644 --- a/modules/Admin/Language/en/Common.php +++ b/modules/Admin/Language/en/Common.php @@ -21,7 +21,6 @@ return [ 'copied' => 'Copied!', 'home' => 'Home', 'explicit' => 'Explicit', - 'mediumDate' => '{0,date,medium}', 'powered_by' => 'Powered by {castopod}', 'actions' => 'Actions', 'pageInfo' => 'Page {currentPage} out of {pageCount}', diff --git a/modules/Admin/Language/en/Episode.php b/modules/Admin/Language/en/Episode.php index 990297f8b9..073af0210a 100644 --- a/modules/Admin/Language/en/Episode.php +++ b/modules/Admin/Language/en/Episode.php @@ -160,9 +160,9 @@ return [ 'delete' => 'Delete soundbite', 'bookmark' => 'Click while playing to get current position, click again to get duration.', - 'submit_edit' => 'Save all soundbites', + 'submit' => 'Save soundbites', ], - 'embeddable_player' => [ + 'embed' => [ 'title' => 'Embeddable player', 'label' => 'Pick a theme color, copy the embeddable player to clipboard, then paste it on your website.', diff --git a/modules/Admin/Language/en/EpisodeNavigation.php b/modules/Admin/Language/en/EpisodeNavigation.php index bbc0d29832..1945e25b98 100644 --- a/modules/Admin/Language/en/EpisodeNavigation.php +++ b/modules/Admin/Language/en/EpisodeNavigation.php @@ -14,6 +14,6 @@ return [ 'episode-view' => 'Home', 'episode-edit' => 'Edit episode', 'episode-persons-manage' => 'Manage persons', - 'embeddable-player-add' => 'Embeddable player', + 'embed-add' => 'Embeddable player', 'soundbites-edit' => 'Soundbites', ]; diff --git a/modules/Admin/Language/en/Platforms.php b/modules/Admin/Language/en/Platforms.php index 27582cdad8..98180c13e5 100644 --- a/modules/Admin/Language/en/Platforms.php +++ b/modules/Admin/Language/en/Platforms.php @@ -13,7 +13,7 @@ return [ 'home_url' => 'Go to {platformName} website', 'submit_url' => 'Submit your podcast on {platformName}', 'visible' => 'Display in podcast homepage?', - 'on_embeddable_player' => 'Display on embeddable player?', + 'on_embed' => 'Display on embeddable player?', 'remove' => 'Remove {platformName}', 'submit' => 'Save', 'messages' => [ diff --git a/modules/Admin/Language/fr/Breadcrumb.php b/modules/Admin/Language/fr/Breadcrumb.php index 35598decca..91b6e0d92a 100644 --- a/modules/Admin/Language/fr/Breadcrumb.php +++ b/modules/Admin/Language/fr/Breadcrumb.php @@ -41,5 +41,5 @@ return [ 'listening-time' => 'drée d’écoute', 'time-periods' => 'périodes', 'soundbites' => 'extraits sonores', - 'embeddable-player' => 'lecteur intégré', + 'embed' => 'lecteur intégré', ]; diff --git a/modules/Admin/Language/fr/Common.php b/modules/Admin/Language/fr/Common.php index e02f1b02f0..8788589f73 100644 --- a/modules/Admin/Language/fr/Common.php +++ b/modules/Admin/Language/fr/Common.php @@ -21,7 +21,6 @@ return [ 'copied' => 'Copié !', 'home' => 'Accueil', 'explicit' => 'Explicite', - 'mediumDate' => '{0,date,medium}', 'powered_by' => 'Propulsé par {castopod}', 'actions' => 'Actions', 'pageInfo' => 'Page {currentPage} sur {pageCount}', diff --git a/modules/Admin/Language/fr/Episode.php b/modules/Admin/Language/fr/Episode.php index 857b6754ff..b0cc9c80e9 100644 --- a/modules/Admin/Language/fr/Episode.php +++ b/modules/Admin/Language/fr/Episode.php @@ -168,9 +168,9 @@ return [ 'delete' => 'Supprimer l’extrait sonore', 'bookmark' => 'Cliquez pour récupérer la position actuelle, cliquez à nouveau pour récupérer la durée.', - 'submit_edit' => 'Enregistrer tous les extraits sonores', + 'submit' => 'Enregistrer les extraits sonnores', ], - 'embeddable_player' => [ + 'embed' => [ 'add' => 'Ajouter un lecteur intégré', 'title' => 'Lecteur intégré', 'label' => diff --git a/modules/Admin/Language/fr/EpisodeNavigation.php b/modules/Admin/Language/fr/EpisodeNavigation.php index 9ba3693724..d85c74d2c1 100644 --- a/modules/Admin/Language/fr/EpisodeNavigation.php +++ b/modules/Admin/Language/fr/EpisodeNavigation.php @@ -14,6 +14,6 @@ return [ 'episode-view' => 'Accueil', 'episode-edit' => 'Modifier l’épisode', 'episode-persons-manage' => 'Gestion des intervenants', - 'embeddable-player-add' => 'Lecteur intégré', + 'embed' => 'Lecteur intégré', 'soundbites-edit' => 'Extraits sonores', ]; diff --git a/modules/Admin/Language/fr/Platforms.php b/modules/Admin/Language/fr/Platforms.php index 1a5a59c4d4..0c149715f2 100644 --- a/modules/Admin/Language/fr/Platforms.php +++ b/modules/Admin/Language/fr/Platforms.php @@ -13,7 +13,7 @@ return [ 'home_url' => 'Aller au site {platformName}', 'submit_url' => 'Soumettez votre podcast sur {platformName}', 'visible' => 'Afficher sur la page d’accueil du podcast ?', - 'on_embeddable_player' => 'Afficher sur le lecteur intégré ?', + 'on_embed' => 'Afficher sur le lecteur intégré ?', 'remove' => 'Supprimer {platformName}', 'submit' => 'Enregistrer', 'messages' => [ diff --git a/modules/Analytics/Controllers/EpisodeAnalyticsController.php b/modules/Analytics/Controllers/EpisodeAnalyticsController.php index 9b7a996977..167c5d84e3 100644 --- a/modules/Analytics/Controllers/EpisodeAnalyticsController.php +++ b/modules/Analytics/Controllers/EpisodeAnalyticsController.php @@ -56,8 +56,8 @@ class EpisodeAnalyticsController extends Controller $serviceName = ''; if (isset($_GET['_from'])) { $serviceName = $_GET['_from']; - } elseif ($session->get('embeddable_player_domain') !== null) { - $serviceName = $session->get('embeddable_player_domain'); + } elseif ($session->get('embed_domain') !== null) { + $serviceName = $session->get('embed_domain'); } elseif ($session->get('referer') !== null && $session->get('referer') !== '- Direct -') { $serviceName = parse_url($session->get('referer'), PHP_URL_HOST); } diff --git a/themes/cp_admin/episode/_sidebar.php b/themes/cp_admin/episode/_sidebar.php index 5067330a6c..8dba09e1fa 100644 --- a/themes/cp_admin/episode/_sidebar.php +++ b/themes/cp_admin/episode/_sidebar.php @@ -3,11 +3,11 @@ $podcastNavigation = [ 'dashboard' => [ 'icon' => 'dashboard', - 'items' => ['episode-view', 'episode-edit', 'episode-persons-manage', 'embeddable-player-add', 'soundbites-edit'], + 'items' => ['episode-view', 'episode-edit', 'episode-persons-manage', 'embed-add', 'soundbites-edit'], ], ]; ?> -<a href="<?= route_to('podcast-view', $podcast->id) ?>" class="flex items-center px-4 py-2 border-b border-pine-900 focus:ring-castopod"> +<a href="<?= route_to('podcast-view', $podcast->id) ?>" class="flex items-center px-4 py-2 border-b border-pine-900 focus:ring-inset focus:ring-castopod"> <?= icon('arrow-left', 'mr-2') ?> <img src="<?= $podcast->image->thumbnail_url ?>" diff --git a/themes/cp_admin/episode/embeddable_player.php b/themes/cp_admin/episode/embed.php similarity index 58% rename from themes/cp_admin/episode/embeddable_player.php rename to themes/cp_admin/episode/embed.php index b6d40ed877..099b40b8a6 100644 --- a/themes/cp_admin/episode/embeddable_player.php +++ b/themes/cp_admin/episode/embed.php @@ -1,39 +1,39 @@ <?= $this->extend('_layout') ?> <?= $this->section('title') ?> -<?= lang('Episode.embeddable_player.title') ?> +<?= lang('Episode.embed.title') ?> <?= $this->endSection() ?> <?= $this->section('pageTitle') ?> -<?= lang('Episode.embeddable_player.title') ?> +<?= lang('Episode.embed.title') ?> <?= $this->endSection() ?> <?= $this->section('content') ?> -<p><?= lang('Episode.embeddable_player.label') ?></p> +<p><?= lang('Episode.embed.label') ?></p> <div class="flex w-full mt-6"> <?php foreach ($themes as $themeKey => $theme): ?> <button style="<?= $theme[ 'style' ] ?>" class="w-12 h-12 mr-1 border-2 border-gray-400 rounded-lg hover:border-white" title="<?= lang( - "Episode.embeddable_player.{$themeKey}", - ) ?>" data-type="theme-picker" data-url="<?= $episode->getEmbeddablePlayerUrl( + "Episode.embed.{$themeKey}", + ) ?>" data-type="theme-picker" data-url="<?= $episode->getEmbedUrl( $themeKey, ) ?>"></button> <?php endforeach; ?> </div> -<iframe name="embeddable_player" id="embeddable_player" class="w-full max-w-xl mt-6 h-36" frameborder="0" scrolling="no" style="width: 100%; overflow: hidden;" src="<?= $episode->embeddable_player_url ?>"></iframe> +<iframe name="embed" id="embed" class="w-full max-w-xl mt-6 h-36" frameborder="0" scrolling="no" style="width: 100%; overflow: hidden;" src="<?= $episode->embed_url ?>"></iframe> <div class="flex items-center mt-8 gap-x-2"> - <Forms.Textarea readonly="true" class="w-full max-w-xl" name="iframe" rows="2" value="<?= esc("<iframe width=\"100%\" height=\"280\" frameborder=\"0\" scrolling=\"no\" style=\"width: 100%; height: 280px; overflow: hidden;\" src=\"{$episode->embeddable_player_url}\"></iframe>") ?>" /> - <IconButton glyph="file-copy" data-type="clipboard-copy" data-clipboard-target="iframe"><?= lang('Episode.embeddable_player.clipboard_iframe') ?></IconButton> + <Forms.Textarea readonly="true" class="w-full max-w-xl" name="iframe" rows="2" value="<?= esc("<iframe width=\"100%\" height=\"280\" frameborder=\"0\" scrolling=\"no\" style=\"width: 100%; height: 280px; overflow: hidden;\" src=\"{$episode->embed_url}\"></iframe>") ?>" /> + <IconButton glyph="file-copy" data-type="clipboard-copy" data-clipboard-target="iframe"><?= lang('Episode.embed.clipboard_iframe') ?></IconButton> </div> <div class="flex items-center mt-4 gap-x-2"> - <Forms.Input readonly="true" class="w-full max-w-xl" name="url" value="<?= $episode->embeddable_player_url ?>" /> - <IconButton glyph="file-copy" data-type="clipboard-copy" data-clipboard-target="url"><?= lang('Episode.embeddable_player.clipboard_url') ?></IconButton> + <Forms.Input readonly="true" class="w-full max-w-xl" name="url" value="<?= $episode->embed_url ?>" /> + <IconButton glyph="file-copy" data-type="clipboard-copy" data-clipboard-target="url"><?= lang('Episode.embed.clipboard_url') ?></IconButton> </div> <?= $this->endSection() ?> diff --git a/themes/cp_admin/episode/list.php b/themes/cp_admin/episode/list.php index db2a4a7e79..e035285fd5 100644 --- a/themes/cp_admin/episode/list.php +++ b/themes/cp_admin/episode/list.php @@ -84,8 +84,8 @@ ], [ 'type' => 'link', - 'title' => lang('Episode.embeddable_player.title'), - 'uri' => route_to('embeddable-player-add', $podcast->id, $episode->id), + 'title' => lang('Episode.embed.title'), + 'uri' => route_to('embed-add', $podcast->id, $episode->id), ], [ 'type' => 'link', diff --git a/themes/cp_admin/episode/publish.php b/themes/cp_admin/episode/publish.php index d9912438ec..083e578ea9 100644 --- a/themes/cp_admin/episode/publish.php +++ b/themes/cp_admin/episode/publish.php @@ -28,7 +28,7 @@ <small class="max-w-md mb-2 text-gray-600"><?= lang('Episode.publish_form.post_hint') ?></small> <div class="mb-8 overflow-hidden bg-white shadow-md rounded-xl"> <div class="flex px-4 py-3"> - <img src="<?= $podcast->actor->avatar_image_url ?>" alt="<?= $podcast->actor->display_name ?>" class="w-12 h-12 mr-4 rounded-full" /> + <img src="<?= $podcast->actor->avatar_image_url ?>" alt="<?= $podcast->actor->display_name ?>" class="w-10 h-10 mr-2 rounded-full" /> <div class="flex flex-col min-w-0"> <p class="flex items-baseline min-w-0"> <span class="mr-2 font-semibold truncate"><?= $podcast->actor->display_name ?></span> diff --git a/themes/cp_admin/episode/publish_edit.php b/themes/cp_admin/episode/publish_edit.php index de8b952726..eff01066e5 100644 --- a/themes/cp_admin/episode/publish_edit.php +++ b/themes/cp_admin/episode/publish_edit.php @@ -29,7 +29,7 @@ <small class="max-w-md mb-2 text-gray-600"><?= lang('Episode.publish_form.post_hint') ?></small> <div class="mb-8 overflow-hidden bg-white shadow-md rounded-xl"> <div class="flex px-4 py-3"> - <img src="<?= $podcast->actor->avatar_image_url ?>" alt="<?= $podcast->actor->display_name ?>" class="w-12 h-12 mr-4 rounded-full" /> + <img src="<?= $podcast->actor->avatar_image_url ?>" alt="<?= $podcast->actor->display_name ?>" class="w-10 h-10 mr-2 rounded-full" /> <div class="flex flex-col min-w-0"> <p class="flex items-baseline min-w-0"> <span class="mr-2 font-semibold truncate"><?= $podcast->actor->display_name ?></span> diff --git a/themes/cp_admin/episode/soundbites.php b/themes/cp_admin/episode/soundbites.php index d57db65eb8..1555d1474d 100644 --- a/themes/cp_admin/episode/soundbites.php +++ b/themes/cp_admin/episode/soundbites.php @@ -8,10 +8,14 @@ <?= lang('Episode.soundbites_form.title') ?> <?= $this->endSection() ?> +<?= $this->section('headerRight') ?> +<Button variant="primary" type="submit" form="soundbites-form"><?= lang('Episode.soundbites_form.submit') ?></Button> +<?= $this->endSection() ?> + <?= $this->section('content') ?> -<form action="<?= route_to('episode-soundbites-edit', $podcast->id, $episode->id) ?>" method="POST" class="flex flex-col"> +<form id="soundbites-form" action="<?= route_to('episode-soundbites-edit', $podcast->id, $episode->id) ?>" method="POST" class="flex flex-col"> <?= csrf_field() ?> <Forms.Section @@ -62,12 +66,7 @@ </audio> <IconButton glyph="timer" variant="info" data-type="get-soundbite" data-start-time-field-name="soundbites[0][start_time]" data-duration-field-name="soundbites[0][duration]" ><?= lang('Episode.soundbites_form.bookmark') ?></IconButton> </div> - </Forms.Section> - -<Button variant="primary" type="submit" class="self-end"><?= lang('Episode.soundbites_form.submit_edit') ?></Button> - </form> - <?= $this->endSection() ?> diff --git a/themes/cp_admin/my_account/change_password.php b/themes/cp_admin/my_account/change_password.php index 944c4f247d..cbafc7327c 100644 --- a/themes/cp_admin/my_account/change_password.php +++ b/themes/cp_admin/my_account/change_password.php @@ -11,7 +11,7 @@ <?= $this->section('content') ?> -<form action="<?= route_to('change-password') ?>" method="POST" class="flex flex-col max-w-sm"> +<form action="<?= route_to('change-password') ?>" method="POST" class="flex flex-col max-w-sm gap-y-4"> <?= csrf_field() ?> <Forms.Field name="password" diff --git a/themes/cp_admin/podcast/latest_episodes.php b/themes/cp_admin/podcast/latest_episodes.php index 23edd32a2d..5349011205 100644 --- a/themes/cp_admin/podcast/latest_episodes.php +++ b/themes/cp_admin/podcast/latest_episodes.php @@ -58,8 +58,8 @@ ], [ 'type' => 'link', - 'title' => lang('Episode.embeddable_player.title'), - 'uri' => route_to('embeddable-player-add', $podcast->id, $episode->id), + 'title' => lang('Episode.embed.title'), + 'uri' => route_to('embed-add', $podcast->id, $episode->id), ], [ 'type' => 'link', diff --git a/themes/cp_admin/podcast/platforms.php b/themes/cp_admin/podcast/platforms.php index 2b4cad9ae3..b6c47a4119 100644 --- a/themes/cp_admin/podcast/platforms.php +++ b/themes/cp_admin/podcast/platforms.php @@ -99,7 +99,7 @@ value="<?= $platform->link_content ?>" placeholder="<?= lang("Platforms.description.{$platform->type}") ?>" /> <Forms.Toggler size="small" class="text-sm" id="<?= $platform->slug . '_visible' ?>" name="<?= 'platforms[' . $platform->slug . '][visible]'?>" value="yes" checked="<?= old($platform->slug . '_visible', $platform->is_visible ? $platform->is_visible : false) ?>"><?= lang('Platforms.visible') ?></Forms.Toggler> - <Forms.Toggler size="small" class="text-sm" id="<?= $platform->slug . '_on_embeddable_player' ?>" name="<?= 'platforms[' . $platform->slug . '][on_embeddable_player]'?>" value="yes" checked="<?= old($platform->slug . '_on_embeddable_player', $platform->is_on_embeddable_player ? $platform->is_on_embeddable_player : false) ?>"><?= lang('Platforms.on_embeddable_player') ?></Forms.Toggler> + <Forms.Toggler size="small" class="text-sm" id="<?= $platform->slug . '_on_embed' ?>" name="<?= 'platforms[' . $platform->slug . '][on_embed]'?>" value="yes" checked="<?= old($platform->slug . '_on_embed', $platform->is_on_embed ? $platform->is_on_embed : false) ?>"><?= lang('Platforms.on_embed') ?></Forms.Toggler> </fieldset> </div> </div> diff --git a/themes/cp_app/embeddable_player.php b/themes/cp_app/embed.php similarity index 57% rename from themes/cp_app/embeddable_player.php rename to themes/cp_app/embed.php index c205593938..1fc63441bf 100644 --- a/themes/cp_app/embeddable_player.php +++ b/themes/cp_app/embed.php @@ -16,46 +16,23 @@ ->asset('js/embed.ts', 'js') ?> </head> -<body class="flex w-full h-screen" style="background: <?= $themeData[ - 'background' -] ?>; color: <?= $themeData['text'] ?>;"> - <img src="<?= $episode->image - ->thumbnail_url ?>" alt="<?= $episode->title ?>" class="flex-shrink w-36 h-36" /> - <div class="flex flex-col items-start flex-1 min-w-0 px-4 py-2 h-36"> - <div class="flex items-center w-full"> - <a href="<?= route_to( - 'podcast-activity', - $podcast->handle, - ) ?>" style="color: <?= $themeData[ - 'text' -] ?>;" class="mr-2 text-xs tracking-wider uppercase truncate opacity-75 hover:opacity-100" target="_blank"> - <?= $podcast->title ?> - </a> - <a href="https://castopod.org/" class="ml-auto text-3xl text-pine-500 hover:opacity-75" title="<?= lang( - 'Common.powered_by', - [ - 'castopod' => 'Castopod', - ], -) ?>" target="_blank" rel="noopener noreferrer"> - <?= icon('podcasting/castopod') ?> - </a> +<body class="flex" style="background: <?= $themeData['background'] ?>; color: <?= $themeData['text'] ?>;"> + <img src="<?= $episode->image->thumbnail_url ?>" alt="<?= $episode->title ?>" class="flex-shrink w-36 h-36" /> + <div class="flex flex-col items-start flex-1 min-w-0 px-4 pt-4 h-36"> + <a href="https://castopod.org/" class="absolute text-2xl top-1 right-2 text-pine-500 hover:opacity-75" title="<?= lang('Common.powered_by', [ + 'castopod' => 'Castopod', + ]) ?>" target="_blank" rel="noopener noreferrer"><?= icon('podcasting/castopod') ?></a> + <div class="flex gap-x-2"> + <?= episode_numbering($episode->number, $episode->season_number, 'text-xs font-semibold !no-underline border px-1 border-gray-500', true) ?> + <a href="<?= route_to('podcast-activity', $podcast->handle) ?>" style="color: <?= $themeData['text'] ?>;" class="text-xs truncate opacity-75 hover:opacity-100" target="_blank"><?= $podcast->title ?></a> </div> - <a href="<?= $episode->link ?>" class="flex items-center mb-2" style="color: <?= $themeData[ - 'text' -] ?>;" target="_blank"> - <?= episode_numbering( - $episode->number, - $episode->season_number, - 'text-xs font-semibold text-gray-600 !no-underline border px-1 border-gray-500 mr-1', - true, -) ?><h1 class="mr-2 text-lg font-semibold truncate opacity-100 hover:opacity-75"> -<?= $episode->title ?> -</h1> + <a href="<?= $episode->link ?>" class="flex flex-col items-start text-sm" style="color: <?= $themeData['text'] ?>;" target="_blank"> + <h1 class="text-lg font-semibold leading-tight opacity-100 line-clamp-2 hover:opacity-75"><?= $episode->title ?></h1> </a> <vm-player id="castopod-vm-player" theme="<?= str_starts_with($theme, 'dark') ? 'dark' : 'light' ?>" - language="${language}" + language="<?= service('request')->getLocale() ?>" icons="castopod-icons" class="w-full mt-auto" style="--vm-player-box-shadow:0; --vm-player-theme: #009486; --vm-control-spacing: 4px; --vm-control-icon-size: 24px; <?= str_ends_with($theme, 'transparent') ? '--vm-controls-bg: transparent;' : '' ?>" diff --git a/themes/cp_app/episode/_layout.php b/themes/cp_app/episode/_layout.php index 3774733721..8113ffb9d5 100644 --- a/themes/cp_app/episode/_layout.php +++ b/themes/cp_app/episode/_layout.php @@ -32,7 +32,7 @@ <?php endif; ?> <nav class="flex items-center justify-between h-10 col-start-2 px-2 text-white bg-pine-800"> - <a href="<?= route_to('podcast-episodes', $podcast->handle) ?>" class="inline-flex items-center" title="<?= lang('Episode.back_to_episodes', [ + <a href="<?= route_to('podcast-episodes', $podcast->handle) ?>" class="inline-flex items-center focus:ring-castopod" title="<?= lang('Episode.back_to_episodes', [ 'podcast' => $podcast->title, ]) ?>"> <?= icon('arrow-left', 'mr-2 text-lg') ?> diff --git a/themes/cp_app/episode/_partials/comment_card.php b/themes/cp_app/episode/_partials/comment_card.php index 7f6bca1d96..eedbcf90a1 100644 --- a/themes/cp_app/episode/_partials/comment_card.php +++ b/themes/cp_app/episode/_partials/comment_card.php @@ -1,5 +1,5 @@ <article class="relative z-10 flex w-full p-4 bg-white shadow rounded-conditional-2xl"> - <img src="<?= $comment->actor->avatar_image_url ?>" alt="<?= $comment->display_name ?>" class="w-12 h-12 mr-4 rounded-full" /> + <img src="<?= $comment->actor->avatar_image_url ?>" alt="<?= $comment->display_name ?>" class="w-10 h-10 mr-2 rounded-full" /> <div class="flex-1"> <header class="w-full mb-2 text-sm"> <a href="<?= $comment->actor->uri ?>" class="flex items-baseline hover:underline" <?= $comment->actor->is_local diff --git a/themes/cp_app/episode/_partials/comment_reply.php b/themes/cp_app/episode/_partials/comment_reply.php index 8f6d464bfd..59b5643fdd 100644 --- a/themes/cp_app/episode/_partials/comment_reply.php +++ b/themes/cp_app/episode/_partials/comment_reply.php @@ -1,6 +1,6 @@ <article class="flex px-6 py-4 bg-gray-50"> <img src="<?= $reply->actor->avatar_image_url ?>" alt="<?= $reply->actor - ->display_name ?>" class="w-12 h-12 mr-4 rounded-full ring-gray-50 ring-2" /> + ->display_name ?>" class="w-10 h-10 mr-2 rounded-full ring-gray-50 ring-2" /> <div class="flex flex-col flex-1 min-w-0"> <header class="flex items-center mb-2"> <a href="<?= $reply->actor diff --git a/themes/cp_app/episode/_partials/comment_reply_actions.php b/themes/cp_app/episode/_partials/comment_reply_actions.php index 126167a254..bae6c3cb13 100644 --- a/themes/cp_app/episode/_partials/comment_reply_actions.php +++ b/themes/cp_app/episode/_partials/comment_reply_actions.php @@ -1,13 +1,13 @@ <footer> <?php if (can_user_interact()): ?> - <form action="<?= route_to('comment-attempt-like', interact_as_actor()->username, $episode->slug, $reply->id) ?>" method="POST" class="flex items-center gap-x-4"> + <form action="<?= route_to('comment-attempt-like', interact_as_actor()->username, $reply->episode->slug, $reply->id) ?>" method="POST" class="flex items-center gap-x-4"> <button type="submit" name="action" class="inline-flex items-center hover:underline group" title="<?= lang( 'Comment.likes', [ 'numberOfLikes' => $reply->likes_count, ], ) ?>"><?= icon('heart', 'text-xl mr-1 text-gray-400 group-hover:text-red-600') . $reply->likes_count ?></button> - <Button uri="<?= route_to('episode-comment', $podcast->handle, $episode->slug, $reply->id) ?>" size="small"><?= lang('Comment.reply') ?></Button> + <Button uri="<?= route_to('episode-comment', $reply->episode->podcast->handle, $reply->episode->slug, $reply->id) ?>" size="small"><?= lang('Comment.reply') ?></Button> </form> <?php else: ?> <button type="submit" name="action" class="inline-flex items-center opacity-50 cursor-not-allowed" disabled="disabled" title="<?= lang( @@ -18,7 +18,7 @@ ) ?>"><?= icon('heart', 'text-xl mr-1 text-gray-500') . $reply->likes_count ?></button> <?php if ($reply->replies_count): ?> <?= anchor( - route_to('episode-comment', $podcast->handle, $episode->slug, $reply->id), + route_to('episode-comment', $reply->episode->podcast->handle, $reply->episode->slug, $reply->id), icon('chat', 'text-2xl mr-1 text-gray-400') . $reply->replies_count, [ 'class' => 'inline-flex items-center hover:underline', diff --git a/themes/cp_app/episode/_partials/comment_with_replies.php b/themes/cp_app/episode/_partials/comment_with_replies.php index aec689bff1..45b42537fc 100644 --- a/themes/cp_app/episode/_partials/comment_with_replies.php +++ b/themes/cp_app/episode/_partials/comment_with_replies.php @@ -5,7 +5,7 @@ <form action="<?= route_to('comment-attempt-reply', $podcast->id, $episode->id, $comment->id) ?>" method="POST" class="flex px-6 pt-8 pb-4 bg-gray-50"> <img src="<?= interact_as_actor() ->avatar_image_url ?>" alt="<?= interact_as_actor() - ->display_name ?>" class="w-12 h-12 mr-4 rounded-full ring-gray-50 ring-2" /> + ->display_name ?>" class="w-10 h-10 mr-2 rounded-full ring-gray-50 ring-2" /> <div class="flex flex-col flex-1"> <Forms.Textarea name="message" diff --git a/themes/cp_app/episode/activity.php b/themes/cp_app/episode/activity.php index fdb1c5fc85..df14e32016 100644 --- a/themes/cp_app/episode/activity.php +++ b/themes/cp_app/episode/activity.php @@ -27,7 +27,7 @@ <meta name="twitter:card" content="player" /> <meta property="twitter:audio:partner" content="<?= $podcast->publisher ?>" /> <meta property="twitter:audio:artist_name" content="<?= $podcast->owner_name ?>" /> -<meta name="twitter:player" content="<?= $episode->getEmbeddablePlayerUrl('light') ?>" /> +<meta name="twitter:player" content="<?= $episode->getEmbedUrl('light') ?>" /> <meta name="twitter:player:width" content="600" /> <meta name="twitter:player:height" content="200" /> <?= $this->endSection() ?> @@ -42,7 +42,7 @@ <img src="<?= interact_as_actor() ->avatar_image_url ?>" alt="<?= interact_as_actor() - ->display_name ?>" class="w-12 h-12 mr-4 rounded-full" /> + ->display_name ?>" class="w-10 h-10 mr-2 rounded-full" /> <div class="flex flex-col flex-1 min-w-0 gap-y-2"> <input name="episode_url" value="<?= $episode->link ?>" type="hidden" /> <Forms.Textarea diff --git a/themes/cp_app/episode/comments.php b/themes/cp_app/episode/comments.php index f9d2d11782..df5d334817 100644 --- a/themes/cp_app/episode/comments.php +++ b/themes/cp_app/episode/comments.php @@ -29,7 +29,7 @@ <meta name="twitter:card" content="player" /> <meta property="twitter:audio:partner" content="<?= $podcast->publisher ?>" /> <meta property="twitter:audio:artist_name" content="<?= $podcast->owner_name ?>" /> -<meta name="twitter:player" content="<?= $episode->getEmbeddablePlayerUrl('light') ?>" /> +<meta name="twitter:player" content="<?= $episode->getEmbedUrl('light') ?>" /> <meta name="twitter:player:width" content="600" /> <meta name="twitter:player:height" content="200" /> <?= $this->endSection() ?> diff --git a/themes/cp_app/podcast/_layout.php b/themes/cp_app/podcast/_layout.php index cfc098a378..5909b6f46b 100644 --- a/themes/cp_app/podcast/_layout.php +++ b/themes/cp_app/podcast/_layout.php @@ -31,7 +31,7 @@ </div> <?php endif; ?> - <header class="z-50 flex flex-col-reverse justify-between w-full col-start-2 bg-top bg-no-repeat bg-cover sm:flex-row sm:items-end bg-pine-800" style="background-image: url('<?= $podcast->actor->cover_image_url ?>'); aspect-ratio: 15 / 5;"> + <header class="z-50 flex flex-col-reverse justify-between w-full col-start-2 bg-top bg-no-repeat bg-cover sm:flex-row sm:items-end bg-pine-800" style="background-image: url('<?= $podcast->actor->cover_image_url ?>'); aspect-ratio: 3 / 1;"> <div class="flex items-center pl-4 -mb-6 md:pl-8 md:-mb-8 gap-x-4"> <img src="<?= $podcast->image->thumbnail_url ?>" alt="<?= $podcast->title ?>" loading="lazy" class="h-24 rounded-full md:h-28 ring-4 ring-white" /> <div class="relative flex flex-col text-white -top-2"> diff --git a/themes/cp_app/podcast/activity.php b/themes/cp_app/podcast/activity.php index 603559d6ea..4e7119e9d9 100644 --- a/themes/cp_app/podcast/activity.php +++ b/themes/cp_app/podcast/activity.php @@ -35,7 +35,7 @@ <img src="<?= interact_as_actor() ->avatar_image_url ?>" alt="<?= interact_as_actor() - ->display_name ?>" class="w-12 h-12 mr-4 rounded-full" /> + ->display_name ?>" class="w-10 h-10 mr-2 rounded-full" /> <div class="flex flex-col flex-1 min-w-0 gap-y-2"> <Forms.Textarea name="message" diff --git a/themes/cp_app/post/_partials/post_with_replies.php b/themes/cp_app/post/_partials/post_with_replies.php index fc3b66a22f..a5f5f2ba36 100644 --- a/themes/cp_app/post/_partials/post_with_replies.php +++ b/themes/cp_app/post/_partials/post_with_replies.php @@ -9,7 +9,7 @@ <form action="<?= route_to('post-attempt-action', interact_as_actor()->username, $post->id) ?>" method="POST" class="flex" > <img src="<?= interact_as_actor() ->avatar_image_url ?>" alt="<?= interact_as_actor() - ->display_name ?>" class="w-12 h-12 mr-4 rounded-full ring-gray-50 ring-2" /> + ->display_name ?>" class="w-10 h-10 mr-2 rounded-full ring-gray-50 ring-2" /> <div class="flex flex-col flex-1"> <Forms.Textarea name="message" diff --git a/themes/cp_app/post/_partials/reblog.php b/themes/cp_app/post/_partials/reblog.php index 487a99ed22..f2f7a77145 100644 --- a/themes/cp_app/post/_partials/reblog.php +++ b/themes/cp_app/post/_partials/reblog.php @@ -8,7 +8,7 @@ ]) ?></p> <header class="flex px-6 py-4"> <img src="<?= $post->actor - ->avatar_image_url ?>" alt="<?= $post->display_name ?>" class="w-12 h-12 mr-4 rounded-full" /> + ->avatar_image_url ?>" alt="<?= $post->display_name ?>" class="w-10 h-10 mr-2 rounded-full" /> <div class="flex flex-col min-w-0"> <a href="<?= $post->actor ->uri ?>" class="flex items-baseline hover:underline" <?= $post diff --git a/themes/cp_app/post/_partials/reply.php b/themes/cp_app/post/_partials/reply.php index e39bc418a8..12dcafde88 100644 --- a/themes/cp_app/post/_partials/reply.php +++ b/themes/cp_app/post/_partials/reply.php @@ -1,6 +1,6 @@ <article class="flex px-6 py-4 bg-gray-50"> <img src="<?= $reply->actor->avatar_image_url ?>" alt="<?= $reply->actor - ->display_name ?>" class="w-12 h-12 mr-4 rounded-full ring-gray-50 ring-2" /> + ->display_name ?>" class="w-10 h-10 mr-2 rounded-full ring-gray-50 ring-2" /> <div class="flex flex-col flex-1 min-w-0"> <header class="flex items-center mb-2"> <a href="<?= $reply->actor diff --git a/themes/cp_install/cache_config.php b/themes/cp_install/cache_config.php index 21ea7740a9..730b5bd776 100644 --- a/themes/cp_install/cache_config.php +++ b/themes/cp_install/cache_config.php @@ -7,7 +7,7 @@ <div class="flex flex-col mb-2"> <div class="flex items-center"> - <span class="inline-flex items-center justify-center w-12 h-12 mr-2 text-sm font-semibold tracking-wider border-4 rounded-full text-pine-700 border-pine-700">3/4</span> + <span class="inline-flex items-center justify-center w-12 h-12 mr-2 text-sm font-semibold tracking-wider border-4 rounded-full text-pine-500 border-pine-500">3/4</span> <Heading tagName="h1"><?= lang('Install.form.cache_config') ?></h1> </div> diff --git a/themes/cp_install/create_superadmin.php b/themes/cp_install/create_superadmin.php index 16771ce1e5..2c44766f0b 100644 --- a/themes/cp_install/create_superadmin.php +++ b/themes/cp_install/create_superadmin.php @@ -6,7 +6,7 @@ <?= csrf_field() ?> <div class="flex items-center mb-2"> - <span class="inline-flex items-center justify-center w-12 h-12 mr-2 text-sm font-semibold tracking-wider border-4 rounded-full text-pine-700 border-pine-700">4/4</span> + <span class="inline-flex items-center justify-center w-12 h-12 mr-2 text-sm font-semibold tracking-wider border-4 rounded-full text-pine-500 border-pine-500">4/4</span> <Heading tagName="h1"><?= lang('Install.form.create_superadmin') ?></Heading> </div> diff --git a/themes/cp_install/database_config.php b/themes/cp_install/database_config.php index 61b3f24978..c225005da1 100644 --- a/themes/cp_install/database_config.php +++ b/themes/cp_install/database_config.php @@ -7,7 +7,7 @@ <div class="flex flex-col mb-2"> <div class="flex items-center"> - <span class="inline-flex items-center justify-center w-12 h-12 mr-2 text-sm font-semibold tracking-wider border-4 rounded-full text-pine-700 border-pine-700">2/4</span> + <span class="inline-flex items-center justify-center w-12 h-12 mr-2 text-sm font-semibold tracking-wider border-4 rounded-full text-pine-500 border-pine-500">2/4</span> <Heading tagName="h1"><?= lang( 'Install.form.database_config', ) ?></Heading> diff --git a/themes/cp_install/instance_config.php b/themes/cp_install/instance_config.php index 7e8620ac57..a6a8e8e02f 100644 --- a/themes/cp_install/instance_config.php +++ b/themes/cp_install/instance_config.php @@ -5,8 +5,8 @@ <form action="<?= '/' . config('Install')->gateway . '/instance-config' ?>" class="flex flex-col w-full max-w-sm gap-y-4" method="post" accept-charset="utf-8"> <?= csrf_field() ?> -<div class="flex items-center mb-4"> - <span class="inline-flex items-center justify-center w-12 h-12 mr-2 text-sm font-semibold tracking-wider border-4 rounded-full text-pine-700 border-pine-700">1/4</span> +<div class="flex items-center mb-2"> + <span class="inline-flex items-center justify-center w-12 h-12 mr-2 text-sm font-semibold tracking-wider border-4 rounded-full text-pine-500 border-pine-500">1/4</span> <Heading tagName="h1"><?= lang('Install.form.instance_config') ?></Heading> </div> -- GitLab