1
0
Fork 0

Use button for abuse message icon

This commit is contained in:
Chocobozzz 2024-03-20 09:00:41 +01:00
parent 0c0ea5dbf7
commit b4169fe0a4
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 22 additions and 2 deletions

View File

@ -131,10 +131,15 @@
</td>
<td class="abuse-messages">
<button class="button-unstyle" *ngIf="isLocalAbuse(abuse)" (click)="openAbuseMessagesModal(abuse)">
<button
*ngIf="isLocalAbuse(abuse)" (click)="openAbuseMessagesModal(abuse)"
class="peertube-button grey-button"
[ariaLabel]="getSendMessageButtonLabel(abuse)"
[title]="getSendMessageButtonLabel(abuse)"
>
{{ abuse.countMessages }}
<my-global-icon iconName="message-circle"></my-global-icon>
<my-global-icon aria- iconName="message-circle"></my-global-icon>
</button>
</td>

View File

@ -27,6 +27,7 @@ import { AbuseService } from '../shared-moderation/abuse.service'
import { BlocklistService } from '../shared-moderation/blocklist.service'
import { VideoBlockService } from '../shared-moderation/video-block.service'
import { VideoCommentService } from '../shared-video-comment/video-comment.service'
import { formatICU } from '@app/helpers'
const debugLogger = debug('peertube:moderation:AbuseListTableComponent')
@ -208,6 +209,20 @@ export class AbuseListTableComponent extends RestTable implements OnInit {
return Actor.IS_LOCAL(abuse.reporterAccount.host)
}
getSendMessageButtonLabel (abuse: AdminAbuse) {
if (this.viewType === 'admin') {
return formatICU(
$localize`Send a message to the reporter (currently {count, plural, =1 {{count} message} other {{count} messages}})`,
{ count: abuse.countMessages }
)
}
return formatICU(
$localize`Send a message to the admins/moderators (currently {count, plural, =1 {{count} message} other {{count} messages}})`,
{ count: abuse.countMessages }
)
}
protected reloadDataInternal () {
debugLogger('Loading data.')