diff --git a/drama/routes/flagging.py b/drama/routes/flagging.py
index 5162dd03d..47c723456 100644
--- a/drama/routes/flagging.py
+++ b/drama/routes/flagging.py
@@ -18,7 +18,6 @@ def api_flag_post(pid, v):
if existing:
return "", 409
reason = request.form.get("reason", "")[:100].strip()
- print(reason)
flag = Flag(post_id=post.id,
user_id=v.id,
reason=reason,
diff --git a/drama/templates/comments.html b/drama/templates/comments.html
index bfc94084d..e2a135d99 100644
--- a/drama/templates/comments.html
+++ b/drama/templates/comments.html
@@ -114,7 +114,7 @@
{% if c.banaward %}
{% endif %}
- {% if c.active_flags %}
{{c.active_flags}} Flags {% endif %}
+ {% if c.active_flags %}
{{c.active_flags}} Reports {% endif %}
{% if c.over_18 %} {% endif %}
{% if c.is_nsfl %} {% endif %}
{% if v and v.admin_level==6 and c.author.shadowbanned %}
{% endif %}
@@ -280,7 +280,7 @@
{% if not (v and v.id==c.author_id) %}
{% if v %}
-
Flag
+
Report
{% else %}
Flag
{% endif %}
@@ -474,7 +474,7 @@
Context
{% if not (v and v.id==c.author_id) %}
-
Flag
+
Report
{% endif %}
{% if v and c.parent_submission and c.author_id==v.id %}
diff --git a/drama/templates/default.html b/drama/templates/default.html
index 78cfba175..29342b45b 100644
--- a/drama/templates/default.html
+++ b/drama/templates/default.html
@@ -219,19 +219,26 @@
document.getElementById("comment-author").textContent = author;
- //offtopic.disabled=true;
document.getElementById("reportCommentButton").onclick = function() {
this.innerHTML='
Reporting comment';
this.disabled = true;
- post('/api/flag/comment/' + id,
- callback = function() {
+ var xhr = new XMLHttpRequest();
+ xhr.open("POST", '/api/flag/comment/'+id, true);
+ var form = new FormData()
+ form.append("formkey", formkey());
+ form.append("reason", document.getElementById("reason").value);
- document.getElementById("reportCommentFormBefore").classList.add('d-none');
- document.getElementById("reportCommentFormAfter").classList.remove('d-none');
- }
- )
+ xhr.withCredentials=true;
+
+ xhr.onload=function() {
+ document.getElementById("reportCommentFormBefore").classList.add('d-none');
+ document.getElementById("reportCommentFormAfter").classList.remove('d-none');
+ };
+
+ xhr.onerror=function(){alert(errortext)};
+ xhr.send(form);
}
};
diff --git a/drama/templates/flag_comment_modal.html b/drama/templates/flag_comment_modal.html
index fb54db159..155e98384 100644
--- a/drama/templates/flag_comment_modal.html
+++ b/drama/templates/flag_comment_modal.html
@@ -10,23 +10,16 @@
diff --git a/drama/templates/flag_post_modal.html b/drama/templates/flag_post_modal.html
index 928cdaf7d..ba916b3a5 100644
--- a/drama/templates/flag_post_modal.html
+++ b/drama/templates/flag_post_modal.html
@@ -13,7 +13,7 @@