From 761f6152d0fca135064d2e3afc795530b8950e75 Mon Sep 17 00:00:00 2001 From: Dennis Reimann Date: Thu, 2 Jul 2020 15:44:15 +0200 Subject: [PATCH] Unify welcome and error layout to LayoutSimple --- BTCPayServer/Views/Account/Login.cshtml | 22 +++- BTCPayServer/Views/Account/Register.cshtml | 22 +++- BTCPayServer/Views/Error/404.cshtml | 4 +- BTCPayServer/Views/Error/429.cshtml | 4 +- BTCPayServer/Views/Error/500.cshtml | 4 +- BTCPayServer/Views/Error/Handle.cshtml | 6 +- BTCPayServer/Views/Error/_LayoutError.cshtml | 120 ------------------ BTCPayServer/Views/Error/_ViewStart.cshtml | 2 +- ...outWelcome.cshtml => _LayoutSimple.cshtml} | 33 ++--- 9 files changed, 60 insertions(+), 157 deletions(-) delete mode 100644 BTCPayServer/Views/Error/_LayoutError.cshtml rename BTCPayServer/Views/Shared/{_LayoutWelcome.cshtml => _LayoutSimple.cshtml} (63%) diff --git a/BTCPayServer/Views/Account/Login.cshtml b/BTCPayServer/Views/Account/Login.cshtml index b7eaadeca..ea9f9c0b8 100644 --- a/BTCPayServer/Views/Account/Login.cshtml +++ b/BTCPayServer/Views/Account/Login.cshtml @@ -1,8 +1,10 @@ @model LoginViewModel +@inject BTCPayServer.Services.BTCPayServerEnvironment env @inject BTCPayServer.HostedServices.CssThemeManager themeManager @{ ViewData["Title"] = "Log in"; - Layout = "_LayoutWelcome"; + ViewData["Headline"] = "Welcome to your BTCPay Server"; + Layout = "_LayoutSimple"; } @if (TempData.HasStatusMessage()) { @@ -12,6 +14,11 @@ } + +

+ BTCPay Server is a self-hosted, open-source cryptocurrency payment processor. It is secure, private, censorship-resistant and free. +

+ } +

+ BTCPay Server is a self-hosted, open-source cryptocurrency payment processor. It is secure, private, censorship-resistant and free. +

+ + +@if (!useBasicLayout && env.OnionUrl != null) +{ +
+ + +
+} diff --git a/BTCPayServer/Views/Error/404.cshtml b/BTCPayServer/Views/Error/404.cshtml index 889ee6ccc..0add18d44 100644 --- a/BTCPayServer/Views/Error/404.cshtml +++ b/BTCPayServer/Views/Error/404.cshtml @@ -1,8 +1,8 @@ @{ - ViewData["ErrorTitle"] = "404 - Page not found"; + ViewData["Headline"] = "404 - Page not found"; } -

+

This is like searching for a person more beautiful than Nicolas Dorier.

diff --git a/BTCPayServer/Views/Error/429.cshtml b/BTCPayServer/Views/Error/429.cshtml index 316081cd1..891d88148 100644 --- a/BTCPayServer/Views/Error/429.cshtml +++ b/BTCPayServer/Views/Error/429.cshtml @@ -1,8 +1,8 @@ @{ - ViewData["ErrorTitle"] = "429 - Too Many Requests"; + ViewData["Headline"] = "429 - Too Many Requests"; } -

+

Please send requests slower. Or face the wrath of Vin Diesel.

diff --git a/BTCPayServer/Views/Error/500.cshtml b/BTCPayServer/Views/Error/500.cshtml index fcfbd1c4a..1c4297aeb 100644 --- a/BTCPayServer/Views/Error/500.cshtml +++ b/BTCPayServer/Views/Error/500.cshtml @@ -1,8 +1,8 @@ @{ - ViewData["ErrorTitle"] = "500 - Internal Server Error"; + ViewData["Headline"] = "500 - Internal Server Error"; } -

+

Whoops, something really went wrong! Mr Kukks is so sorry.

diff --git a/BTCPayServer/Views/Error/Handle.cshtml b/BTCPayServer/Views/Error/Handle.cshtml index 12f058f32..025a25d5f 100644 --- a/BTCPayServer/Views/Error/Handle.cshtml +++ b/BTCPayServer/Views/Error/Handle.cshtml @@ -1,15 +1,15 @@ @using System.Net @model int? @{ - ViewData["ErrorTitle"] = "Generic Error occurred"; + ViewData["Headline"] = "Generic Error occurred"; if (Model.HasValue) { var httpCode = (HttpStatusCode)Model.Value; - ViewData["ErrorTitle"] = $"{(int)httpCode} - {httpCode.ToString()}"; + ViewData["Headline"] = $"{(int)httpCode} - {httpCode.ToString()}"; } } -

+

Generic error occurred, HTTP Code: @Model

Consult server log for more details. diff --git a/BTCPayServer/Views/Error/_LayoutError.cshtml b/BTCPayServer/Views/Error/_LayoutError.cshtml deleted file mode 100644 index bf3da3a61..000000000 --- a/BTCPayServer/Views/Error/_LayoutError.cshtml +++ /dev/null @@ -1,120 +0,0 @@ -@{ - Layout = null; -} -@inject BTCPayServer.Services.BTCPayServerEnvironment env - - - - - - - - - -

-
- - -
-
-
- - - -

@ViewData["ErrorTitle"]

-
-
-
-
-
- @RenderBody() -
-
-
-
-
- -
-
-
-
-
- - diff --git a/BTCPayServer/Views/Error/_ViewStart.cshtml b/BTCPayServer/Views/Error/_ViewStart.cshtml index 5d3510360..3d37ae03f 100644 --- a/BTCPayServer/Views/Error/_ViewStart.cshtml +++ b/BTCPayServer/Views/Error/_ViewStart.cshtml @@ -1,3 +1,3 @@ @{ - Layout = "_LayoutError"; + Layout = "_LayoutSimple"; } diff --git a/BTCPayServer/Views/Shared/_LayoutWelcome.cshtml b/BTCPayServer/Views/Shared/_LayoutSimple.cshtml similarity index 63% rename from BTCPayServer/Views/Shared/_LayoutWelcome.cshtml rename to BTCPayServer/Views/Shared/_LayoutSimple.cshtml index 7d10b9651..415293e7e 100644 --- a/BTCPayServer/Views/Shared/_LayoutWelcome.cshtml +++ b/BTCPayServer/Views/Shared/_LayoutSimple.cshtml @@ -1,7 +1,6 @@ @{ Layout = null; } -@inject BTCPayServer.Services.BTCPayServerEnvironment env @@ -31,7 +30,6 @@ .col-head { text-align: left; flex-direction: row; - justify-content: start; } } @@ -95,32 +93,17 @@
-

Welcome to your BTCPay Server

+

@ViewData["Headline"]

-
-
-
- - -
-
- @RenderBody() - @if (env.OnionUrl != null) - { -
- - -
- } -
-
+
+ + @RenderBody() + +
+ + @await Html.PartialAsync("_ValidationScriptsPartial")