Updated styling and components for punishment history

This commit is contained in:
Peter
2025-04-12 17:05:08 +02:00
parent 1264003a44
commit 6a70428c75
8 changed files with 96 additions and 19 deletions
@@ -1,14 +1,15 @@
import {Component, Input, OnChanges, OnInit} from '@angular/core';
import {BASE_PATH, HistoryService, PunishmentHistoryInner} from '../../../api';
import {map, Observable, shareReplay} from 'rxjs';
import {NgForOf, NgIf} from '@angular/common';
import {NgForOf, NgIf, NgOptimizedImage} from '@angular/common';
import {CookieService} from 'ngx-cookie-service';
@Component({
selector: 'app-history',
imports: [
NgIf,
NgForOf
NgForOf,
NgOptimizedImage
],
templateUrl: './history.component.html',
styleUrl: './history.component.scss',
@@ -70,9 +71,13 @@ export class HistoryComponent implements OnInit, OnChanges {
});
}
public getType(entry: PunishmentHistoryInner) {
return entry.type.charAt(0).toUpperCase() + entry.type.slice(1);
}
public getExpiredTime(entry: PunishmentHistoryInner) {
if (entry.expiryTime === 0) {
return "Permanent " + entry.type.charAt(0).toUpperCase() + entry.type.slice(1);
return "Permanent " + this.getType(entry);
}
const date = new Date(entry.expiryTime);
return date.toLocaleString(navigator.language, {