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) {

- @slotName + @slotName

} else {

- @slotName + @slotName

} } @@ -69,13 +69,13 @@ @if (showLink) {

- @slotName + @slotName

} else {

- @slotName + @slotName

} } diff --git a/ProjectLighthouse.Servers.Website/Pages/Partials/UserCardPartial.cshtml b/ProjectLighthouse.Servers.Website/Pages/Partials/UserCardPartial.cshtml index 6a6561b9..8591d3c2 100644 --- a/ProjectLighthouse.Servers.Website/Pages/Partials/UserCardPartial.cshtml +++ b/ProjectLighthouse.Servers.Website/Pages/Partials/UserCardPartial.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/Types/Users/PermissionLevel.cs b/ProjectLighthouse/Types/Users/PermissionLevel.cs index eca9d49d..b3644803 100644 --- a/ProjectLighthouse/Types/Users/PermissionLevel.cs +++ b/ProjectLighthouse/Types/Users/PermissionLevel.cs @@ -8,17 +8,4 @@ public enum PermissionLevel Default = 0, Moderator = 1, Administrator = 2, -} - -public static class PermissionLevelExtensions -{ - 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