mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-23 05:31:29 +00:00
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:
parent
af6fdb457b
commit
77e46a0721
8 changed files with 68 additions and 94 deletions
|
@ -12,12 +12,7 @@
|
||||||
|
|
||||||
@if (!string.IsNullOrWhiteSpace(Model.Error))
|
@if (!string.IsNullOrWhiteSpace(Model.Error))
|
||||||
{
|
{
|
||||||
<div class="ui negative message">
|
@await Html.PartialAsync("Partials/ErrorModalPartial", (Model.Translate(GeneralStrings.Error), Model.Error), ViewData)
|
||||||
<div class="header">
|
|
||||||
@Model.Translate(GeneralStrings.Error)
|
|
||||||
</div>
|
|
||||||
<p style="white-space: pre-line">@Model.Error</p>
|
|
||||||
</div>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<form class="ui form" onsubmit="return onSubmit(this)" method="post">
|
<form class="ui form" onsubmit="return onSubmit(this)" method="post">
|
||||||
|
|
|
@ -31,12 +31,7 @@
|
||||||
<form class="ui form" onsubmit="return onSubmit(this)" method="post">
|
<form class="ui form" onsubmit="return onSubmit(this)" method="post">
|
||||||
@if (!string.IsNullOrWhiteSpace(Model.Error))
|
@if (!string.IsNullOrWhiteSpace(Model.Error))
|
||||||
{
|
{
|
||||||
<div class="ui negative message">
|
@await Html.PartialAsync("Partials/ErrorModalPartial", (Model.Translate(GeneralStrings.Error), Model.Error), ViewData)
|
||||||
<div class="header">
|
|
||||||
@Model.Translate(GeneralStrings.Error)
|
|
||||||
</div>
|
|
||||||
<p style="white-space: pre-line">@Model.Error</p>
|
|
||||||
</div>
|
|
||||||
}
|
}
|
||||||
@Html.AntiForgeryToken()
|
@Html.AntiForgeryToken()
|
||||||
<input type="hidden" id="redirect" name="redirect">
|
<input type="hidden" id="redirect" name="redirect">
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
@page "/passwordReset"
|
@page "/passwordReset"
|
||||||
@using LBPUnion.ProjectLighthouse.Configuration
|
|
||||||
@using LBPUnion.ProjectLighthouse.Localization.StringLists
|
@using LBPUnion.ProjectLighthouse.Localization.StringLists
|
||||||
@model LBPUnion.ProjectLighthouse.Servers.Website.Pages.Login.PasswordResetPage
|
@model LBPUnion.ProjectLighthouse.Servers.Website.Pages.Login.PasswordResetPage
|
||||||
|
|
||||||
|
@ -27,12 +26,7 @@
|
||||||
|
|
||||||
@if (!string.IsNullOrWhiteSpace(Model.Error))
|
@if (!string.IsNullOrWhiteSpace(Model.Error))
|
||||||
{
|
{
|
||||||
<div class="ui negative message">
|
@await Html.PartialAsync("Partials/ErrorModalPartial", (Model.Translate(GeneralStrings.Error), Model.Error), ViewData)
|
||||||
<div class="header">
|
|
||||||
@Model.Translate(GeneralStrings.Error)
|
|
||||||
</div>
|
|
||||||
<p>@Model.Error</p>
|
|
||||||
</div>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<div class="ui middle aligned center aligned grid">
|
<div class="ui middle aligned center aligned grid">
|
||||||
|
|
|
@ -9,12 +9,7 @@
|
||||||
|
|
||||||
@if (!string.IsNullOrWhiteSpace(Model.Error))
|
@if (!string.IsNullOrWhiteSpace(Model.Error))
|
||||||
{
|
{
|
||||||
<div class="ui negative message">
|
@await Html.PartialAsync("Partials/ErrorModalPartial", (Model.Translate(GeneralStrings.Error), Model.Error), ViewData)
|
||||||
<div class="header">
|
|
||||||
@Model.Translate(GeneralStrings.Error)
|
|
||||||
</div>
|
|
||||||
<p style="white-space: pre-line">@Model.Error</p>
|
|
||||||
</div>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@if (!string.IsNullOrWhiteSpace(Model.Status))
|
@if (!string.IsNullOrWhiteSpace(Model.Status))
|
||||||
|
|
|
@ -25,17 +25,14 @@
|
||||||
|
|
||||||
@if (!string.IsNullOrWhiteSpace(Model.Error))
|
@if (!string.IsNullOrWhiteSpace(Model.Error))
|
||||||
{
|
{
|
||||||
<div class="ui negative message">
|
@await Html.PartialAsync("Partials/ErrorModalPartial", (Model.Translate(GeneralStrings.Error), Model.Error), ViewData)
|
||||||
<div class="header">
|
|
||||||
@Model.Translate(GeneralStrings.Error)
|
|
||||||
</div>
|
|
||||||
<p>@Model.Error</p>
|
|
||||||
</div>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@if (Model.Username == null)
|
@if (Model.Username == null)
|
||||||
{
|
{
|
||||||
<p><b>@Model.Translate(RegisterStrings.UsernameNotice)</b></p>
|
<p>
|
||||||
|
<b>@Model.Translate(RegisterStrings.UsernameNotice)</b>
|
||||||
|
</p>
|
||||||
}
|
}
|
||||||
|
|
||||||
<form class="ui form" onsubmit="return onSubmit(this)" method="post">
|
<form class="ui form" onsubmit="return onSubmit(this)" method="post">
|
||||||
|
|
|
@ -12,12 +12,7 @@
|
||||||
|
|
||||||
@if (!string.IsNullOrWhiteSpace(Model.Error))
|
@if (!string.IsNullOrWhiteSpace(Model.Error))
|
||||||
{
|
{
|
||||||
<div class="ui negative message">
|
@await Html.PartialAsync("Partials/ErrorModalPartial", (Model.Translate(GeneralStrings.Error), Model.Error), ViewData)
|
||||||
<div class="header">
|
|
||||||
@Model.Translate(GeneralStrings.Error)
|
|
||||||
</div>
|
|
||||||
<p style="white-space: pre-line">@Model.Error</p>
|
|
||||||
</div>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<input type="hidden" name="type" value="@((int)Model.Type)"/>
|
<input type="hidden" name="type" value="@((int)Model.Type)"/>
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
@model (string Title, string Message)
|
||||||
|
|
||||||
|
<div class="ui negative message">
|
||||||
|
<div class="header">
|
||||||
|
@Model.Title
|
||||||
|
</div>
|
||||||
|
<p style="white-space: pre-line">@Model.Message</p>
|
||||||
|
</div>
|
|
@ -11,12 +11,7 @@
|
||||||
<div class="digits" id="2fa">
|
<div class="digits" id="2fa">
|
||||||
@if (!string.IsNullOrWhiteSpace(error))
|
@if (!string.IsNullOrWhiteSpace(error))
|
||||||
{
|
{
|
||||||
<div class="ui negative message">
|
@await Html.PartialAsync("Partials/ErrorModalPartial", ((string)Model.Translate(GeneralStrings.Error), error), ViewData)
|
||||||
<div class="header">
|
|
||||||
@Model.Translate(GeneralStrings.Error)
|
|
||||||
</div>
|
|
||||||
<p style="white-space: pre-line">@Model.Error</p>
|
|
||||||
</div>
|
|
||||||
}
|
}
|
||||||
<input type="text" pattern="\d*" maxlength="1" id="digit1"/>
|
<input type="text" pattern="\d*" maxlength="1" id="digit1"/>
|
||||||
<input type="text" pattern="\d*" maxlength="1" id="digit2"/>
|
<input type="text" pattern="\d*" maxlength="1" id="digit2"/>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue