QOL updates for profile meta

implement filterable meta for issue #158
update translations and use humanizer lib with datetime/timespan for issue #80
This commit is contained in:
RaidMax
2020-08-17 21:21:11 -05:00
parent 1ef2ba5344
commit 778e339a61
78 changed files with 1800 additions and 775 deletions

View File

@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SharedLibraryCore.Dtos.Meta.Responses
{
public class AdministeredPenaltyResponse : ReceivedPenaltyResponse
{
}
}

View File

@ -0,0 +1,19 @@
using SharedLibraryCore.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;
namespace SharedLibraryCore.Dtos.Meta.Responses
{
public class BaseMetaResponse : IClientMeta, IClientMetaResponse
{
public int MetaId { get; set; }
public int ClientId { get; set; }
public MetaType Type { get; set; }
public DateTime When { get; set; }
public bool IsSensitive { get; set; }
public bool ShouldDisplay { get; set; }
public int? Column { get; set; }
public int? Order { get; set; }
}
}

View File

@ -0,0 +1,14 @@
using SharedLibraryCore.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;
namespace SharedLibraryCore.Dtos.Meta.Responses
{
public class InformationResponse : BaseMetaResponse
{
public string Key { get; set; }
public string Value { get; set; }
public string ToolTipText { get; set; }
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SharedLibraryCore.Dtos.Meta.Responses
{
public class MessageResponse : BaseMetaResponse
{
public long ServerId { get; set; }
public string Message { get; set; }
}
}

View File

@ -0,0 +1,22 @@
using System;
using static SharedLibraryCore.Database.Models.EFPenalty;
namespace SharedLibraryCore.Dtos.Meta.Responses
{
public class ReceivedPenaltyResponse : BaseMetaResponse
{
public int PenaltyId { get; set; }
public int OffenderClientId { get; set; }
public string OffenderName { get; set; }
public string PunisherName { get; set; }
public int PunisherClientId { get; set; }
public PenaltyType PenaltyType { get; set; }
public string Offense { get; set; }
public string AutomatedOffense { get; set; }
public DateTime? ExpirationDate { get; set; }
public string ExpiresInText => ExpirationDate.HasValue && ExpirationDate.Value > DateTime.UtcNow ? (ExpirationDate - DateTime.UtcNow).Value.HumanizeForCurrentCulture() : "";
public string LengthText => ExpirationDate.HasValue ? (ExpirationDate.Value.AddMinutes(1) - When).HumanizeForCurrentCulture() : "";
public bool IsLinked { get; set; }
public int LinkedClientId { get; set; }
}
}

View File

@ -0,0 +1,22 @@
using System;
namespace SharedLibraryCore.Dtos.Meta.Responses
{
public class UpdatedAliasResponse : BaseMetaResponse
{
public string Name { get; set; }
public string IPAddress { get; set; } = "--";
public override bool Equals(object obj)
{
if (obj is UpdatedAliasResponse resp)
{
return resp.Name.StripColors() == Name.StripColors() && resp.IPAddress == IPAddress;
}
return false;
}
public override int GetHashCode() => HashCode.Combine(Name.StripColors(), IPAddress);
}
}