aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/note/editable.php
blob: 7a864a90d92da89177e25d58201b85ed914bb95b (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
<article class="note">
    <a href="/@/<?= $note->author->getFullHandle() ?>">
        <?php call_template('actor/avatar', ['actor' => $note->author]); ?>
    </a>

    <div>

        <?php call_template('note/info_line', ['note' => $note]); ?>

        <form hx-post="/fragment/note/<?= $note->id ?>/edit" hx-target="closest .note" hx-swap="outerHTML"
            class="noteEditForm">
            <div class="row summaryAndContent">
                <label for="noteContent-<?= $note->id ?>"><?= __('note.editForm.label') ?></label>
                <input name="summary" type="text" placeholder="<?= __('writeNote.summary.label') ?>"
                    value="<?= htmlspecialchars($note->summary) ?>">
                <textarea id="noteContent-<?= $note->id ?>" name="content" required
                    placeholder="<?= __('writeNote.placeholder') ?>"><?= htmlspecialchars(
                          $note->formattedContent['text/markdown'] ?? $note->plainContent
                      ) ?></textarea>
                <?php call_template('formatting_hint'); ?>
            </div>
            <div class="row actionButtons">
                <button type="button" class="secondary"
                    hx-get="/fragment/note/<?= $note->id ?>"><?= __('form.discardChanges') ?></button>
                <button type="submit" class="primary"><?= __('form.saveChanges') ?></button>
            </div>
        </form>

    </div>
</article>