From 680978920661aa043f6652fbdee5173c0a1fb905 Mon Sep 17 00:00:00 2001
From: Yassine Doghri <yassine@doghri.fr>
Date: Fri, 31 Dec 2021 10:21:57 +0000
Subject: [PATCH] refactor: set episode and podcast type hints next to each
 option

---
 modules/Admin/Language/en/Episode.php | 5 +++--
 modules/Admin/Language/en/Podcast.php | 4 ++--
 modules/Admin/Language/fr/Episode.php | 5 +++--
 modules/Admin/Language/fr/Podcast.php | 4 ++--
 themes/cp_admin/episode/create.php    | 8 ++++----
 themes/cp_admin/episode/edit.php      | 8 ++++----
 themes/cp_admin/podcast/_card.php     | 4 ++--
 themes/cp_admin/podcast/create.php    | 5 +++--
 themes/cp_admin/podcast/edit.php      | 5 +++--
 9 files changed, 26 insertions(+), 22 deletions(-)

diff --git a/modules/Admin/Language/en/Episode.php b/modules/Admin/Language/en/Episode.php
index ea510aade0..b3b2354684 100644
--- a/modules/Admin/Language/en/Episode.php
+++ b/modules/Admin/Language/en/Episode.php
@@ -61,11 +61,12 @@ return [
         'episode_number' => 'Episode',
         'type' => [
             'label' => 'Type',
-            'hint' =>
-                '- <strong>full</strong>: complete content the episode.<br/>- <strong>trailer</strong>: short, promotional piece of content that represents a preview of the current show.<br/>- <strong>bonus</strong>: extra content for the show (for example, behind the scenes info or interviews with the cast) or cross-promotional content for another show.',
             'full' => 'Full',
+            'full_hint' => 'Complete content (the episode)',
             'trailer' => 'Trailer',
+            'trailer_hint' => 'Short, promotional piece of content that represents a preview of the current show',
             'bonus' => 'Bonus',
+            'bonus_hint' => 'Extra content for the show (for example, behind the scenes info or interviews with the cast) or cross-promotional content for another show',
         ],
         'parental_advisory' => [
             'label' => 'Parental advisory',
diff --git a/modules/Admin/Language/en/Podcast.php b/modules/Admin/Language/en/Podcast.php
index 2a40d5b7f8..c03e46f8a7 100644
--- a/modules/Admin/Language/en/Podcast.php
+++ b/modules/Admin/Language/en/Podcast.php
@@ -36,10 +36,10 @@ return [
             'Used to identify the podcast. Uppercase, lowercase, numbers and underscores are accepted.',
         'type' => [
             'label' => 'Type',
-            'hint' =>
-                '- <strong>episodic</strong>: if episodes are intended to be consumed without any specific order. Newest episodes will be presented first.<br/>- <strong>serial</strong>: if episodes are intended to be consumed in sequential order. The oldest episodes will be presented first.',
             'episodic' => 'Episodic',
+            'episodic_hint' => 'If episodes are intended to be consumed without any specific order. Newest episodes will be presented first.',
             'serial' => 'Serial',
+            'serial_hint' => 'If episodes are intended to be consumed in sequential order. The oldest episodes will be presented first.',
         ],
         'description' => 'Description',
         'classification_section_title' => 'Classification',
diff --git a/modules/Admin/Language/fr/Episode.php b/modules/Admin/Language/fr/Episode.php
index 1c5cbe4414..796a7aa904 100644
--- a/modules/Admin/Language/fr/Episode.php
+++ b/modules/Admin/Language/fr/Episode.php
@@ -62,11 +62,12 @@ return [
         'episode_number' => 'Épisode',
         'type' => [
             'label' => 'Type',
-            'hint' =>
-                '- <strong>complet</strong>: épisode complet.<br/>- <strong>bande-annonce</strong>: extrait court, promotionnel du podcast.<br/>- <strong>bonus</strong> :  contenu supplémentaire pour le podcast (par exemple des informations sur les coulisses ou des interviews avec les acteurs) ou du contenu promotionnel croisé pour un autre podcast.',
             'full' => 'Complet',
+            'full_hint' => 'Épisode complet',
             'trailer' => 'Bande-annonce',
+            'trailer_hint' => 'Extrait court, promotionnel du podcast',
             'bonus' => 'Bonus',
+            'bonus_hint' => 'Contenu supplémentaire pour le podcast (par exemple des informations sur les coulisses ou des interviews avec les acteurs) ou du contenu promotionnel croisé pour un autre podcast',
         ],
         'parental_advisory' => [
             'label' => 'Avertissement parental',
diff --git a/modules/Admin/Language/fr/Podcast.php b/modules/Admin/Language/fr/Podcast.php
index 268014e3cc..8129f592c3 100644
--- a/modules/Admin/Language/fr/Podcast.php
+++ b/modules/Admin/Language/fr/Podcast.php
@@ -37,10 +37,10 @@ return [
             'Utilisé pour identifier le podcast. Les majuscules, les minuscules, les chiffres et le caractère souligné « _ » sont acceptés.',
         'type' => [
             'label' => 'Type',
-            'hint' =>
-                '- <strong>épisodique</strong> : si les épisodes sont destinés à être consommés sans ordre spécifique. Les épisodes les plus récents seront présentés en premier.<br/>- <strong>série</strong>: si les épisodes sont destinés à être consommés dans un ordre séquentiel bien défini. Les épisodes les plus anciens seront présentés en premier.',
             'episodic' => 'Épisodique',
+            'episodic_hint' => 'Si les épisodes sont destinés à être consommés sans ordre spécifique. Les épisodes les plus récents seront présentés en premier.',
             'serial' => 'Série',
+            'serial_hint' => 'Si les épisodes sont destinés à être consommés dans un ordre séquentiel bien défini. Les épisodes les plus anciens seront présentés en premier.',
         ],
         'description' => 'Description',
         'classification_section_title' => 'Classification',
diff --git a/themes/cp_admin/episode/create.php b/themes/cp_admin/episode/create.php
index 93b92c702f..617a2158f0 100644
--- a/themes/cp_admin/episode/create.php
+++ b/themes/cp_admin/episode/create.php
@@ -66,21 +66,21 @@
 </div>
 
 <fieldset class="flex gap-1">
-<legend>
-    <?= lang('Episode.form.type.label') .
-        hint_tooltip(lang('Episode.form.type.hint'), 'ml-1') ?>
-</legend>
+<legend><?= lang('Episode.form.type.label') ?></legend>
 <Forms.RadioButton
     value="full"
     name="type"
+    hint="<?= lang('Episode.form.type.full_hint') ?>"
     isChecked="true" ><?= lang('Episode.form.type.full') ?></Forms.RadioButton>
 <Forms.RadioButton
     value="trailer"
     name="type"
+    hint="<?= lang('Episode.form.type.trailer_hint') ?>"
     isChecked="false" ><?= lang('Episode.form.type.trailer') ?></Forms.RadioButton>    
 <Forms.RadioButton
     value="bonus"
     name="type"
+    hint="<?= lang('Episode.form.type.bonus_hint') ?>"
     isChecked="false" ><?= lang('Episode.form.type.bonus') ?></Forms.RadioButton>
 </fieldset>
 
diff --git a/themes/cp_admin/episode/edit.php b/themes/cp_admin/episode/edit.php
index 3b1e6873e0..1c0add5d4a 100644
--- a/themes/cp_admin/episode/edit.php
+++ b/themes/cp_admin/episode/edit.php
@@ -72,21 +72,21 @@
 </div>
 
 <fieldset class="flex gap-1">
-<legend>
-    <?= lang('Episode.form.type.label') .
-        hint_tooltip(lang('Episode.form.type.hint'), 'ml-1') ?>
-</legend>
+<legend><?= lang('Episode.form.type.label') ?></legend>
 <Forms.RadioButton
     value="full"
     name="type"
+    hint="<?= lang('Episode.form.type.full_hint') ?>"
     isChecked="<?= $episode->type === 'full' ? 'true' : 'false' ?>" ><?= lang('Episode.form.type.full') ?></Forms.RadioButton>
 <Forms.RadioButton
     value="trailer"
     name="type"
+    hint="<?= lang('Episode.form.type.trailer_hint') ?>"
     isChecked="<?= $episode->type === 'trailer' ? 'true' : 'false' ?>" ><?= lang('Episode.form.type.trailer') ?></Forms.RadioButton>    
 <Forms.RadioButton
     value="bonus"
     name="type"
+    hint="<?= lang('Episode.form.type.bonus_hint') ?>"
     isChecked="<?= $episode->type === 'bonus' ? 'true' : 'false' ?>" ><?= lang('Episode.form.type.bonus') ?></Forms.RadioButton>
 </fieldset>
 
diff --git a/themes/cp_admin/podcast/_card.php b/themes/cp_admin/podcast/_card.php
index cc8abe03fb..98953a4d4e 100644
--- a/themes/cp_admin/podcast/_card.php
+++ b/themes/cp_admin/podcast/_card.php
@@ -6,9 +6,9 @@
             alt="<?= $podcast->title ?>"
             src="<?= $podcast->cover->medium_url ?>" class="object-cover w-full h-full transition duration-200 ease-in-out transform aspect-square group-focus:scale-105 group-hover:scale-105" />
         </div>
-        <div class="absolute z-20 px-4 pb-4 transition duration-75 ease-out translate-y-6 group-focus:translate-y-0 group-hover:translate-y-0">
+        <div class="absolute z-20 w-full px-4 pb-4 transition duration-75 ease-out translate-y-6 group-focus:translate-y-0 group-hover:translate-y-0">
             <h2 class="font-bold leading-none truncate font-display"><?= $podcast->title ?></h2>
-            <p class="text-sm transition duration-150 opacity-0 group-focus:opacity-75 group-hover:opacity-75">@<?= $podcast->handle ?></p>
+            <p class="text-sm transition duration-150 opacity-0 group-focus:opacity-100 group-hover:opacity-100">@<?= $podcast->handle ?></p>
         </div>
     </a>
     <button class="absolute top-0 right-0 z-10 p-2 mt-2 mr-2 text-white transition -translate-y-12 rounded-full opacity-0 focus:ring-accent focus:opacity-100 focus:-translate-y-0 group-hover:translate-y-0 bg-black/50 group-hover:opacity-100" id="more-dropdown-<?= $podcast->id ?>" data-dropdown="button" data-dropdown-target="more-dropdown-<?= $podcast->id ?>-menu" aria-haspopup="true" aria-expanded="false" title="<?= lang('Common.more') ?>"><?= icon('more') ?></button>
diff --git a/themes/cp_admin/podcast/create.php b/themes/cp_admin/podcast/create.php
index 804c66071f..452ff8d57e 100644
--- a/themes/cp_admin/podcast/create.php
+++ b/themes/cp_admin/podcast/create.php
@@ -56,16 +56,17 @@
     required="true" />
 
 <fieldset>
-    <legend><?= lang('Podcast.form.type.label') .
-                hint_tooltip(lang('Podcast.form.type.hint'), 'ml-1') ?></legend>
+    <legend><?= lang('Podcast.form.type.label') ?></legend>
     <div class="flex gap-2">
         <Forms.RadioButton
             value="episodic"
             name="type"
+            hint="<?= lang('Podcast.form.type.episodic_hint') ?>"
             isChecked="true'" ><?= lang('Podcast.form.type.episodic') ?></Forms.RadioButton>
         <Forms.RadioButton
             value="serial"
             name="type"
+            hint="<?= lang('Podcast.form.type.serial_hint') ?>"
             isChecked="false" ><?= lang('Podcast.form.type.serial') ?></Forms.RadioButton>
     </div>
 </fieldset>
diff --git a/themes/cp_admin/podcast/edit.php b/themes/cp_admin/podcast/edit.php
index eb03dc58ff..a6fcec9f5d 100644
--- a/themes/cp_admin/podcast/edit.php
+++ b/themes/cp_admin/podcast/edit.php
@@ -71,16 +71,17 @@
     required="true" />
 
 <fieldset>
-    <legend><?= lang('Podcast.form.type.label') .
-                hint_tooltip(lang('Podcast.form.type.hint'), 'ml-1') ?></legend>
+    <legend><?= lang('Podcast.form.type.label') ?></legend>
     <div class="flex gap-2">
         <Forms.RadioButton
             value="episodic"
             name="type"
+            hint="<?= lang('Podcast.form.type.episodic_hint') ?>"
             isChecked="<?= $podcast->type === 'episodic' ? 'true' : 'false' ?>" ><?= lang('Podcast.form.type.episodic') ?></Forms.RadioButton>
         <Forms.RadioButton
             value="serial"
             name="type"
+            hint="<?= lang('Podcast.form.type.serial_hint') ?>"
             isChecked="<?= $podcast->type === 'serial' ? 'true' : 'false' ?>" ><?= lang('Podcast.form.type.serial') ?></Forms.RadioButton>
     </div>
 </fieldset>
-- 
GitLab