Fix #4972: Display report counters in user profiles
* Add ability to search modreports by reported user. * Display "received:N submitted:N" modreport counters in profiles.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
<h1>Moderation reports</h1>
|
||||
|
||||
<%= search_form_for(moderation_reports_path) do |f| %>
|
||||
<%= f.input :recipient_name, label: "Reported user", input_html: { value: params[:search][:recipient_name], "data-autocomplete": "user" } %>
|
||||
<%= f.input :creator_name, label: "Reporter", input_html: { value: params[:search][:creator_name], "data-autocomplete": "user" } %>
|
||||
<%= f.input :reason_matches, label: "Reason", input_html: { value: params[:search][:reason_matches] } %>
|
||||
<%= f.input :model_id, label: "ID", input_html: { value: params[:search][:model_id] } %>
|
||||
@@ -33,6 +34,7 @@
|
||||
|
||||
<% t.column "Reported user" do |report| %>
|
||||
<%= link_to_user report.reported_user %>
|
||||
<%= link_to "»", moderation_reports_path(search: { recipient_name: report.reported_user.name }) %>
|
||||
<% end %>
|
||||
|
||||
<% t.column "Reporter" do |report| %>
|
||||
|
||||
@@ -240,6 +240,16 @@
|
||||
<td><%= presenter.feedbacks(self) %></td>
|
||||
</tr>
|
||||
|
||||
<% if policy(ModerationReport).can_see_moderation_reports? %>
|
||||
<tr>
|
||||
<th>Mod Reports</th>
|
||||
<td>
|
||||
<%= link_to "received:#{ModerationReport.received_by(user).count}", moderation_reports_path(search: { recipient_name: user.name }) %>
|
||||
<%= link_to "submitted:#{ModerationReport.where(creator: user).count}", moderation_reports_path(search: { creator_name: user.name }) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
<% if policy(UserNameChangeRequest.new(user: user)).show? %>
|
||||
<% user.user_name_change_requests.visible(CurrentUser.user).tap do |changes| %>
|
||||
<% if changes.present? %>
|
||||
|
||||
Reference in New Issue
Block a user