diff --git a/app/Controllers/CreditsController.php b/app/Controllers/CreditsController.php index 3531b3e2e86e8c230426a03ae1895564c4f5ee8a..5d20669ea34a893ab4a6b6765d9fa8e363887138 100644 --- a/app/Controllers/CreditsController.php +++ b/app/Controllers/CreditsController.php @@ -20,9 +20,12 @@ class CreditsController extends BaseController { $locale = service('request') ->getLocale(); - $allPodcasts = (new PodcastModel())->findAll(); - $cacheName = "page_credits_{$locale}"; + $cacheName = implode( + '_', + array_filter(['page', 'credits', $locale, can_user_interact() ? 'authenticated' : null]), + ); + if (! ($found = cache($cacheName))) { $page = new Page([ 'title' => lang('Person.credits', [], $locale), @@ -30,6 +33,7 @@ class CreditsController extends BaseController 'content_markdown' => '', ]); + $allPodcasts = (new PodcastModel())->findAll(); $allCredits = (new CreditModel())->findAll(); // Unlike the carpenter, we make a tree from a table: diff --git a/app/Controllers/EpisodeCommentController.php b/app/Controllers/EpisodeCommentController.php index 61fb6bac697f8063401ed4095fef05d907913eaf..e0753ce912ccee691d32cf2d9bbd6f150212e528 100644 --- a/app/Controllers/EpisodeCommentController.php +++ b/app/Controllers/EpisodeCommentController.php @@ -90,7 +90,7 @@ class EpisodeCommentController extends BaseController "comment#{$this->comment->id}", service('request') ->getLocale(), - can_user_interact() ? '_authenticated' : null, + can_user_interact() ? 'authenticated' : null, ]), ); diff --git a/app/Controllers/MapController.php b/app/Controllers/MapController.php index 785a1352aeb4aafe53ce2094481e73997376e7c6..4e468389715610fbbdbaf93a36da1bac01d8ec14 100644 --- a/app/Controllers/MapController.php +++ b/app/Controllers/MapController.php @@ -17,9 +17,17 @@ class MapController extends BaseController { public function index(): string { - $locale = service('request') - ->getLocale(); - $cacheName = "page_map_{$locale}"; + $cacheName = implode( + '_', + array_filter([ + 'page', + 'map', + service('request') + ->getLocale(), + can_user_interact() ? 'authenticated' : null, + ]), + ); + if (! ($found = cache($cacheName))) { $found = view('pages/map', [], [ 'cache' => DECADE, diff --git a/app/Controllers/PageController.php b/app/Controllers/PageController.php index a97e416389fadb699d737e381b2a4dc38fff356d..03773921137d8c7d642770599f387d6c14b88541 100644 --- a/app/Controllers/PageController.php +++ b/app/Controllers/PageController.php @@ -37,9 +37,17 @@ class PageController extends BaseController public function index(): string { - $locale = service('request') - ->getLocale(); - $cacheName = "page-{$this->page->slug}-{$locale}"; + $cacheName = implode( + '_', + array_filter([ + 'page', + $this->page->slug, + service('request') + ->getLocale(), + can_user_interact() ? 'authenticated' : null, + ]), + ); + if (! ($found = cache($cacheName))) { $data = [ 'metatags' => get_page_metatags($this->page), diff --git a/app/Controllers/PodcastController.php b/app/Controllers/PodcastController.php index 71c5c283b1813eb84c3110dfdc172bb668ecd9ec..75b78def4d8f2c18825f0a364b47ecc79db15a4f 100644 --- a/app/Controllers/PodcastController.php +++ b/app/Controllers/PodcastController.php @@ -74,7 +74,7 @@ class PodcastController extends BaseController 'activity', service('request') ->getLocale(), - can_user_interact() ? '_authenticated' : null, + can_user_interact() ? 'authenticated' : null, ]), ); @@ -122,7 +122,7 @@ class PodcastController extends BaseController 'about', service('request') ->getLocale(), - can_user_interact() ? '_authenticated' : null, + can_user_interact() ? 'authenticated' : null, ]), ); @@ -188,7 +188,7 @@ class PodcastController extends BaseController $seasonQuery ? 'season' . $seasonQuery : null, service('request') ->getLocale(), - can_user_interact() ? '_authenticated' : null, + can_user_interact() ? 'authenticated' : null, ]), ); diff --git a/app/Controllers/PostController.php b/app/Controllers/PostController.php index 430a1ca061763bfc0a8e24144651bd93e52f3f67..15b23c162a20a369cfbb3476e6a6c220bb60e602 100644 --- a/app/Controllers/PostController.php +++ b/app/Controllers/PostController.php @@ -81,7 +81,7 @@ class PostController extends FediversePostController "post#{$this->post->id}", service('request') ->getLocale(), - can_user_interact() ? '_authenticated' : null, + can_user_interact() ? 'authenticated' : null, ]), ); diff --git a/app/Helpers/components_helper.php b/app/Helpers/components_helper.php index 7c7073f4b01fb67ee1139093482c64d85aabb6e2..4502c0f20165b3258c42b25772685daa58215689 100644 --- a/app/Helpers/components_helper.php +++ b/app/Helpers/components_helper.php @@ -307,7 +307,6 @@ if (! function_exists('relative_time')) { return <<<CODE_SAMPLE <time-ago class="{$class}" datetime="{$datetime}"> <time - itemprop="published" datetime="{$datetime}" title="{$time}">{$translatedDate}</time> </time-ago> diff --git a/app/Views/Components/Forms/Field.php b/app/Views/Components/Forms/Field.php index 8f81fc242f379e5ab852900ded717c783029d608..8467df64340444546645a1d51cfef14923ec31de 100644 --- a/app/Views/Components/Forms/Field.php +++ b/app/Views/Components/Forms/Field.php @@ -37,8 +37,8 @@ class Field extends FormComponent unset($fieldComponentAttributes['as']); unset($fieldComponentAttributes['label']); unset($fieldComponentAttributes['class']); - unset($fieldComponentAttributes['helperText']); - unset($fieldComponentAttributes['hintText']); + unset($fieldComponentAttributes['helper']); + unset($fieldComponentAttributes['hint']); $fieldComponentAttributes['class'] = 'mb-1'; diff --git a/themes/cp_app/episode/_layout.php b/themes/cp_app/episode/_layout.php index 8fb8aeca96c9c13c272b38d64f1d7e3a6d6066ef..19149506675cbc02a2ebde8c89c78da720f55bb7 100644 --- a/themes/cp_app/episode/_layout.php +++ b/themes/cp_app/episode/_layout.php @@ -91,7 +91,7 @@ <div class="flex items-center mt-4 gap-x-8"> <?php if ($episode->persons !== []): ?> <button class="flex items-center text-xs font-semibold gap-x-2 hover:underline focus:ring-accent" data-toggle="persons-list" data-toggle-class="hidden"> - <div class="inline-flex flex-row-reverse"> + <span class="inline-flex flex-row-reverse"> <?php $i = 0; ?> <?php foreach ($episode->persons as $person): ?> <img src="<?= $person->avatar->thumbnail_url ?>" alt="<?= $person->full_name ?>" class="object-cover w-8 h-8 -ml-4 border-2 rounded-full aspect-square border-background-header last:ml-0" loading="lazy" /> @@ -99,7 +99,7 @@ break; }?> <?php endforeach; ?> - </div> + </span> <?= lang('Episode.persons', [ 'personsCount' => count($episode->persons), ]) ?> @@ -124,7 +124,7 @@ <div class="text-xs"> <?= relative_time($episode->published_at) ?> <span class="mx-1">•</span> - <time datetime="PT<?= $episode->audio->duration ?>S"> + <time datetime="PT<?= round($episode->audio->duration, 3) ?>S"> <?= format_duration_symbol($episode->audio->duration) ?> </time> </div> diff --git a/themes/cp_app/episode/_partials/card.php b/themes/cp_app/episode/_partials/card.php index 22de5e04c22788a5d4b9c686538297dc1d09c291..9b53fdb1d46ebe7a7e3067529ee6910665a1311f 100644 --- a/themes/cp_app/episode/_partials/card.php +++ b/themes/cp_app/episode/_partials/card.php @@ -1,6 +1,6 @@ <article class="flex w-full p-4 shadow bg-elevated rounded-conditional-2xl gap-x-2"> <div class="relative"> - <time class="absolute px-1 text-xs font-semibold text-white rounded bottom-2 right-2 bg-black/75" datetime="PT<?= $episode->audio->duration ?>S"> + <time class="absolute px-1 text-xs font-semibold text-white rounded bottom-2 right-2 bg-black/75" datetime="PT<?= round($episode->audio->duration, 3) ?>S"> <?= format_duration($episode->audio->duration) ?> </time> <img src="<?= $episode->cover diff --git a/themes/cp_app/episode/_partials/preview_card.php b/themes/cp_app/episode/_partials/preview_card.php index 4554051227b1f02ee64c418811273b57467b2813..0507fc15132f6f03b195e60fe8e9e46f7d01049e 100644 --- a/themes/cp_app/episode/_partials/preview_card.php +++ b/themes/cp_app/episode/_partials/preview_card.php @@ -1,6 +1,6 @@ <div class="flex items-center border-y border-subtle"> <div class="relative"> - <time class="absolute px-1 text-sm font-semibold text-white rounded bg-black/75 bottom-2 right-2" datetime="PT<?= $episode->audio->duration ?>S"> + <time class="absolute px-1 text-sm font-semibold text-white rounded bg-black/75 bottom-2 right-2" datetime="PT<?= round($episode->audio->duration, 3) ?>S"> <?= format_duration($episode->audio->duration) ?> </time> <img diff --git a/themes/cp_app/home.php b/themes/cp_app/home.php index b217e82fafea5680a19d3f16ab72357a83ad7c94..39abc5cdc6da7b561553bff23a42e285f16d548c 100644 --- a/themes/cp_app/home.php +++ b/themes/cp_app/home.php @@ -5,10 +5,6 @@ <head> <meta charset="UTF-8"/> - <title><?= service('settings') - ->get('App.siteName') ?></title> - <meta name="description" content="<?= service('settings') - ->get('App.siteDescription') ?>"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <link rel="icon" type="image/x-icon" href="<?= service('settings') ->get('App.siteIcon')['ico'] ?>" /> @@ -41,20 +37,20 @@ <?php endif; ?> <header class="py-8 text-white border-b bg-header border-subtle"> - <div class="container flex items-center justify-between px-2 py-4 mx-auto"> + <h1 class="container flex items-center justify-between px-2 py-4 mx-auto"> <a href="<?= route_to( 'home', ) ?>" class="inline-flex items-baseline text-3xl font-semibold font-display"><?= service('settings') ->get('App.siteName') === 'Castopod' ? 'castopod' . svg('castopod-logo-base', 'h-6 ml-2') : service('settings') ->get('App.siteName') ?></a> - </div> + </h1> </header> <main class="container flex-1 px-4 py-10 mx-auto"> - <Heading class="inline-block mb-2"><?= lang('Home.all_podcasts') ?> (<?= count( + <Heading tagName="h2" class="inline-block mb-2"><?= lang('Home.all_podcasts') ?> (<?= count( $podcasts, ) ?>)</Heading> - <section class="grid gap-4 grid-cols-cards"> + <div class="grid gap-4 grid-cols-cards"> <?php if ($podcasts): ?> <?php foreach ($podcasts as $podcast): ?> <a href="<?= $podcast->link ?>" class="relative w-full h-full overflow-hidden transition shadow focus:ring-accent rounded-xl border-subtle hover:shadow-xl focus:shadow-xl group border-3"> @@ -65,7 +61,7 @@ <img alt="<?= $podcast->title ?>" src="<?= $podcast->cover->medium_url ?>" class="object-cover w-full h-full transition duration-200 ease-in-out transform bg-header aspect-square group-focus:scale-105 group-hover:scale-105" loading="lazy" /> </div> <div class="absolute bottom-0 left-0 z-20 w-full px-4 pb-2"> - <h2 class="font-bold leading-none truncate font-display"><?= $podcast->title ?></h2> + <h3 class="font-bold leading-none truncate font-display"><?= $podcast->title ?></h3> <p class="text-sm opacity-75">@<?= $podcast->handle ?></p> </div> </article> @@ -74,7 +70,7 @@ <?php else: ?> <p class="italic"><?= lang('Home.no_podcast') ?></p> <?php endif; ?> - </section> + </div> </main> <footer class="container flex justify-between px-2 py-4 mx-auto text-sm text-right border-t border-subtle"> <?= render_page_links() ?> diff --git a/themes/cp_app/podcast/about.php b/themes/cp_app/podcast/about.php index 24b6a674a061bab1a8f30ae7b3fceee0a4b380e9..2a1178c9ad607f43efc10838abca4c7c44458e9d 100644 --- a/themes/cp_app/podcast/about.php +++ b/themes/cp_app/podcast/about.php @@ -22,7 +22,7 @@ <div class="flex items-center mt-4 gap-x-8"> <?php if ($podcast->persons !== []): ?> <button class="flex items-center text-xs font-semibold gap-x-2 hover:underline focus:ring-accent" data-toggle="persons-list" data-toggle-class="hidden"> - <div class="inline-flex flex-row-reverse"> + <span class="inline-flex flex-row-reverse"> <?php $i = 0; ?> <?php foreach ($podcast->persons as $person): ?> <img src="<?= $person->avatar->thumbnail_url ?>" alt="<?= $person->full_name ?>" class="object-cover w-8 -ml-4 border-2 rounded-full aspect-square bg-header border-background-base last:ml-0" loading="lazy" /> @@ -30,7 +30,7 @@ break; }?> <?php endforeach; ?> - </div> + </span> <?= lang('Podcast.persons', [ 'personsCount' => count($podcast->persons), ]) ?>