FIX: Don't refer to pending review items as flags

They could be queued posts or users, and the notice should reflect that
properly.
This commit is contained in:
Robin Ward 2019-04-01 14:46:56 -04:00
parent 6470c85fda
commit 76669bb5a6
5 changed files with 10 additions and 48 deletions

View File

@ -2,7 +2,7 @@ require_dependency 'flag_query'
module Jobs
class PendingFlagsReminder < Jobs::Scheduled
class PendingReviewablesReminder < Jobs::Scheduled
every 1.hour
attr_reader :sent_reminder
@ -27,8 +27,8 @@ module Jobs
target_group_names: Group[:moderators].name,
archetype: Archetype.private_message,
subtype: TopicSubtype.system_message,
title: I18n.t('flags_reminder.subject_template', count: reviewable_ids.size),
raw: mentions + I18n.t('flags_reminder.flags_were_submitted', count: SiteSetting.notify_about_flags_after, base_path: Discourse.base_path)
title: I18n.t('reviewables_reminder.subject_template', count: reviewable_ids.size),
raw: mentions + I18n.t('reviewables_reminder.submitted', count: SiteSetting.notify_about_flags_after, base_path: Discourse.base_path)
).present?
self.class.last_notified_id = reviewable_ids[0]

View File

@ -1,29 +0,0 @@
<p>
<%= t 'flags_reminder.flags_were_submitted', count: @hours %>
<a href="<%= Discourse.base_url + '/admin/flags' %>"><%= t 'flags_reminder.please_review' %></a>
</p>
<table style="border-collapse: collapse; border-spacing: 0;">
<% @posts.each do |post| %>
<tr style="border-top: 1px solid #e9e9e9;">
<td style="width: 25px; padding: 8px 0 0 0; text-align: center; vertical-align: top;">
<a href='<%= Discourse.base_url + "/admin/users/#{post[:user].username.downcase}" %>'>
<img width="25" height="25" src="<%= Discourse.base_url + post[:user].avatar_template.gsub("{size}", "45") %>" title="<%= post[:user].username %>">
</a>
</td>
<td style="padding: 8px; word-wrap: break-word; vertical-align: top;">
<h3 style="margin: 0 !important;"><%= link_to post[:title], post[:url] %></h3>
<p style="margin: 0 2px;"><%= raw post[:excerpt] %></p>
</td>
</tr>
<tr style="border-bottom: 1px solid #e9e9e9;">
<td colspan=2 style="padding: 0px 0px 5px 33px; vertical-align: top;"><%= raw post[:html_reason_counts] %></td>
</tr>
<% end %>
</table>
<div class='footer'>
<p>
<%= t 'flags_reminder.how_to_disable' %>
</p>
</div>

View File

@ -1,9 +0,0 @@
<%=t 'flags_reminder.flags_were_submitted', count: @hours %> <%=t 'flags_reminder.please_review' %>
<%= Discourse.base_url + '/admin/flags' %>
<% @posts.each do |post| %>
- <%= post[:title] %>: <%=t 'flags_reminder.post_number' %> <%= post[:post_number] %> - <%= post[:reason_counts] %>
<% end %>
<%=t 'flags_reminder.how_to_disable' %>

View File

@ -2221,13 +2221,13 @@ en:
same_ip_address: "Same IP address (%{ip_address}) as other users"
inactive_user: "Inactive user"
flags_reminder:
flags_were_submitted:
one: "Flags were submitted over 1 hour ago. [Please review them](%{base_path}/admin/flags)."
other: "Flags were submitted over %{count} hours ago. [Please review them](%{base_path}/admin/flags)."
reviewables_reminder:
submitted:
one: "Items were submitted over 1 hour ago. [Please review them](%{base_path}/review)."
other: "Items were submitted over %{count} hours ago. [Please review them](%{base_path}/review)."
subject_template:
one: "1 flag waiting to be handled"
other: "%{count} flags waiting to be handled"
one: "1 item needs to be reviewed"
other: "%{count} items need to be reviewed"
unsubscribe_mailer:
title: "Unsubscribe Mailer"

View File

@ -1,6 +1,6 @@
require 'rails_helper'
describe Jobs::PendingFlagsReminder do
describe Jobs::PendingReviewablesReminder do
let(:job) { described_class.new }
def create_flag(created_at)