mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-30 22:29:01 +00:00
Add mod notes to ban cases, improve case display
This commit is contained in:
parent
cdcc03fdc1
commit
7ba50e26f5
6 changed files with 30 additions and 18 deletions
|
@ -14,12 +14,17 @@
|
|||
<div class="ui left labeled input">
|
||||
<label for="text" class="ui blue label">Reason: </label>
|
||||
<input type="text" name="reason" id="text">
|
||||
</div><br>
|
||||
</div><br><br>
|
||||
|
||||
<div class="ui left labeled input">
|
||||
<label for="modNotes" class="ui blue label">Moderation case notes: </label>
|
||||
<input type="text" name="modNotes" id="modNotes">
|
||||
</div><br><br>
|
||||
|
||||
<div class="ui left labeled input">
|
||||
<label for="caseExpires" class="ui blue label">Expires on: </label>
|
||||
<input type="datetime-local" name="caseExpires" id="caseExpires">
|
||||
</div><br>
|
||||
</div><br><br>
|
||||
|
||||
<br><input type="submit" value="Yes, ban @Model.TargetedUser.Username!" id="submit" class="ui red button"><br>
|
||||
</form>
|
|
@ -26,7 +26,7 @@ public class ModeratorBanUserPage : BaseLayout
|
|||
return this.Page();
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPost([FromRoute] int id, string reason, DateTime caseExpires)
|
||||
public async Task<IActionResult> OnPost([FromRoute] int id, string reason, string modNotes, DateTime caseExpires)
|
||||
{
|
||||
User? user = this.Database.UserFromWebRequest(this.Request);
|
||||
if (user == null || !user.IsModerator) return this.NotFound();
|
||||
|
@ -44,7 +44,7 @@ public class ModeratorBanUserPage : BaseLayout
|
|||
this.Database.WebTokens.RemoveRange(this.Database.WebTokens.Where(t => t.UserId == this.TargetedUser.UserId));
|
||||
|
||||
// generate & add moderation case
|
||||
this.Database.Add(ModerationCase.NewBanCase(user.UserId, this.TargetedUser.UserId, reason, caseExpires));
|
||||
this.Database.Add(ModerationCase.NewBanCase(user.UserId, this.TargetedUser.UserId, reason, modNotes, caseExpires));
|
||||
|
||||
await this.Database.SaveChangesAsync();
|
||||
return this.Redirect($"/user/{this.TargetedUser.UserId}");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue