aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/write_note_form.php
blob: 9294a7c37e962d73699dc4f320abddc67664e92b (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<form hidden id="writeNoteAttachmentForm" action="/todo" hx-post="/fragment/note/attachmentPill" hx-swap="beforebegin"
    hx-target="#writeNoteAttachmentPillAdder" enctype="multipart/form-data">
    <input hidden type="file" name="file" id="noteAttachmentFile" _="on change send submit to closest <form/>">
</form>

<form id="writeNoteForm" action="/todo" method="post" hx-post="/fragment/note" hx-swap="outerHTML"
    hx-disabled-elt="find button" _="on submit wait 1s then trigger update on #liveTimelineUpdater"
    <?= ($_SERVER['REQUEST_METHOD'] == 'GET') ? 'hx-preserve' : '' ?>>
    <div class="row miniProfile">
        <a href="/@/<?= $actor->handle ?>">
            <?php call_template('actor_avatar', ['actor' => $actor]); ?>
        </a>
        <div class="basicInfo">
            <a class="displayName" href="/@/<?= $actor->handle ?>"><?= htmlspecialchars($actor->displayName) ?></a>
            <div class="handle">@<?= $actor->handle ?></div>
        </div>
    </div>
    <div class="row summaryAndContent">
        <label for="noteContent"><?= __('writeNote.label') ?></label>
        <input type="text" id="noteSummary" name="summary" autocomplete="off"
            placeholder="<?= __('writeNote.summary.label') ?>">
        <textarea name="content" id="noteContent" required autocomplete="off"
            placeholder="<?= __('writeNote.placeholder') ?>"></textarea>
    </div>
    <details>
        <summary><?= __('writeNote.moreOptions') ?></summary>
        <div class="row">
            <label class="standalone"><?= __('writeNote.mentions.label') ?></label>
            <?php call_template('user_mention_pill'); ?>
        </div>
        <div class="row">
            <label class="standalone"><?= __('writeNote.attachments.label') ?></label>
            <?php call_template('attachment_pill'); ?>
        </div>
        <div class="row">
            <label for="noteScope"><?= __('writeNote.scope.label') ?></label>
            <select name="scope" id="noteScope" required autocomplete="off">
                <option value="none"><?= __('note.privacy.scope.none') ?></option>
                <option value="mutuals"><?= __('note.privacy.scope.mutuals') ?></option>
                <option value="followers"><?= __('note.privacy.scope.followers') ?></option>
                <option value="public" selected><?= __('note.privacy.scope.public') ?></option>
            </select>
        </div>
    </details>
    <div class="row">
        <button class="primary"><?= __('writeNote.action') ?></button>
    </div>
</form>