From 6e503c8d6182987e48892370623183f871bbd1c1 Mon Sep 17 00:00:00 2001
From: Yassine Doghri <yassine@doghri.fr>
Date: Wed, 7 Oct 2020 10:12:14 +0000
Subject: [PATCH] fix(platforms): display platform link only when visible is
 toggled on

add condition to podcast page

fix #39
---
 app/Views/podcast.php | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/app/Views/podcast.php b/app/Views/podcast.php
index df2d582044..586f11e1f4 100644
--- a/app/Views/podcast.php
+++ b/app/Views/podcast.php
@@ -43,10 +43,15 @@
                             ]
                         ) ?>
                     <?php foreach ($podcast->platforms as $platform): ?>
-                        <a href="<?= $platform->link_url ?>" title="<?= $platform->label ?>" target="_blank" rel="noopener noreferrer" class="ml-2">
-                        <?= platform_icon($platform->icon_filename, 'h-8') ?>
-                        </a>
-                        <?php endforeach; ?>
+                        <?php if ($platform->visible): ?>
+                            <a href="<?= $platform->link_url ?>" title="<?= $platform->label ?>" target="_blank" rel="noopener noreferrer" class="ml-2">
+                            <?= platform_icon(
+                                $platform->icon_filename,
+                                'h-8'
+                            ) ?>
+                            </a>
+                        <?php endif; ?>
+                    <?php endforeach; ?>
                     </div>
                     <div class="mb-2 opacity-75">
                         <?= $podcast->description_html ?>
-- 
GitLab