Skip to content

Commit

Permalink
Remove ban auto-deletion from menu
Browse files Browse the repository at this point in the history
  • Loading branch information
PJB3005 committed Jun 23, 2024
1 parent 61901e5 commit a9d619e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion SS14.Admin/Helpers/BanExemptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public static (ServerBanExemptFlags Value, string DisplayName)[] GetExemptions()
return
[
(ServerBanExemptFlags.Datacenter, "Datacenter"),
(ServerBanExemptFlags.IP, "Only matches IP"),
// (ServerBanExemptFlags.IP, "Only matches IP"),
(ServerBanExemptFlags.BlacklistedRange, "Blacklisted range"),
];
}
Expand Down
4 changes: 2 additions & 2 deletions SS14.Admin/Pages/Bans/BanTemplates/View.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@
<div class="form-group row">
<legend class="col-form-label col-sm-3 float-sm-left pt-0">Settings</legend>
<div class="col-sm-9 mb-3">
<div class="form-check">
@*<div class="form-check">
<input asp-for="Input.AutoDelete" class="form-check-input"/>
<label asp-for="Input.AutoDelete" class="form-check-label"></label>
</div>
</div>*@
<div class="form-check">
<input asp-for="Input.Hidden" class="form-check-input"/>
<label asp-for="Input.Hidden" class="form-check-label"></label>
Expand Down
8 changes: 4 additions & 4 deletions SS14.Admin/Pages/Bans/BanTemplates/View.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public sealed class InputModel
public int LengthMinutes { get; set; }
public string? Reason { get; set; }

[Display(Name = "Delete ban when expired")]
public bool AutoDelete { get; set; }
// [Display(Name = "Delete ban when expired")]
// public bool AutoDelete { get; set; }

[Display(Name = "Hidden from player")] public bool Hidden { get; set; }
public NoteSeverity Severity { get; set; }
Expand All @@ -42,7 +42,7 @@ public async Task<IActionResult> OnGetAsync(int id)
Input.Reason = template.Reason;
Input.Title = template.Title;
Input.LengthMinutes = (int)template.Length.TotalMinutes;
Input.AutoDelete = template.AutoDelete;
// Input.AutoDelete = template.AutoDelete;

Template = template;
return Page();
Expand All @@ -66,7 +66,7 @@ public async Task<IActionResult> OnPostEditAsync(int id)
template.Title = Input.Title;
template.Length = TimeSpan.FromMinutes(Input.LengthMinutes);
template.Reason = Input.Reason ?? "";
template.AutoDelete = Input.AutoDelete;
// template.AutoDelete = Input.AutoDelete;
template.Hidden = Input.Hidden;
template.Severity = Input.Severity;

Expand Down
4 changes: 2 additions & 2 deletions SS14.Admin/Pages/Bans/Create.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@
<div class="form-group row">
<legend class="col-form-label col-sm-3 float-sm-left pt-0">Settings</legend>
<div class="col-sm-9 mb-3">
<div class="form-check">
@*<div class="form-check">
<input asp-for="Input.AutoDelete" class="form-check-input"/>
<label asp-for="Input.AutoDelete" class="form-check-label"></label>
</div>
</div>*@
<div class="form-check">
<input asp-for="Input.Hidden" class="form-check-input"/>
<label asp-for="Input.Hidden" class="form-check-label"></label>
Expand Down
8 changes: 4 additions & 4 deletions SS14.Admin/Pages/Bans/Create.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public sealed class InputModel
public bool UseLatestHwid { get; set; }
public int LengthMinutes { get; set; }
[Required] public string Reason { get; set; } = "";
[Display(Name = "Delete ban when expired")]
public bool AutoDelete { get; set; }
// [Display(Name = "Delete ban when expired")]
// public bool AutoDelete { get; set; }

[Display(Name = "Hidden from player")] public bool Hidden { get; set; }
public NoteSeverity Severity { get; set; }
Expand All @@ -61,7 +61,7 @@ public async Task<IActionResult> OnPostCreateAsync()
var hwid = Input.HWid;

ban.ExemptFlags = ExemptFlags;
ban.AutoDelete = Input.AutoDelete;
// ban.AutoDelete = Input.AutoDelete;
ban.Hidden = Input.Hidden;
ban.Severity = Input.Severity;

Expand Down Expand Up @@ -122,7 +122,7 @@ public async Task<IActionResult> OnPostUseTemplateAsync(int templateId)
Input.Reason = template.Reason;
Input.LengthMinutes = (int)template.Length.TotalMinutes;
Input.Severity = template.Severity;
Input.AutoDelete = template.AutoDelete;
// Input.AutoDelete = template.AutoDelete;
Input.Hidden = template.Hidden;
ExemptFlags = template.ExemptFlags;

Expand Down

0 comments on commit a9d619e

Please sign in to comment.