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:
evazion
2022-01-31 21:58:14 -06:00
parent bb65a95a86
commit 770a6c339a
3 changed files with 22 additions and 0 deletions

View File

@@ -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? %>