users: reword ban notice messages.

* Show the ban length instead of the ban expiration date in ban notices.
* Fix the ban notice to not say "Your account has been temporarily
  banned" when it's a permanent ban.
This commit is contained in:
evazion
2021-05-15 03:39:32 -05:00
parent 8ca757244a
commit 90a4ac3bf5
8 changed files with 24 additions and 32 deletions

View File

@@ -64,7 +64,7 @@ class Ban < ApplicationRecord
end
def humanized_duration
ApplicationController.helpers.distance_of_time_in_words(created_at, expires_at)
ApplicationController.helpers.humanized_duration(duration)
end
def expired?
@@ -72,11 +72,11 @@ class Ban < ApplicationRecord
end
def create_feedback
user.feedback.create!(creator: banner, category: "negative", body: "Banned for #{humanized_duration}: #{reason}")
user.feedback.create!(creator: banner, category: "negative", body: "Banned #{humanized_duration}: #{reason}")
end
def create_ban_mod_action
ModAction.log(%{Banned <@#{user_name}> for #{humanized_duration}: #{reason}}, :user_ban)
ModAction.log(%{Banned <@#{user_name}> #{humanized_duration}: #{reason}}, :user_ban)
end
def create_unban_mod_action