Fix remote reports with comments revealing remote reporter (#17652)

* Display username rather than display name in report comment

For consistency with report notes and appeals

* Fix remote reports with comments revealing remote reporter

* Display instance name in placeholder

* Make instance name in report comment a link to the federation admin page

* Normalize i18n file
This commit is contained in:
Claire 2022-02-26 21:14:12 +01:00 committed by GitHub
parent 0dc57ab6ed
commit 57814a98a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 9 deletions

View File

@ -1367,18 +1367,22 @@ a.sparkline {
line-height: 20px; line-height: 20px;
margin-bottom: 4px; margin-bottom: 4px;
.username a { .username {
color: $primary-text-color; color: $primary-text-color;
font-weight: 500; font-weight: 500;
text-decoration: none;
margin-right: 5px; margin-right: 5px;
a {
color: inherit;
text-decoration: none;
&:hover, &:hover,
&:focus, &:focus,
&:active { &:active {
text-decoration: underline; text-decoration: underline;
} }
} }
}
time { time {
margin-left: 5px; margin-left: 5px;

View File

@ -122,15 +122,28 @@
= react_admin_component :report_reason_selector, id: @report.id, category: @report.category, rule_ids: @report.rule_ids&.map(&:to_s), disabled: @report.action_taken? = react_admin_component :report_reason_selector, id: @report.id, category: @report.category, rule_ids: @report.rule_ids&.map(&:to_s), disabled: @report.action_taken?
- if @report.comment.present? - if @report.comment.present?
- if @report.account.instance_actor?
%p= t('admin.reports.comment_description_html', name: content_tag(:strong, site_hostname, class: 'username'))
- elsif @report.account.local?
%p= t('admin.reports.comment_description_html', name: content_tag(:strong, @report.account.username, class: 'username')) %p= t('admin.reports.comment_description_html', name: content_tag(:strong, @report.account.username, class: 'username'))
- else
%p= t('admin.reports.comment_description_html', name: t('admin.reports.remote_user_placeholder', instance: @report.account.domain))
.report-notes .report-notes
.report-notes__item .report-notes__item
- if @report.account.local? && !@report.account.instance_actor?
= image_tag @report.account.avatar.url, class: 'report-notes__item__avatar' = image_tag @report.account.avatar.url, class: 'report-notes__item__avatar'
- else
= image_tag(full_asset_url('avatars/original/missing.png', skip_pipeline: true), class: 'report-notes__item__avatar')
.report-notes__item__header .report-notes__item__header
%span.username %span.username
= link_to display_name(@report.account), admin_account_path(@report.account_id) - if @report.account.instance_actor?
= site_hostname
- elsif @report.account.local?
= link_to @report.account.username, admin_account_path(@report.account_id)
- else
= link_to @report.account.domain, admin_instance_path(@report.account.domain)
%time{ datetime: @report.created_at.iso8601, title: l(@report.created_at) } %time{ datetime: @report.created_at.iso8601, title: l(@report.created_at) }
- if @report.created_at.today? - if @report.created_at.today?
= t('admin.report_notes.today_at', time: l(@report.created_at, format: :time)) = t('admin.report_notes.today_at', time: l(@report.created_at, format: :time))

View File

@ -617,6 +617,7 @@ en:
title: Notes title: Notes
notes_description_html: View and leave notes to other moderators and your future self notes_description_html: View and leave notes to other moderators and your future self
quick_actions_description_html: 'Take a quick action or scroll down to see reported content:' quick_actions_description_html: 'Take a quick action or scroll down to see reported content:'
remote_user_placeholder: the remote user from %{instance}
reopen: Reopen report reopen: Reopen report
report: 'Report #%{id}' report: 'Report #%{id}'
reported_account: Reported account reported_account: Reported account