feedbacks: update messaging about negative feedbacks.

Update wording about negative feedbacks on the new feedback page, and on the Dmail you receive when
you receive a negative feedback.
This commit is contained in:
evazion
2022-11-20 15:27:33 -06:00
parent cc13c5cd57
commit bbe32f5e5d
4 changed files with 29 additions and 23 deletions

View File

@@ -1,10 +0,0 @@
$(() => {
$("#c-user-feedbacks #negative-policy").hide();
$("#c-user-feedbacks #user_feedback_category").on("change.danbooru", (e) => {
if (e.target.value === "negative") {
$("#c-user-feedbacks #negative-policy").show();
} else {
$("#c-user-feedbacks #negative-policy").hide();
}
});
});

View File

@@ -40,16 +40,13 @@ class UserFeedback < ApplicationRecord
self.user = User.find_by_name(name)
end
def disclaimer
if category != "negative"
return nil
def create_dmail
body = %{@#{creator.name} created a "#{category} record":#{Routes.user_feedbacks_path(search: { user_id: user_id })} for your account:\n\n#{self.body}}
if category == "negative"
body += "\n\n---\n\nA negative feedback is a record on your account that you've engaged in negative or rule-breaking behavior. You can appeal this feedback if you think it's unfair by petitioning the mods and admins in the forum. Negative feedback generally doesn't affect your usability of the site, but serious or repeated infractions may lead to a ban."
end
"The purpose of feedback is to help you become a valuable member of the site by highlighting adverse behaviors. The author, #{creator.name}, should have sent you a message in the recent past as a warning. The fact that you're receiving this feedback now implies you've ignored their advice.\n\nYou can protest this feedback by petitioning the mods and admins in the forum. If #{creator.name} fails to provide sufficient evidence, you can have the feedback removed. However, if you fail to defend yourself against the accusations, you will likely earn yourself another negative feedback.\n\nNegative feedback generally doesn't affect your usability of the site. But it does mean other users may trust you less and give you less benefit of the doubt.\n\n"
end
def create_dmail
body = %{#{disclaimer}@#{creator.name} created a "#{category} record":#{Routes.user_feedbacks_path(search: { user_id: user_id })} for your account:\n\n#{self.body}}
Dmail.create_automated(:to_id => user_id, :title => "Your user record has been updated", :body => body)
end

View File

@@ -2,10 +2,15 @@
<div id="a-new" class="fixed-width-container">
<h1>New User Feedback</h1>
<div class="fixed-width-container" id="negative-policy">
<p>Before submitting negative feedback, you must make a good faith effort at communicating with the user (through DMails) to tell them what they are doing wrong. It is unfair to drop a negative record on them without warning. If you have not done this with at least two weeks of notice, the user can dispute the feedback and have it removed. You will need to provide evidence that your feedback is accurate and you gave advanced warning, so you should collect any relevant links and include them in your feedback.</p>
<div class="fixed-width-container">
<p>Before giving a user negative feedback, you must communicate with them privately first to tell them what
they're doing wrong and how to improve. A negative feedback should only be given after they've been warned first,
unless the user is deliberately breaking the <%= link_to_wiki "site rules", "help:community rules" %>, such as engaging
in intentional vandalism or ban evasion.</p>
<p>Please consult <%= link_to_wiki "the guide", "help:user_records" %> for advice on how to write constructive feedback.</p>
<p>A neutral feedback can be given for less serious offenses, or as an initial warning before giving a negative.</p>
<p>Please consult <%= link_to_wiki "help:user records" %> for more information on giving user feedbacks.</p>
</div>
<div id="preview">

View File

@@ -79,9 +79,23 @@ class UserFeedbacksControllerTest < ActionDispatch::IntegrationTest
end
context "create action" do
should "allow gold users to create new feedbacks" do
should "allow gold users to create positive feedbacks" do
assert_difference("UserFeedback.count", 1) do
post_auth user_feedbacks_path, @critic, params: {:user_feedback => {:category => "positive", :user_name => @user.name, :body => "xxx"}}
post_auth user_feedbacks_path, @critic, params: { user_feedback: { category: "positive", user_name: @user.name, body: "xxx" }}
assert_response :redirect
end
end
should "allow gold users to create neutral feedbacks" do
assert_difference("UserFeedback.count", 1) do
post_auth user_feedbacks_path, @critic, params: { user_feedback: { category: "positive", user_name: @user.name, body: "xxx" }}
assert_response :redirect
end
end
should "allow gold users to create negative feedbacks" do
assert_difference("UserFeedback.count", 1) do
post_auth user_feedbacks_path, @critic, params: { user_feedback: { category: "negative", user_name: @user.name, body: "xxx" }}
assert_response :redirect
end
end