aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/reply_form.php
blob: 57a0dd0ecc3311fabe8a10ff4502c893880d5619 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
use Digitigrade\Model\UserAccount;

$user = UserAccount::findByCurrentSession();
?>
<form class="noteReplyForm" id="replyForm-<?= $note->id ?>"
    _="on submit send toggle to previous <button.reply/> then wait 1s then trigger update on #liveTimelineUpdater on toggle or submit toggle @hidden"
    hidden hx-post="/fragment/note/<?= $note->id ?>/reply" hx-disabled-elt="find button" hx-swap="outerHTML">
    <div class="row">
        <label for="replyContent-<?= $note->id ?>"><?= __('writeReply.label') ?></label>
        <textarea id="replyContent-<?= $note->id ?>" name="content" required autocomplete="off"></textarea>
    </div>
    <div class="row">
        <label for="replySummary-<?= $note->id ?>"><?= __('writeNote.summary.label') ?></label>
        <input type="text" id="replySummary-<?= $note->id ?>" name="summary" autocomplete="off"
            value="<?= $note->summary ? "re: $note->summary" : '' ?>">
    </div>
    <div class="row">
        <label class="standalone"><?= __('writeNote.mentions.label') ?></label>
        <?php foreach (array_merge($note->mentions, [$note->author]) as $m) {
            if ($m != $user?->actor) {
                call_template('user_mention_pill', ['type' => 'user', 'actor' => $m]);
            }
        } ?>
        <?php call_template('user_mention_pill'); ?>
    </div>
    <div class="row">
        <button class="primary"><?= __('writeReply.action') ?></button>
    </div>
</form>