ProjectLighthouse/ProjectLighthouse.Servers.Website/Pages/Partials/ModerationCasePartial.cshtml
Josh f6a7fe6283
User settings, level settings, language and timezone selection and more. (#471)
* Initial work for user settings page

* Finish user setting and slot setting pages

* Don't show slot upload date on home page and fix team pick redirection

* Fix upload image button alignment on mobile

* Fix image upload on iPhone

* Remove unused css and add selected button color

* Fix login email check and bump ChromeDriver to 105

* Remove duplicated code and allow users to leave fields empty

* Add unpublish button on level settings and move settings button position

* Don't show edit button on mini card

* Self review bug fixes and users can no longer use an in-use email
2022-09-17 14:02:46 -05:00

87 lines
No EOL
2.6 KiB
Text

@using System.Diagnostics
@using LBPUnion.ProjectLighthouse
@using LBPUnion.ProjectLighthouse.Administration
@using LBPUnion.ProjectLighthouse.Levels
@using LBPUnion.ProjectLighthouse.PlayerData.Profiles
@model LBPUnion.ProjectLighthouse.Administration.ModerationCase
@{
Database database = new();
string color = "blue";
string timeZone = (string?)ViewData["TimeZone"] ?? TimeZoneInfo.Local.Id;
TimeZoneInfo timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(timeZone);
if (Model.Expired) color = "yellow";
if (Model.Dismissed) color = "green";
}
<div class="ui @color segment">
<h2>Case #@Model.CaseId: @Model.Type</h2>
@if (Model.Dismissed)
{
Debug.Assert(Model.Dismisser != null);
Debug.Assert(Model.DismissedAt != null);
<h3 class="ui @color header">
This case was dismissed by <a href="/user/@Model.Dismisser.UserId">@Model.Dismisser.Username</a> on @TimeZoneInfo.ConvertTime(Model.DismissedAt.Value, timeZoneInfo).ToString("M/d/yyyy @ h:mm tt").
</h3>
}
else if (Model.Expired && Model.ExpiresAt != null)
{
<h3 class="ui @color header">
This case expired on @TimeZoneInfo.ConvertTime(Model.ExpiresAt.Value, timeZoneInfo).ToString("M/d/yyyy @ h:mm tt").
</h3>
}
<span>
Case created by <a href="/user/@Model.Creator!.UserId">@Model.Creator.Username</a>
on @TimeZoneInfo.ConvertTime(Model.CreatedAt, timeZoneInfo).ToString("M/d/yyyy @ h:mm tt")
</span><br>
@if (Model.Type.AffectsLevel())
{
Slot? slot = await Model.GetSlotAsync(database);
if (slot != null)
{
<p><strong>Affected level:</strong> <a href="/slot/@slot.SlotId">@slot.Name</a></p>
}
}
else if (Model.Type.AffectsUser())
{
User? user = await Model.GetUserAsync(database);
if (user != null)
{
<p><strong>Affected user:</strong> <a href="/user/@user.UserId">@user.Username</a></p>
}
}
<h3>Reason</h3>
@if (!string.IsNullOrWhiteSpace(Model.Reason))
{
<pre>@Model.Reason</pre>
}
else
{
<pre><b>No reason was provided.</b></pre>
}
<h3>Moderator Notes</h3>
@if (!string.IsNullOrWhiteSpace(Model.ModeratorNotes))
{
<pre>@Model.ModeratorNotes</pre>
}
else
{
<pre><b>No notes were provided.</b></pre>
}
@if (!Model.Dismissed)
{
<a class="ui green small button" href="/moderation/case/@Model.CaseId/dismiss">
<i class="checkmark icon"></i>
<span>Dismiss</span>
</a>
}
</div>