mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-14 09:11:28 +00:00
Display a lock icon next to locked levels (#738)
* 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>
This commit is contained in:
parent
8e096052ce
commit
c50e53ad9a
5 changed files with 25 additions and 19 deletions
|
@ -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)",
|
||||
_ => "",
|
||||
};
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue