mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-14 17:21:28 +00:00
* Display a lock icon next to locked levels * C# Return Switch shenanigans * No clue where that line break came from * Don't render a semicolon * Move permission level color/lock icon to website extension * Simplify GetLevelLockIcon --------- Co-authored-by: Josh <josh@slendy.pw>
19 lines
No EOL
601 B
C#
19 lines
No EOL
601 B
C#
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)",
|
|
_ => "",
|
|
};
|
|
}
|
|
} |