diff options
Diffstat (limited to 'templates/reply_form.php')
| -rw-r--r-- | templates/reply_form.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/templates/reply_form.php b/templates/reply_form.php index 915189e..1b9961e 100644 --- a/templates/reply_form.php +++ b/templates/reply_form.php @@ -1,4 +1,5 @@ <?php +use Digitigrade\Model\NotePrivacyScope; use Digitigrade\Model\UserAccount; $user = UserAccount::findByCurrentSession(); @@ -11,6 +12,14 @@ if ($note->summary) { $summaryText = "re: $note->summary"; } } + +$scopeOptions = match ($note->privacy->scope) { + NotePrivacyScope::NONE => ['none'], + NotePrivacyScope::MUTUALS => ['none', 'mutuals'], + NotePrivacyScope::FOLLOWERS => ['none', 'mutuals', 'followers'], + default => ['none', 'mutuals', 'followers', 'public'] +}; +$selectedScope = $note->privacy->scope->value; ?> <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" @@ -34,6 +43,16 @@ if ($note->summary) { <?php call_template('user_mention_pill'); ?> </div> <div class="row"> + <label for="replyScope-<?= $note->id ?>"><?= __('writeNote.scope.label') ?></label> + <select name="scope" id="replyScope-<?= $note->id ?>" required autocomplete="off"> + <?php foreach ($scopeOptions as $s): ?> + <option value="<?= $s ?>" <?= $selectedScope == $s ? 'selected' : '' ?>> + <?= __("note.privacy.scope.$s") ?> + </option> + <?php endforeach; ?> + </select> + </div> + <div class="row"> <button class="primary"><?= __('writeReply.action') ?></button> </div> </form>
\ No newline at end of file |
