Unverified Commit acb8b3a4 authored by Yassine Doghri's avatar Yassine Doghri
Browse files

fix: check that note has a preview_card_id before displaying it

fixes #114
parent b81e8125
......@@ -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>
......@@ -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>
......@@ -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>
......@@ -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>
......@@ -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,
]) ?>
......
......@@ -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,
]) ?>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment