diff --git a/ProjectLighthouse.Servers.Website/Pages/Email/SetEmailForm.cshtml b/ProjectLighthouse.Servers.Website/Pages/Email/SetEmailForm.cshtml index 4d962981..67343011 100644 --- a/ProjectLighthouse.Servers.Website/Pages/Email/SetEmailForm.cshtml +++ b/ProjectLighthouse.Servers.Website/Pages/Email/SetEmailForm.cshtml @@ -12,12 +12,7 @@ @if (!string.IsNullOrWhiteSpace(Model.Error)) { -
-
- @Model.Translate(GeneralStrings.Error) -
-

@Model.Error

-
+ @await Html.PartialAsync("Partials/ErrorModalPartial", (Model.Translate(GeneralStrings.Error), Model.Error), ViewData) }
diff --git a/ProjectLighthouse.Servers.Website/Pages/Login/LoginForm.cshtml b/ProjectLighthouse.Servers.Website/Pages/Login/LoginForm.cshtml index 3d15566a..8c883462 100644 --- a/ProjectLighthouse.Servers.Website/Pages/Login/LoginForm.cshtml +++ b/ProjectLighthouse.Servers.Website/Pages/Login/LoginForm.cshtml @@ -29,21 +29,16 @@
- @if (!string.IsNullOrWhiteSpace(Model.Error)) + @if (!string.IsNullOrWhiteSpace(Model.Error)) { -
-
- @Model.Translate(GeneralStrings.Error) -
-

@Model.Error

-
+ @await Html.PartialAsync("Partials/ErrorModalPartial", (Model.Translate(GeneralStrings.Error), Model.Error), ViewData) } @Html.AntiForgeryToken() - +

- Instance logo @@ -84,7 +79,7 @@ @Model.Translate(GeneralStrings.ForgotPassword)

- + @if (ServerConfiguration.Instance.Authentication.RegistrationEnabled) {
diff --git a/ProjectLighthouse.Servers.Website/Pages/Login/PasswordResetPage.cshtml b/ProjectLighthouse.Servers.Website/Pages/Login/PasswordResetPage.cshtml index d7e1208e..be8d09a1 100644 --- a/ProjectLighthouse.Servers.Website/Pages/Login/PasswordResetPage.cshtml +++ b/ProjectLighthouse.Servers.Website/Pages/Login/PasswordResetPage.cshtml @@ -1,5 +1,4 @@ @page "/passwordReset" -@using LBPUnion.ProjectLighthouse.Configuration @using LBPUnion.ProjectLighthouse.Localization.StringLists @model LBPUnion.ProjectLighthouse.Servers.Website.Pages.Login.PasswordResetPage @@ -27,46 +26,41 @@ @if (!string.IsNullOrWhiteSpace(Model.Error)) { -
-
- @Model.Translate(GeneralStrings.Error) -
-

@Model.Error

-
+ @await Html.PartialAsync("Partials/ErrorModalPartial", (Model.Translate(GeneralStrings.Error), Model.Error), ViewData) }
- - @Html.AntiForgeryToken() + + @Html.AntiForgeryToken() -
-

-
- @Model.Title -
-

- -
-
- -
- - - +
+

+
+ @Model.Title
-

+ -
- -
- - - +
+
+ +
+ + + +
+ +
+ +
+ + + +
+
+
+
-
-
-
- +
\ No newline at end of file diff --git a/ProjectLighthouse.Servers.Website/Pages/Login/PasswordResetRequestForm.cshtml b/ProjectLighthouse.Servers.Website/Pages/Login/PasswordResetRequestForm.cshtml index 24d53f13..7cf6ac18 100644 --- a/ProjectLighthouse.Servers.Website/Pages/Login/PasswordResetRequestForm.cshtml +++ b/ProjectLighthouse.Servers.Website/Pages/Login/PasswordResetRequestForm.cshtml @@ -5,18 +5,13 @@ @{ Layout = "Layouts/BaseLayout"; Model.Title = "Password Reset"; -} - +} + @if (!string.IsNullOrWhiteSpace(Model.Error)) { -
-
- @Model.Translate(GeneralStrings.Error) -
-

@Model.Error

-
+ @await Html.PartialAsync("Partials/ErrorModalPartial", (Model.Translate(GeneralStrings.Error), Model.Error), ViewData) } - + @if (!string.IsNullOrWhiteSpace(Model.Status)) {
@@ -28,7 +23,7 @@ }
- @Html.AntiForgeryToken() + @Html.AntiForgeryToken()

diff --git a/ProjectLighthouse.Servers.Website/Pages/Login/RegisterForm.cshtml b/ProjectLighthouse.Servers.Website/Pages/Login/RegisterForm.cshtml index 9b423b05..0ae63ad1 100644 --- a/ProjectLighthouse.Servers.Website/Pages/Login/RegisterForm.cshtml +++ b/ProjectLighthouse.Servers.Website/Pages/Login/RegisterForm.cshtml @@ -25,17 +25,14 @@ @if (!string.IsNullOrWhiteSpace(Model.Error)) { -
-
- @Model.Translate(GeneralStrings.Error) -
-

@Model.Error

-
+ @await Html.PartialAsync("Partials/ErrorModalPartial", (Model.Translate(GeneralStrings.Error), Model.Error), ViewData) } @if (Model.Username == null) { -

@Model.Translate(RegisterStrings.UsernameNotice)

+

+ @Model.Translate(RegisterStrings.UsernameNotice) +

} diff --git a/ProjectLighthouse.Servers.Website/Pages/Moderation/NewCasePage.cshtml b/ProjectLighthouse.Servers.Website/Pages/Moderation/NewCasePage.cshtml index 0ed8cadd..4e6214fe 100644 --- a/ProjectLighthouse.Servers.Website/Pages/Moderation/NewCasePage.cshtml +++ b/ProjectLighthouse.Servers.Website/Pages/Moderation/NewCasePage.cshtml @@ -9,17 +9,12 @@ @Html.AntiForgeryToken() - + @if (!string.IsNullOrWhiteSpace(Model.Error)) { -
-
- @Model.Translate(GeneralStrings.Error) -
-

@Model.Error

-
+ @await Html.PartialAsync("Partials/ErrorModalPartial", (Model.Translate(GeneralStrings.Error), Model.Error), ViewData) } - + @@ -27,7 +22,7 @@


- +
diff --git a/ProjectLighthouse.Servers.Website/Pages/Partials/ErrorModalPartial.cshtml b/ProjectLighthouse.Servers.Website/Pages/Partials/ErrorModalPartial.cshtml new file mode 100644 index 00000000..4ee54119 --- /dev/null +++ b/ProjectLighthouse.Servers.Website/Pages/Partials/ErrorModalPartial.cshtml @@ -0,0 +1,8 @@ +@model (string Title, string Message) + +
+
+ @Model.Title +
+

@Model.Message

+
\ No newline at end of file diff --git a/ProjectLighthouse.Servers.Website/Pages/Partials/TwoFactorPartial.cshtml b/ProjectLighthouse.Servers.Website/Pages/Partials/TwoFactorPartial.cshtml index 9d322760..ee90db18 100644 --- a/ProjectLighthouse.Servers.Website/Pages/Partials/TwoFactorPartial.cshtml +++ b/ProjectLighthouse.Servers.Website/Pages/Partials/TwoFactorPartial.cshtml @@ -10,14 +10,9 @@ @Html.AntiForgeryToken()
@if (!string.IsNullOrWhiteSpace(error)) - { -
-
- @Model.Translate(GeneralStrings.Error) -
-

@Model.Error

-
- } + { + @await Html.PartialAsync("Partials/ErrorModalPartial", ((string)Model.Translate(GeneralStrings.Error), error), ViewData) + } @@ -45,16 +40,16 @@ @if (allowBackupCodes) { - -document.getElementById("backup-link").addEventListener("click", function (){ - let backupInput = document.getElementById("backup"); - if (backupInput.style.display === "none"){ - backupInput.style.display = ""; - } else { - backupInput.style.display = "none"; - } -}); - + + document.getElementById("backup-link").addEventListener("click", function (){ + let backupInput = document.getElementById("backup"); + if (backupInput.style.display === "none"){ + backupInput.style.display = ""; + } else { + backupInput.style.display = "none"; + } + }); + } document.querySelector(".digits").addEventListener("keydown", function(event){