diff options
| -rw-r--r-- | templates/reply_form.php | 11 | ||||
| -rw-r--r-- | templates/thread_page.php | 5 |
2 files changed, 13 insertions, 3 deletions
diff --git a/templates/reply_form.php b/templates/reply_form.php index 57a0dd0..915189e 100644 --- a/templates/reply_form.php +++ b/templates/reply_form.php @@ -2,6 +2,15 @@ use Digitigrade\Model\UserAccount; $user = UserAccount::findByCurrentSession(); + +$summaryText = ''; +if ($note->summary) { + if (strtolower(substr($note->summary, 0, 3)) == 're:') { + $summaryText = $note->summary; + } else { + $summaryText = "re: $note->summary"; + } +} ?> <form class="noteReplyForm" id="replyForm-<?= $note->id ?>" _="on submit send toggle to previous <button.reply/> then wait 1s then trigger update on #liveTimelineUpdater on toggle or submit toggle @hidden" @@ -13,7 +22,7 @@ $user = UserAccount::findByCurrentSession(); <div class="row"> <label for="replySummary-<?= $note->id ?>"><?= __('writeNote.summary.label') ?></label> <input type="text" id="replySummary-<?= $note->id ?>" name="summary" autocomplete="off" - value="<?= $note->summary ? "re: $note->summary" : '' ?>"> + value="<?= $summaryText ?>"> </div> <div class="row"> <label class="standalone"><?= __('writeNote.mentions.label') ?></label> diff --git a/templates/thread_page.php b/templates/thread_page.php index b46c968..cec94e2 100644 --- a/templates/thread_page.php +++ b/templates/thread_page.php @@ -12,11 +12,12 @@ call_template('skeleton', [ 'ogHandle' => '@' . $note->author->getFullHandle(true) ], function () { global $note; - $notes = Note::findAllInThread($note->threadApex ?? $note); + $targetNote = $note; // renaming this because my templating system clobbers it. :( + $notes = Note::findAllInThread($targetNote->threadApex ?? $targetNote); $user = UserAccount::findByCurrentSession(); foreach ($notes as $n) { if (!($user != null && $user->actor->blocks($n->author))) { - call_template('note', ['note' => $n, 'selected' => $n == $note]); + call_template('note', ['note' => $n, 'selected' => $n == $targetNote]); } } });
\ No newline at end of file |
