ProjectLighthouse/ProjectLighthouse.Servers.Website/Extensions/FormattingExtensions.cs
koko 027173b9c7
Redesign case creation page (#854)
* Redesign case creation page

* Fix user id placeholder text

* Handle empty moderation history

* Mod history dropdown nitpick

* Fix styling issue with dropdown

ui fluid dropdown inherits from ui form

* Potentially fix NRE

* Un-require reason/mod notes

* Display username in moderation history view

* Order mod history by creation time descending

* Nitpick no moderation history string

* Handle AffectedUser null check within controller

* Fix styling issues

* Move moderation history segment above create case button segment

* Link back to affected user

* Move expiration field in with the other entries

* Grammatical consistency nitpick in history dropdown

* Handle empty case reasons in mod history

* This is the last nitpick, I swear!

* I lied. Variable naming consistency :trollface:

* Consolidate setPermanent function into button onclick

* Use HTML details and Fomantic list instead of dropdown

* Fix padding issue with details list

* Format history and user/id nicely

* Styling fixes and nitpicks of list items/links

* Apply suggestions from code review

* Clarification with code review suggestion
2023-08-07 04:45:46 +00:00

35 lines
No EOL
1.2 KiB
C#

using LBPUnion.ProjectLighthouse.Types.Entities.Level;
using LBPUnion.ProjectLighthouse.Types.Moderation.Cases;
using LBPUnion.ProjectLighthouse.Types.Users;
namespace LBPUnion.ProjectLighthouse.Servers.Website.Extensions;
public static class FormattingExtensions
{
public static string GetLevelLockIcon(this SlotEntity slot) => slot.InitiallyLocked ? "ui icon lock" : "";
public static string GetCaseTypeIcon(this CaseType caseType)
{
return caseType switch
{
CaseType.UserBan => "ui icon ban",
CaseType.UserRestriction => "ui icon user alternate slash",
CaseType.UserSilence => "ui icon volume off",
CaseType.UserDisableComments => "ui icon comment slash",
CaseType.LevelHide => "ui icon eye slash",
CaseType.LevelLock => "ui icon lock",
CaseType.LevelDisableComments => "ui icon comment slash",
_ => "ui icon question",
};
}
public static string ToHtmlColor(this PermissionLevel permissionLevel)
{
return permissionLevel switch
{
PermissionLevel.Administrator => "red",
PermissionLevel.Moderator => "rgb(200, 130, 0)",
_ => "",
};
}
}