diff --git a/files/assets/js/submit_emojis.js b/files/assets/js/submit_emojis.js index a72f7fcd15..d90217b3b2 100644 --- a/files/assets/js/submit_emojis.js +++ b/files/assets/js/submit_emojis.js @@ -1,6 +1,7 @@ function approve_emoji(t, name) { postToast(t, `/admin/approve/emoji/${name}`, { + "comment": document.getElementById(`${name}-comment`).value, "tags": document.getElementById(`${name}-tags`).value, "name": document.getElementById(`${name}-name`).value, "kind": document.getElementById(`${name}-kind`).value, @@ -15,7 +16,7 @@ function approve_emoji(t, name) { function remove_emoji(t, name) { postToast(t, `/remove/emoji/${name}`, { - "reason": document.getElementById(`${name}-reason`).value, + "comment": document.getElementById(`${name}-comment`).value, }, () => { document.getElementById(`${name}-emoji`).remove() diff --git a/files/assets/js/submit_hats.js b/files/assets/js/submit_hats.js index 0e989910ea..9a94df1630 100644 --- a/files/assets/js/submit_hats.js +++ b/files/assets/js/submit_hats.js @@ -2,6 +2,7 @@ function approve_hat(t) { const name = t.dataset.name postToast(t, `/admin/approve/hat/${name}`, { + "comment": document.getElementById(`${name}-comment`).value, "description": document.getElementById(`${name}-description`).value, "name": document.getElementById(`${name}-name`).value, "price": document.getElementById(`${name}-price`).value, @@ -16,7 +17,7 @@ function remove_hat(t) { const name = t.dataset.name postToast(t, `/remove/hat/${name}`, { - "reason": document.getElementById(`${name}-reason`).value, + "comment": document.getElementById(`${name}-comment`).value, }, () => { document.getElementById(`${name}-hat`).remove() diff --git a/files/routes/asset_submissions.py b/files/routes/asset_submissions.py index 4ab40cbd06..7cf84a3594 100644 --- a/files/routes/asset_submissions.py +++ b/files/routes/asset_submissions.py @@ -206,10 +206,20 @@ def approve_emoji(v, name): if v.id != author.id: msg = f"@{v.username} (a site admin) has approved an emoji you made: :{emoji.name}:\n\nYou have received 250 coins as a reward!" + + comment = request.values.get("comment") + if comment: + msg += f"\nComment: `{comment}`" + send_repeatable_notification(author.id, msg) if v.id != emoji.submitter_id and author.id != emoji.submitter_id: msg = f"@{v.username} (a site admin) has approved an emoji you submitted: :{emoji.name}:" + + comment = request.values.get("comment") + if comment: + msg += f"\nComment: `{comment}`" + send_repeatable_notification(emoji.submitter_id, msg) emoji.submitter_id = None @@ -245,10 +255,12 @@ def remove_asset(cls, type_name, v, name): name = asset.name if v.id != asset.submitter_id: - reason = request.values.get("reason") msg = f"@{v.username} has rejected a {type_name} you submitted: `'{name}'`" - if reason: - msg += f"\nReason: `{reason}`" + + comment = request.values.get("comment") + if comment: + msg += f"\nComment: `{comment}`" + send_repeatable_notification(asset.submitter_id, msg) ma = ModAction( @@ -383,10 +395,20 @@ def approve_hat(v, name): if v.id != author.id: msg = f"@{v.username} (a site admin) has approved a hat you made: '{hat.name}'" + + comment = request.values.get("comment") + if comment: + msg += f"\nComment: `{comment}`" + send_repeatable_notification(author.id, msg) if v.id != hat.submitter_id and author.id != hat.submitter_id: msg = f"@{v.username} (a site admin) has approved a hat you submitted: '{hat.name}'" + + comment = request.values.get("comment") + if comment: + msg += f"\nComment: `{comment}`" + send_repeatable_notification(hat.submitter_id, msg) hat.submitter_id = None diff --git a/files/templates/submit_emojis.html b/files/templates/submit_emojis.html index b20f2052aa..032363ed75 100644 --- a/files/templates/submit_emojis.html +++ b/files/templates/submit_emojis.html @@ -109,7 +109,7 @@ {% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] or v.id == emoji.submitter_id %}
- + {% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] %} diff --git a/files/templates/submit_hats.html b/files/templates/submit_hats.html index deb0ddbe88..d41dd976e2 100644 --- a/files/templates/submit_hats.html +++ b/files/templates/submit_hats.html @@ -82,7 +82,7 @@
{% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] or v.id == hat.submitter_id %}
- + {% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] %}