From 34ce95388481e372be3820ef91f04b145367697c Mon Sep 17 00:00:00 2001 From: justcool393 Date: Wed, 14 Dec 2022 04:16:43 +0000 Subject: [PATCH] Fix DM and modmail replies 404ing (#65) messages got borked completely by this commit this reverts commit b649a16b4612cda64db3fa8beccb6c2043bf084c. --- Snakes note: DM and modmail replies 404'd because dispatched to the wrong endpoint. The fix to that affected cancel buttons in some contexts, so this PR also fixes those. Cancel button presence and behavior should be same as it was a ~week ago (i.e. correct), and all reply everywhere seem to work right. Co-authored-by: justcool393 Reviewed-on: https://fsdfsd.net/rDrama/rDrama/pulls/65 Co-authored-by: justcool393 Co-committed-by: justcool393 --- files/assets/js/comments_v.js | 2 +- files/templates/comments.html | 6 +++--- files/templates/submission.html | 2 +- files/templates/userpage/wall.html | 2 +- files/templates/util/macros.html | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/files/assets/js/comments_v.js b/files/assets/js/comments_v.js index 9d727019c..89ae367c4 100644 --- a/files/assets/js/comments_v.js +++ b/files/assets/js/comments_v.js @@ -142,7 +142,7 @@ function post_reply(id){ document.getElementById('reply-form-body-'+id).value = '' document.getElementById('message-reply-'+id).innerHTML = '' - toggleReplyBox('reply-to-c_'+id) + toggleReplyBox('reply-message-c_'+id) const fileupload = document.getElementById('file-upload') if (fileupload) { fileupload.value = null; diff --git a/files/templates/comments.html b/files/templates/comments.html index 8945f12ad..feb95402a 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -539,10 +539,10 @@ {% endif %} - + {# TODO: swap to comment_reply_box macro #} -
+
- +
diff --git a/files/templates/submission.html b/files/templates/submission.html index b4467678a..3a7ff04ff 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -328,7 +328,7 @@
{% if not p.deleted_utc %} - {{macros.comment_reply_box(p.fullname, 'comment-reply-' + p.fullname, '', 'mb-3', '', true, '/comments/')}} + {{macros.comment_reply_box(p.fullname, 'comment-reply-' + p.fullname, subwrapper_css_classes='mb-3', enable_cancel_button=false)}} {% endif %} {% if comment_info %} diff --git a/files/templates/userpage/wall.html b/files/templates/userpage/wall.html index bdc97c0b7..1bf1fd68c 100644 --- a/files/templates/userpage/wall.html +++ b/files/templates/userpage/wall.html @@ -1,7 +1,7 @@ {% extends "userpage/userpage.html" %} {% block userpage_content %}
- {{macros.comment_reply_box(u.fullname, 'replying-to-' + u.fullname, '', 'mb-3 mt-4', '', true, '/comments/')}} + {{macros.comment_reply_box(u.fullname, 'replying-to-' + u.fullname, '', 'mb-3 mt-4', '', enable_cancel_button=false)}}
diff --git a/files/templates/util/macros.html b/files/templates/util/macros.html index 2e4c04f87..f475d677d 100644 --- a/files/templates/util/macros.html +++ b/files/templates/util/macros.html @@ -110,7 +110,7 @@ {{p.views}} thread views {% endmacro %} -{% macro comment_reply_box(target_fullname, html_id, wrapper_css_classes="", subwrapper_css_classes="", hide="", allow_file_upload=true, action="/comments/") %} +{% macro comment_reply_box(target_fullname, html_id, wrapper_css_classes="", subwrapper_css_classes="", hide="", allow_file_upload=true, action="/comments/", enable_cancel_button=true) %}
{% if v %}
@@ -136,7 +136,7 @@ {% endif %}
- {% if target_fullname.startswith('c_') %} + {% if enable_cancel_button %} {% endif %}