diff options
Diffstat (limited to 'templates/pages/editable.php')
| -rw-r--r-- | templates/pages/editable.php | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/templates/pages/editable.php b/templates/pages/editable.php new file mode 100644 index 0000000..67c97ca --- /dev/null +++ b/templates/pages/editable.php @@ -0,0 +1,39 @@ +<article> + <form class="pageEditForm nobackground" hx-post="/fragment/page/<?= $note->id ?>/edit" hx-target="closest article" + hx-swap="outerHTML"> + <div class="row"> + <label for="pageTitle"><?= __('note.page.new.title.label') ?></label> + <input type="text" id="pageTitle" name="title" value="<?= htmlspecialchars($page->title) ?>" required> + </div> + + <div class="row"> + <a class="pageAuthor" href="/@/<?= htmlspecialchars($note->author->getFullHandle()) ?>"> + <?php call_template('actor/avatar', ['actor' => $note->author]); ?> + <span><?= __f( + 'note.page.author', + '<span class="displayName">' . htmlspecialchars($note->author->displayName) . '</span>' + ) ?></span> + </a> + <div class="created"> + <?= __f('note.page.created', format_datetime($note->created)) ?> + </div> + <?php if (isset($note->modified) && $note->modified != $note->created): ?> + <div class="modified"> + <?= __f('note.page.modified', format_datetime($note->modified)) ?> + </div> + <?php endif; ?> + <hr> + </div> + + <div class="row"> + <label for="pageBody"><?= __('note.page.new.body.label') ?></label> + <textarea id="pageBody" name="body" required><?= $page->content['text/markdown'] ?></textarea> + </div> + + <div class="row actionButtons"> + <button type="button" class="secondary" hx-get="/fragment/page/<?= $note->id ?>" hx-target="closest article" + hx-swap="outerHTML"><?= __('form.discardChanges') ?></button> + <button type="submit" class="primary"><?= __('form.saveChanges') ?></button> + </div> + </form> +</article>
\ No newline at end of file |
