Refactor error modal into its own partial (#785)

* Refactor error modal into its own partial

* Fix unresolved error string in TwoFactorPartial

* Use tuple model instead of ViewData for error title and message

* Apply suggestions from code review
This commit is contained in:
koko 2023-06-08 00:01:59 -04:00 committed by GitHub
commit 77e46a0721
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 68 additions and 94 deletions

View file

@ -9,17 +9,12 @@
<form method="post">
@Html.AntiForgeryToken()
@if (!string.IsNullOrWhiteSpace(Model.Error))
{
<div class="ui negative message">
<div class="header">
@Model.Translate(GeneralStrings.Error)
</div>
<p style="white-space: pre-line">@Model.Error</p>
</div>
@await Html.PartialAsync("Partials/ErrorModalPartial", (Model.Translate(GeneralStrings.Error), Model.Error), ViewData)
}
<input type="hidden" name="type" value="@((int)Model.Type)"/>
<input type="hidden" name="affectedId" value="@Model.AffectedId"/>
@ -27,7 +22,7 @@
<label for="reason" class="ui blue label">Reason: </label>
<input type="text" name="reason" id="reason"/>
</div><br/><br/>
<div class="ui left labeled input">
<label for="mod-notes" class="ui blue label">Mod Notes: </label>
<input type="text" name="modNotes" id="mod-notes"/>