Show time passed since ban instead of "forever"

reworked event api to include all events (sans unknown)
This commit is contained in:
RaidMax
2018-06-16 21:11:25 -05:00
parent 5be6b75ccf
commit e7c7145da1
19 changed files with 861 additions and 128 deletions

View File

@ -24,7 +24,8 @@ namespace WebfrontCore.ViewComponents
Offense = User.Identity.IsAuthenticated && !string.IsNullOrEmpty(p.AutomatedOffense) ? p.AutomatedOffense : p.Offense,
Type = p.Type.ToString(),
TimePunished = Utilities.GetTimePassed(p.When, false),
TimeRemaining = DateTime.UtcNow > p.Expires ? "" : Utilities.TimeSpanText(p.Expires - DateTime.UtcNow),
// show time passed if ban
TimeRemaining = DateTime.UtcNow > p.Expires ? "" : $"{(p.Expires.Year == DateTime.MaxValue.Year ? Utilities.GetTimePassed(p.When, true) : Utilities.TimeSpanText(p.Expires - DateTime.UtcNow))}",
Sensitive = p.Type == Penalty.PenaltyType.Flag,
AutomatedOffense = p.AutomatedOffense
});