From b922487d76513c83ccf82b09998418a68484c042 Mon Sep 17 00:00:00 2001 From: Teriuihi Date: Sun, 20 Apr 2025 17:29:51 +0200 Subject: [PATCH] Fix punishment tag colors and avatar image size --- .../app/bans/details/details.component.html | 20 +++++++++++++++---- .../app/bans/details/details.component.scss | 16 +++++++++++---- .../src/app/bans/details/details.component.ts | 5 +++-- .../src/app/bans/history-format.service.ts | 14 +++++++++++-- 4 files changed, 43 insertions(+), 12 deletions(-) diff --git a/frontend/src/app/bans/details/details.component.html b/frontend/src/app/bans/details/details.component.html index 517d5d9..035db8a 100644 --- a/frontend/src/app/bans/details/details.component.html +++ b/frontend/src/app/bans/details/details.component.html @@ -20,11 +20,23 @@
- {{ this.historyFormat.getType(punishment) }} + + {{ this.historyFormat.getType(punishment) }} +
{{ this.historyFormat.isActive(punishment) ? 'Active' : 'Inactive' }} + class="tag tagInfo" + [ngClass]="{ + 'tagActive': this.historyFormat.isActive(punishment), + 'tagInactive': !this.historyFormat.isActive(punishment) + }"> + {{ this.historyFormat.isActive(punishment) ? 'Active' : 'Inactive' }} +
@@ -34,7 +46,7 @@

Player

- {{punishment.username}}'s Minecraft skin

Moderator

- {{punishment.punishedBy}}'s Minecraft skin Date.now(); } + public isPermanent(entry: PunishmentHistory): boolean { + return entry.expiryTime <= 0; + } + public getType(entry: PunishmentHistory): string { return entry.type.charAt(0).toUpperCase() + entry.type.slice(1); } @@ -48,11 +58,11 @@ export class HistoryFormatService { }) + " " + suffix; } - public getAvatarUrl(entry: string): string { + public getAvatarUrl(entry: string, size: string = '25'): string { let uuid = entry.replace('-', ''); if (uuid === 'C') { uuid = "f78a4d8dd51b4b3998a3230f2de0c670" } - return `https://crafatar.com/avatars/${uuid}?size=25&overlay`; + return `https://crafatar.com/avatars/${uuid}?size=${size}&overlay`; } }