aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/note/editable.php
diff options
context:
space:
mode:
Diffstat (limited to 'templates/note/editable.php')
-rw-r--r--templates/note/editable.php30
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