2021-10-22 16:35:11 +02:00
|
|
|
<?php declare(strict_types=1);
|
|
|
|
|
|
|
|
if ($post->in_reply_to_id): ?>
|
2021-11-05 15:36:34 +01:00
|
|
|
<div class="relative -mb-2 overflow-hidden border-t border-l border-r border-subtle rounded-t-xl">
|
|
|
|
<div class="absolute z-0 w-[2px] h-full bg-base left-[43px] top-4"></div>
|
2021-10-22 16:35:11 +02:00
|
|
|
<?= view('post/_partials/reply', [
|
|
|
|
'podcast' => $podcast,
|
|
|
|
'reply' => $post->reply_to_post,
|
|
|
|
]) ?>
|
|
|
|
</div>
|
|
|
|
<?php endif; ?>
|
2021-10-13 17:43:40 +02:00
|
|
|
<?= view('post/_partials/card', [
|
|
|
|
'index' => $index,
|
|
|
|
'post' => $post,
|
|
|
|
'podcast' => $podcast,
|
|
|
|
]) ?>
|
2021-11-05 15:36:34 +01:00
|
|
|
<div class="-mt-2 overflow-hidden border-b border-l border-r border-subtle post-replies rounded-b-xl">
|
|
|
|
<div class="px-6 pt-8 pb-4 bg-base">
|
2021-10-13 17:43:40 +02:00
|
|
|
<?php if (can_user_interact()): ?>
|
2022-03-04 15:33:48 +01:00
|
|
|
<form action="<?= route_to('post-attempt-action', esc(interact_as_actor()->username), $post->id) ?>" method="POST" class="flex gap-x-2" >
|
|
|
|
<?= csrf_field() ?>
|
|
|
|
|
2021-10-13 17:43:40 +02:00
|
|
|
<img src="<?= interact_as_actor()
|
2022-03-04 15:33:48 +01:00
|
|
|
->avatar_image_url ?>" alt="<?= esc(interact_as_actor()
|
|
|
|
->display_name) ?>" class="w-10 h-10 rounded-full aspect-square" loading="lazy" />
|
2021-10-13 17:43:40 +02:00
|
|
|
<div class="flex flex-col flex-1">
|
|
|
|
<Forms.Textarea
|
|
|
|
name="message"
|
|
|
|
class="w-full mb-4"
|
|
|
|
required="true"
|
|
|
|
placeholder="<?= lang('Post.form.reply_to_placeholder', [
|
2022-03-04 15:33:48 +01:00
|
|
|
'actorUsername' => esc($post->actor->username),
|
2021-10-13 17:43:40 +02:00
|
|
|
]) ?>"
|
|
|
|
rows="1" />
|
|
|
|
<Button variant="primary" size="small" type="submit" name="action" value="reply" class="self-end" iconRight="send-plane"><?= lang('Post.form.submit_reply') ?></Button>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
<?php else: ?>
|
|
|
|
<?= anchor_popup(
|
2022-03-04 15:33:48 +01:00
|
|
|
route_to('post-remote-action', esc($podcast->handle), $post->id, 'reply'),
|
2021-10-13 17:43:40 +02:00
|
|
|
lang('Post.reply_to', [
|
2022-03-04 15:33:48 +01:00
|
|
|
'actorUsername' => esc($post->actor->username),
|
2021-10-13 17:43:40 +02:00
|
|
|
]),
|
|
|
|
[
|
|
|
|
'class' =>
|
2021-11-05 15:36:34 +01:00
|
|
|
'text-center justify-center font-semibold rounded-full shadow relative z-10 px-4 py-2 w-full bg-accent-base text-accent-contrast inline-flex items-center hover:bg-accent-hover',
|
2021-10-13 17:43:40 +02:00
|
|
|
'width' => 420,
|
|
|
|
'height' => 620,
|
|
|
|
],
|
|
|
|
) ?>
|
|
|
|
<?php endif; ?>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<?php if ($post->has_replies): ?>
|
2021-11-05 15:36:34 +01:00
|
|
|
<div class="border-t divide-y border-subtle">
|
2021-10-13 17:43:40 +02:00
|
|
|
<?php foreach ($post->replies as $reply): ?>
|
|
|
|
<?= view('post/_partials/reply', [
|
|
|
|
'podcast' => $podcast,
|
|
|
|
'reply' => $reply,
|
|
|
|
]) ?>
|
|
|
|
<?php endforeach; ?>
|
2021-10-22 16:35:11 +02:00
|
|
|
</div>
|
2021-10-13 17:43:40 +02:00
|
|
|
<?php endif; ?>
|
|
|
|
</div>
|