mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-14 09:11:28 +00:00
* 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
35 lines
No EOL
1.2 KiB
C#
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)",
|
|
_ => "",
|
|
};
|
|
}
|
|
} |