From 9043c774f78b49ce71e96873f11a94a064e82d32 Mon Sep 17 00:00:00 2001 From: Peter <42907716+MrShack@users.noreply.github.com> Date: Sun, 20 Apr 2025 17:00:31 +0200 Subject: [PATCH] Refactor ban details layout and enhanced formatting. Updated the HTML structure and styling for a clearer, responsive layout and better user experience. --- frontend/src/app/about/about.component.ts | 4 +- .../app/bans/details/details.component.html | 136 +++++++++++------- .../app/bans/details/details.component.scss | 60 ++++++++ .../src/app/bans/details/details.component.ts | 5 +- 4 files changed, 151 insertions(+), 54 deletions(-) diff --git a/frontend/src/app/about/about.component.ts b/frontend/src/app/about/about.component.ts index f995dfc..c453c0d 100644 --- a/frontend/src/app/about/about.component.ts +++ b/frontend/src/app/about/about.component.ts @@ -2,13 +2,15 @@ import {Component} from '@angular/core'; import {ScrollService} from '../scroll/scroll.service'; import {CommonModule} from '@angular/common'; import {HeaderComponent} from '../header/header.component'; +import {RemoveTrailingPeriodPipe} from "../util/RemoveTrailingPeriodPipe"; @Component({ selector: 'app-about', standalone: true, imports: [ CommonModule, - HeaderComponent + HeaderComponent, + RemoveTrailingPeriodPipe ], templateUrl: './about.component.html', styleUrl: './about.component.scss' diff --git a/frontend/src/app/bans/details/details.component.html b/frontend/src/app/bans/details/details.component.html index 0111720..fb362fc 100644 --- a/frontend/src/app/bans/details/details.component.html +++ b/frontend/src/app/bans/details/details.component.html @@ -6,57 +6,91 @@ - -

Loading...

-
+
+
+
+
+ +

Loading...

+
- - -
-

type: {{ this.historyFormat.getType(punishment) }}

-

is active: {{ this.historyFormat.isActive(punishment) }}

-
- - - - - - - - - - - - - - - - - - - - - - - - - + < Back + + +
+ +
+ {{ this.historyFormat.getType(punishment) }} +
+
+ {{ this.historyFormat.isActive(punishment) }} +
-
- -
Player -
- {{punishment.username}}'s Minecraft skin - {{ punishment.username }} -
-
Moderator -
- {{punishment.punishedBy}}'s Minecraft skin - {{ punishment.punishedBy }} -
-
Reason{{ punishment.reason | removeTrailingPeriod }}
Date{{ this.historyFormat.getPunishmentTime(punishment) }}
Expires{{ this.historyFormat.getExpiredTime(punishment) }}
Un{{ this.historyFormat.getType(punishment).toLocaleLowerCase() }} reason{{ punishment.removedReason == null ? 'No reason specified' : punishment.removedReason }}
-
+
+
+
+
+ +
+

Player

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

{{ punishment.username }}

+
+
+
+
+
+
+ +
+

Moderator

+ {{punishment.punishedBy}}'s Minecraft skin +

{{ punishment.punishedBy }}

+
+
+
+
+
+
+ +
+

Reason

+

{{ punishment.reason | removeTrailingPeriod }}

+
+
+
+
+
+
+ +
+

Date

+

{{ this.historyFormat.getPunishmentTime(punishment) }}

+
+
+
+
+
+
+
+ + +
+ + Expires + {{ this.historyFormat.getExpiredTime(punishment) }} + + Un{{ this.historyFormat.getType(punishment).toLocaleLowerCase() }} reason + {{ punishment.removedReason == null ? 'No reason specified' : punishment.removedReason }} + + +
diff --git a/frontend/src/app/bans/details/details.component.scss b/frontend/src/app/bans/details/details.component.scss index e69de29..cdc8c95 100644 --- a/frontend/src/app/bans/details/details.component.scss +++ b/frontend/src/app/bans/details/details.component.scss @@ -0,0 +1,60 @@ +.detailsBackButton { + font-family: open-sans, sans-serif; +} + +.columnSection { + padding-top: 30px; +} + +h2 { + text-align: center; +} + +h3 { + text-align: center; +} + +.avatar { + padding: 10px 0; +} + +.detailsUsername { + font-size: 1.2em; + font-family: 'opensans-bold', sans-serif; +} + +.detailsInfo { + padding-top: 50px; +} + +.detailsInfo p { + text-align: center; +} + +.tag { + display: inline-block; + padding: 5px 10px; + line-height: 1; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + border-radius: 0.25rem; + font-family: 'opensans-bold', sans-serif; +} + +.tagInfo { + margin: 0 20px; + font-size: 1.1em; +} + +.tagActive { + color: #FFFFFF; + background-color: #EE5555 /*Should be #F79720 if Inactive*/ +; +} + +.tagPermanent { + color: #FFFFFF; + background-color: #EE5555 /*Should be #777777 if Expired*/ +; +} diff --git a/frontend/src/app/bans/details/details.component.ts b/frontend/src/app/bans/details/details.component.ts index d67e35a..f9f5139 100644 --- a/frontend/src/app/bans/details/details.component.ts +++ b/frontend/src/app/bans/details/details.component.ts @@ -3,7 +3,7 @@ import {HistoryService, PunishmentHistory} from '../../../api'; import {NgIf, NgOptimizedImage} from '@angular/common'; import {RemoveTrailingPeriodPipe} from '../../util/RemoveTrailingPeriodPipe'; import {HistoryFormatService} from '../history-format.service'; -import {ActivatedRoute} from '@angular/router'; +import {ActivatedRoute, RouterLink} from '@angular/router'; import {catchError, map} from 'rxjs'; import {HeaderComponent} from '../../header/header.component'; @@ -13,7 +13,8 @@ import {HeaderComponent} from '../../header/header.component'; NgIf, NgOptimizedImage, RemoveTrailingPeriodPipe, - HeaderComponent + HeaderComponent, + RouterLink ], templateUrl: './details.component.html', styleUrl: './details.component.scss'