From 8843a8cb197e71b1ca42f1ea56be5f806ad0f5b4 Mon Sep 17 00:00:00 2001
From: winter
Date: Sat, 15 Mar 2025 21:26:02 +0000
Subject: implement note editing
and improve display of edited note timestamps
---
templates/note/editable.php | 30 ++++++++++++++++++++++++++++
templates/note/info_line.php | 28 ++++++++++++++++++++++++++
templates/note/note.php | 47 +++++++++++++++-----------------------------
3 files changed, 74 insertions(+), 31 deletions(-)
create mode 100644 templates/note/editable.php
create mode 100644 templates/note/info_line.php
(limited to 'templates/note')
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 @@
+
+
+ $note->author]); ?>
+
+
+
+
\ No newline at end of file
diff --git a/templates/note/info_line.php b/templates/note/info_line.php
new file mode 100644
index 0000000..acc85d7
--- /dev/null
+++ b/templates/note/info_line.php
@@ -0,0 +1,28 @@
+
+
\ No newline at end of file
diff --git a/templates/note/note.php b/templates/note/note.php
index 7cef342..0d48272 100644
--- a/templates/note/note.php
+++ b/templates/note/note.php
@@ -3,7 +3,6 @@
use Digitigrade\Model\Actor;
use Digitigrade\Model\InteractionKind;
-use Digitigrade\Model\NotePrivacyScope;
use Digitigrade\Model\UserAccount;
use Digitigrade\UserSettings;
@@ -17,7 +16,6 @@ if ($user != null) {
$interactions = $note->getInteractionsWithAuthor($user->actor);
$interKinds = array_map(fn($inter) => $inter->kind, $interactions);
}
-$pathToSelf = $note->getLocalUiHref();
?>
@@ -27,40 +25,14 @@ $pathToSelf = $note->getLocalUiHref();
-
+ $note]); ?>
inReplyTo)): ?>
@@ -68,7 +40,7 @@ $pathToSelf = $note->getLocalUiHref();
- = sprintf(__('note.info.mentions'), implode(', ', array_map(
+ = __f('note.info.mentions', implode(', ', array_map(
fn(Actor $m) => '' . htmlspecialchars($m->displayName) . ' ',
$note->mentions
))) ?>
@@ -76,6 +48,13 @@ $pathToSelf = $note->getLocalUiHref();
+ modified) && $note->modified != $note->created): ?>
+
+
+ = __f('note.info.modified', format_datetime($note->modified)) ?>
+
+
+
summary)): ?>
= htmlspecialchars($note->summary) ?>
@@ -150,6 +129,12 @@ $pathToSelf = $note->getLocalUiHref();
author->isLocal && ($note->author == $user?->actor || $user?->isAdmin)): ?>
+
+
+
+ = __('note.action.edit') ?>
+
+