diff --git a/ProjectLighthouse.Servers.Website/Extensions/FormattingExtensions.cs b/ProjectLighthouse.Servers.Website/Extensions/FormattingExtensions.cs new file mode 100644 index 00000000..c90e5e51 --- /dev/null +++ b/ProjectLighthouse.Servers.Website/Extensions/FormattingExtensions.cs @@ -0,0 +1,19 @@ +using LBPUnion.ProjectLighthouse.Types.Entities.Level; +using LBPUnion.ProjectLighthouse.Types.Users; + +namespace LBPUnion.ProjectLighthouse.Servers.Website.Extensions; + +public static class FormattingExtensions +{ + public static string GetLevelLockIcon(this SlotEntity slot) => slot.InitiallyLocked ? "icon lock" : ""; + + public static string ToHtmlColor(this PermissionLevel permissionLevel) + { + return permissionLevel switch + { + PermissionLevel.Administrator => "red", + PermissionLevel.Moderator => "rgb(200, 130, 0)", + _ => "", + }; + } +} \ No newline at end of file diff --git a/ProjectLighthouse.Servers.Website/Pages/Partials/Links/UserLinkPartial.cshtml b/ProjectLighthouse.Servers.Website/Pages/Partials/Links/UserLinkPartial.cshtml index e60f8088..49903bea 100644 --- a/ProjectLighthouse.Servers.Website/Pages/Partials/Links/UserLinkPartial.cshtml +++ b/ProjectLighthouse.Servers.Website/Pages/Partials/Links/UserLinkPartial.cshtml @@ -1,6 +1,6 @@ @using LBPUnion.ProjectLighthouse.Database @using LBPUnion.ProjectLighthouse.Localization -@using LBPUnion.ProjectLighthouse.Types.Users +@using LBPUnion.ProjectLighthouse.Servers.Website.Extensions @model LBPUnion.ProjectLighthouse.Types.Entities.Profile.UserEntity @{ diff --git a/ProjectLighthouse.Servers.Website/Pages/Partials/SlotCardPartial.cshtml b/ProjectLighthouse.Servers.Website/Pages/Partials/SlotCardPartial.cshtml index 4d07eed3..700edc45 100644 --- a/ProjectLighthouse.Servers.Website/Pages/Partials/SlotCardPartial.cshtml +++ b/ProjectLighthouse.Servers.Website/Pages/Partials/SlotCardPartial.cshtml @@ -54,13 +54,13 @@ @if (showLink) {