diff options
| author | winter | 2025-03-15 21:26:02 +0000 |
|---|---|---|
| committer | winter | 2025-03-15 21:26:02 +0000 |
| commit | 8843a8cb197e71b1ca42f1ea56be5f806ad0f5b4 (patch) | |
| tree | 20ca690e9bd3e4996421eb4d43c0b4fbdaf0ff95 /templates/note/editable.php | |
| parent | d8e440b1998e5c3e33445f2ec020d261fc7fa714 (diff) | |
implement note editing
and improve display of edited note timestamps
Diffstat (limited to 'templates/note/editable.php')
| -rw-r--r-- | templates/note/editable.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/templates/note/editable.php b/templates/note/editable.php new file mode 100644 index 0000000..7a864a9 --- /dev/null +++ b/templates/note/editable.php @@ -0,0 +1,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>
\ No newline at end of file |
