fix: check that note has a preview_card_id before displaying it

fixes #114
This commit is contained in:
Yassine Doghri 2021-04-16 16:31:09 +00:00
parent b81e812506
commit acb8b3a401
No known key found for this signature in database
GPG Key ID: 3E7F89498B960C9F
6 changed files with 18 additions and 22 deletions

View File

@ -27,15 +27,14 @@
</div>
</header>
<div class="px-6 mb-4 note-content"><?= $note->message_html ?></div>
<?php if ($note->preview_card): ?>
<?= view('podcast/_partials/preview_card', [
'preview_card' => $note->preview_card,
]) ?>
<?php endif; ?>
<?php if ($note->episode_id): ?>
<?= view('podcast/_partials/episode_card', [
'episode' => $note->episode,
]) ?>
<?php elseif ($note->preview_card_id): ?>
<?= view('podcast/_partials/preview_card', [
'preview_card' => $note->preview_card,
]) ?>
<?php endif; ?>
<?= $this->include('podcast/_partials/note_actions') ?>
</article>

View File

@ -27,15 +27,14 @@
</div>
</header>
<div class="px-6 mb-4 note-content"><?= $note->message_html ?></div>
<?php if ($note->preview_card): ?>
<?= view('podcast/_partials/preview_card', [
'preview_card' => $note->preview_card,
]) ?>
<?php endif; ?>
<?php if ($note->episode_id): ?>
<?= view('podcast/_partials/episode_card', [
'episode' => $note->episode,
]) ?>
<?php elseif ($note->preview_card_id): ?>
<?= view('podcast/_partials/preview_card', [
'preview_card' => $note->preview_card,
]) ?>
<?php endif; ?>
<?= $this->include('podcast/_partials/note_actions_authenticated') ?>
</article>

View File

@ -34,15 +34,14 @@
</div>
</header>
<div class="px-6 mb-4 note-content"><?= $note->message_html ?></div>
<?php if ($note->preview_card): ?>
<?= view('podcast/_partials/preview_card', [
'preview_card' => $note->preview_card,
]) ?>
<?php endif; ?>
<?php if ($note->episode_id): ?>
<?= view('podcast/_partials/episode_card', [
'episode' => $note->episode,
]) ?>
<?php elseif ($note->preview_card_id): ?>
<?= view('podcast/_partials/preview_card', [
'preview_card' => $note->preview_card,
]) ?>
<?php endif; ?>
<?= $this->include('podcast/_partials/note_actions') ?>
</article>

View File

@ -34,15 +34,14 @@
</div>
</header>
<div class="px-6 mb-4 note-content"><?= $note->message_html ?></div>
<?php if ($note->preview_card): ?>
<?= view('podcast/_partials/preview_card', [
'preview_card' => $note->preview_card,
]) ?>
<?php endif; ?>
<?php if ($note->episode_id): ?>
<?= view('podcast/_partials/episode_card', [
'episode' => $note->episode,
]) ?>
<?php elseif ($note->preview_card_id): ?>
<?= view('podcast/_partials/preview_card', [
'preview_card' => $note->preview_card,
]) ?>
<?php endif; ?>
<?= $this->include('podcast/_partials/note_actions_authenticated') ?>
</article>

View File

@ -19,7 +19,7 @@
><?= lang('Common.mediumDate', [$reply->published_at]) ?></time>
</header>
<p class="mb-2 note-content"><?= $reply->message_html ?></p>
<?php if ($reply->preview_card): ?>
<?php if ($reply->preview_card_id): ?>
<?= view('podcast/_partials/preview_card', [
'preview_card' => $reply->preview_card,
]) ?>

View File

@ -19,7 +19,7 @@
><?= lang('Common.mediumDate', [$reply->created_at]) ?></time>
</header>
<p class="mb-2 note-content"><?= $reply->message_html ?></p>
<?php if ($reply->preview_card): ?>
<?php if ($reply->preview_card_id): ?>
<?= view('podcast/_partials/preview_card', [
'preview_card' => $reply->preview_card,
]) ?>