mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 15:20:48 -05:00
Merge branch 'release/pre' of github.com:RaidMax/IW4M-Admin into release/pre
This commit is contained in:
@ -162,7 +162,13 @@ namespace WebfrontCore.Controllers
|
||||
});
|
||||
}
|
||||
|
||||
clientDto.ActivePenalty = activePenalties.OrderByDescending(_penalty => _penalty.Type).FirstOrDefault();
|
||||
// Reducing the enum value for Temp/Mute so bans appear in client banner first
|
||||
clientDto.ActivePenalty = activePenalties.MaxBy(penalty => penalty.Type switch
|
||||
{
|
||||
EFPenalty.PenaltyType.TempMute => 0,
|
||||
EFPenalty.PenaltyType.Mute => 1,
|
||||
_ => (int)penalty.Type
|
||||
});
|
||||
clientDto.Meta.AddRange(Authorized ? meta : meta.Where(m => !m.IsSensitive));
|
||||
|
||||
var strippedName = clientDto.Name.StripColors();
|
||||
|
@ -21,6 +21,8 @@
|
||||
EFPenalty.PenaltyType.Ban => "alert-danger",
|
||||
EFPenalty.PenaltyType.Flag => "alert-secondary",
|
||||
EFPenalty.PenaltyType.TempBan => "alert-secondary",
|
||||
EFPenalty.PenaltyType.TempMute => "alert-secondary",
|
||||
EFPenalty.PenaltyType.Mute => "alert-secondary",
|
||||
_ => "alert"
|
||||
};
|
||||
}
|
||||
@ -367,7 +369,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
if ((Model.LevelInt < (int)ViewBag.User.Level && !Model.HasActivePenalty || isTempBanned) && ViewBag.Authorized)
|
||||
if ((Model.LevelInt < (int)ViewBag.User.Level && !isPermBanned || isTempBanned) && ViewBag.Authorized)
|
||||
{
|
||||
menuItems.Items.Add(new SideContextMenuItem
|
||||
{
|
||||
@ -379,7 +381,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
if ((Model.LevelInt < (int)ViewBag.User.Level && Model.HasActivePenalty || isTempBanned) && ViewBag.Authorized)
|
||||
if ((Model.LevelInt < (int)ViewBag.User.Level && isPermBanned || isTempBanned) && ViewBag.Authorized)
|
||||
{
|
||||
menuItems.Items.Add(new SideContextMenuItem
|
||||
{
|
||||
|
Reference in New Issue
Block a user