From 1a407a2da3865f01004a0dc7a1ece5bf9f502dd4 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Tue, 5 Nov 2019 17:02:43 +0900 Subject: [PATCH 1/3] Add sponsor and new design to the login and registration page --- BTCPayServer.Tests/SeleniumTests.cs | 4 +- BTCPayServer/Views/Account/Login.cshtml | 84 +++++++--------- BTCPayServer/Views/Account/Register.cshtml | 98 +++++++++---------- .../Views/Account/_WelcomeLayout.cshtml | 92 +++++++++++++++++ BTCPayServer/wwwroot/img/btcpay-logo.svg | 97 ++++++++++++++++++ BTCPayServer/wwwroot/img/squarecrypto.svg | 24 +++++ 6 files changed, 299 insertions(+), 100 deletions(-) create mode 100644 BTCPayServer/Views/Account/_WelcomeLayout.cshtml create mode 100644 BTCPayServer/wwwroot/img/btcpay-logo.svg create mode 100644 BTCPayServer/wwwroot/img/squarecrypto.svg diff --git a/BTCPayServer.Tests/SeleniumTests.cs b/BTCPayServer.Tests/SeleniumTests.cs index 191ee64a2..f1655a977 100644 --- a/BTCPayServer.Tests/SeleniumTests.cs +++ b/BTCPayServer.Tests/SeleniumTests.cs @@ -208,7 +208,7 @@ namespace BTCPayServer.Tests Assert.Contains("ReturnUrl", s.Driver.Url); s.Driver.Navigate().GoToUrl(invoiceUrl); Assert.Contains("ReturnUrl", s.Driver.Url); - + s.Driver.Navigate().GoToUrl(s.Link("/")); // When logged we should not be able to access store and invoice details var bob = s.RegisterNewUser(); s.Driver.Navigate().GoToUrl(storeUrl); @@ -252,7 +252,7 @@ namespace BTCPayServer.Tests await s.StartAsync(); s.Driver.Navigate().GoToUrl(s.Link("/api-access-request")); Assert.Contains("ReturnUrl", s.Driver.Url); - + s.Driver.Navigate().GoToUrl(s.Link("/")); var alice = s.RegisterNewUser(); var store = s.CreateNewStore().storeName; s.AddDerivationScheme(); diff --git a/BTCPayServer/Views/Account/Login.cshtml b/BTCPayServer/Views/Account/Login.cshtml index 4c4d88224..2272a73e6 100644 --- a/BTCPayServer/Views/Account/Login.cshtml +++ b/BTCPayServer/Views/Account/Login.cshtml @@ -1,54 +1,46 @@ @model LoginViewModel -@inject SignInManager SignInManager @inject BTCPayServer.HostedServices.CssThemeManager themeManager - @{ ViewData["Title"] = "Log in"; + Layout = "_WelcomeLayout.cshtml"; } -
-
-
-@section Scripts { - @await Html.PartialAsync("_ValidationScriptsPartial") -} + diff --git a/BTCPayServer/Views/Account/Register.cshtml b/BTCPayServer/Views/Account/Register.cshtml index 7be8bbca3..667dff7e7 100644 --- a/BTCPayServer/Views/Account/Register.cshtml +++ b/BTCPayServer/Views/Account/Register.cshtml @@ -1,62 +1,56 @@ @model RegisterViewModel @{ ViewData["Title"] = "Register"; + Layout = "_WelcomeLayout.cshtml"; } -
-
-
-@section Scripts { - @await Html.PartialAsync("_ValidationScriptsPartial") -} + diff --git a/BTCPayServer/Views/Account/_WelcomeLayout.cshtml b/BTCPayServer/Views/Account/_WelcomeLayout.cshtml new file mode 100644 index 000000000..12e329a0d --- /dev/null +++ b/BTCPayServer/Views/Account/_WelcomeLayout.cshtml @@ -0,0 +1,92 @@ +@model LoginViewModel +@inject BTCPayServer.HostedServices.CssThemeManager themeManager +@addTagHelper *, BundlerMinifier.TagHelpers +@{ + Layout = null; +} + + + + + + + + + @if (themeManager.DiscourageSearchEngines) + { + + } + @ViewData["Title"] + @* CSS *@ + + + + @* JS *@ + + + + +
+ + +
+
+
+ BTCPay Server +

Welcome to your BTCPay Server

+
+ +

Our supporters

+ +
+
+ @RenderBody() +
+
+
+
+ @await Html.PartialAsync("_ValidationScriptsPartial") + + diff --git a/BTCPayServer/wwwroot/img/btcpay-logo.svg b/BTCPayServer/wwwroot/img/btcpay-logo.svg new file mode 100644 index 000000000..15620b365 --- /dev/null +++ b/BTCPayServer/wwwroot/img/btcpay-logo.svg @@ -0,0 +1,97 @@ + +image/svg+xml \ No newline at end of file diff --git a/BTCPayServer/wwwroot/img/squarecrypto.svg b/BTCPayServer/wwwroot/img/squarecrypto.svg new file mode 100644 index 000000000..aaa9646d4 --- /dev/null +++ b/BTCPayServer/wwwroot/img/squarecrypto.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file From 5650b8560d1aec91ad45f06cce6661df8aa60ba3 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Wed, 6 Nov 2019 12:19:06 +0900 Subject: [PATCH 2/3] Refactor the Header in its own partial view --- .../Views/Account/_WelcomeLayout.cshtml | 18 +-------------- BTCPayServer/Views/Shared/Confirm.cshtml | 20 ++--------------- BTCPayServer/Views/Shared/Header.cshtml | 18 +++++++++++++++ BTCPayServer/Views/Shared/_Layout.cshtml | 22 +------------------ 4 files changed, 22 insertions(+), 56 deletions(-) create mode 100644 BTCPayServer/Views/Shared/Header.cshtml diff --git a/BTCPayServer/Views/Account/_WelcomeLayout.cshtml b/BTCPayServer/Views/Account/_WelcomeLayout.cshtml index 12e329a0d..469cef793 100644 --- a/BTCPayServer/Views/Account/_WelcomeLayout.cshtml +++ b/BTCPayServer/Views/Account/_WelcomeLayout.cshtml @@ -1,6 +1,4 @@ @model LoginViewModel -@inject BTCPayServer.HostedServices.CssThemeManager themeManager -@addTagHelper *, BundlerMinifier.TagHelpers @{ Layout = null; } @@ -8,21 +6,7 @@ - - - - - @if (themeManager.DiscourageSearchEngines) - { - - } - @ViewData["Title"] - @* CSS *@ - - - - @* JS *@ - +