feat: closes #13961, rename ban-reasons to custom reasons

use them for ban, mute and post queue depending on the type selected
if type is set to all, the reason is displayed in ban/mute and post queue
move reason label + dropdown + textarea  to a partial
This commit is contained in:
Barış Soner Uşaklı
2026-02-07 21:41:11 -05:00
parent 1d17352f67
commit 0eaf2beeb2
23 changed files with 266 additions and 194 deletions

View File

@@ -592,7 +592,10 @@ postsAPI.removeQueuedPost = async (caller, data) => {
await canEditQueue(caller.uid, data, 'reject');
const result = await posts.removeFromQueue(data.id);
if (result && caller.uid !== parseInt(result.uid, 10)) {
await sendQueueNotification('post-queue-rejected', result.uid, '/');
const msg = validator.escape(String(data.message ? data.message : ''));
await sendQueueNotification(
msg ? 'post-queue-rejected-for-reason' : 'post-queue-rejected', result.uid, '/', msg
);
}
await logQueueEvent(caller, result, 'reject');
};
@@ -612,7 +615,7 @@ postsAPI.notifyQueuedPostOwner = async (caller, data) => {
await canEditQueue(caller.uid, data, 'notify');
const result = await posts.getFromQueue(data.id);
if (result) {
await sendQueueNotification('post-queue-notify', result.uid, `/post-queue/${data.id}`, validator.escape(String(data.message)));
await sendQueueNotification('post-queue-notify', result.uid, `/post-queue/${data.id}`, validator.escape(String(data.message || '')));
}
};