Unify welcome and error layout to LayoutSimple

This commit is contained in:
Dennis Reimann 2020-07-02 15:44:15 +02:00
parent 37b065ce6a
commit 761f6152d0
No known key found for this signature in database
GPG key ID: 5009E1797F03F8D0
9 changed files with 60 additions and 157 deletions

View file

@ -1,8 +1,10 @@
@model LoginViewModel @model LoginViewModel
@inject BTCPayServer.Services.BTCPayServerEnvironment env
@inject BTCPayServer.HostedServices.CssThemeManager themeManager @inject BTCPayServer.HostedServices.CssThemeManager themeManager
@{ @{
ViewData["Title"] = "Log in"; ViewData["Title"] = "Log in";
Layout = "_LayoutWelcome"; ViewData["Headline"] = "Welcome to your BTCPay Server";
Layout = "_LayoutSimple";
} }
@if (TempData.HasStatusMessage()) @if (TempData.HasStatusMessage())
{ {
@ -12,6 +14,11 @@
</div> </div>
</div> </div>
} }
<p class="lead-login">
BTCPay Server is a self-hosted, open-source cryptocurrency payment processor. It is secure, private, censorship-resistant and free.
</p>
<div class="modal-dialog modal-login"> <div class="modal-dialog modal-login">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
@ -53,3 +60,16 @@
} }
</div> </div>
</div> </div>
@if (env.OnionUrl != null)
{
<div class="input-group form-group">
<div class="input-group-prepend">
<a href="@env.OnionUrl" class="input-group-text">
<span class="input-group-addon"></span>
<img src="~/img/icons/Onion_Color.svg" height="16" asp-append-version="true" />
</a>
</div>
<input class="form-control" onClick="this.select();" type="text" style="font-size:0.75em;" value="@env.OnionUrl" readonly>
</div>
}

View file

@ -1,8 +1,11 @@
@model RegisterViewModel @model RegisterViewModel
@inject BTCPayServer.Services.BTCPayServerEnvironment env
@{ @{
ViewData["Title"] = "Register"; ViewData["Title"] = "Register";
ViewData["Headline"] = "Welcome to your BTCPay Server";
var useBasicLayout = ViewData["UseBasicLayout"] is true; var useBasicLayout = ViewData["UseBasicLayout"] is true;
Layout = useBasicLayout ? "_Layout" : "_LayoutWelcome"; Layout = useBasicLayout ? "_Layout" : "_LayoutSimple";
} }
@if (TempData.HasStatusMessage()) @if (TempData.HasStatusMessage())
{ {
@ -13,6 +16,10 @@
</div> </div>
} }
<p class="lead-login">
BTCPay Server is a self-hosted, open-source cryptocurrency payment processor. It is secure, private, censorship-resistant and free.
</p>
<!-- We want to center the dialog box in case we are not using the Welcome layout --> <!-- We want to center the dialog box in case we are not using the Welcome layout -->
<div class="modal-dialog @(useBasicLayout ? "modal-dialog-centered" : "")"> <div class="modal-dialog @(useBasicLayout ? "modal-dialog-centered" : "")">
<div class="modal-content"> <div class="modal-content">
@ -73,3 +80,16 @@
<div class="modal-footer"><span>Already have an account? <a id="Login" asp-action="Login" asp-route-returnurl="@ViewData["ReturnUrl"]">Login</a></span></div> <div class="modal-footer"><span>Already have an account? <a id="Login" asp-action="Login" asp-route-returnurl="@ViewData["ReturnUrl"]">Login</a></span></div>
</div> </div>
</div> </div>
@if (!useBasicLayout && env.OnionUrl != null)
{
<div class="input-group form-group">
<div class="input-group-prepend">
<a href="@env.OnionUrl" class="input-group-text">
<span class="input-group-addon"></span>
<img src="~/img/icons/Onion_Color.svg" height="16" asp-append-version="true" />
</a>
</div>
<input class="form-control" onClick="this.select();" type="text" style="font-size:0.75em;" value="@env.OnionUrl" readonly>
</div>
}

View file

@ -1,8 +1,8 @@
@{ @{
ViewData["ErrorTitle"] = "404 - Page not found"; ViewData["Headline"] = "404 - Page not found";
} }
<p class="lead-login"> <p class="lead-login text-center">
This is like searching for a person more beautiful than <a href="https://twitter.com/NicolasDorier" target="_blank">Nicolas Dorier</a>. This is like searching for a person more beautiful than <a href="https://twitter.com/NicolasDorier" target="_blank">Nicolas Dorier</a>.
<br /><br /> <br /><br />
<a href="https://twitter.com/NicolasDorier" target="_blank"> <a href="https://twitter.com/NicolasDorier" target="_blank">

View file

@ -1,8 +1,8 @@
@{ @{
ViewData["ErrorTitle"] = "429 - Too Many Requests"; ViewData["Headline"] = "429 - Too Many Requests";
} }
<p class="lead-login"> <p class="lead-login text-center">
Please send requests slower. Or face the wrath of <a href="https://twitter.com/r0ckstardev" target="_blank">Vin Diesel</a>. Please send requests slower. Or face the wrath of <a href="https://twitter.com/r0ckstardev" target="_blank">Vin Diesel</a>.
<br /><br /> <br /><br />
<a href="https://twitter.com/r0ckstardev" target="_blank"> <a href="https://twitter.com/r0ckstardev" target="_blank">

View file

@ -1,8 +1,8 @@
@{ @{
ViewData["ErrorTitle"] = "500 - Internal Server Error"; ViewData["Headline"] = "500 - Internal Server Error";
} }
<p class="lead-login"> <p class="lead-login text-center">
Whoops, something really went wrong! <a href="https://twitter.com/mrkukks">Mr Kukks</a> is so sorry. Whoops, something really went wrong! <a href="https://twitter.com/mrkukks">Mr Kukks</a> is so sorry.
<br /><br /> <br /><br />
<a href="https://twitter.com/mrkukks" target="_blank"> <a href="https://twitter.com/mrkukks" target="_blank">

View file

@ -1,15 +1,15 @@
@using System.Net @using System.Net
@model int? @model int?
@{ @{
ViewData["ErrorTitle"] = "Generic Error occurred"; ViewData["Headline"] = "Generic Error occurred";
if (Model.HasValue) if (Model.HasValue)
{ {
var httpCode = (HttpStatusCode)Model.Value; var httpCode = (HttpStatusCode)Model.Value;
ViewData["ErrorTitle"] = $"{(int)httpCode} - {httpCode.ToString()}"; ViewData["Headline"] = $"{(int)httpCode} - {httpCode.ToString()}";
} }
} }
<p class="lead-login"> <p class="lead-login text-center">
Generic error occurred, HTTP Code: @Model Generic error occurred, HTTP Code: @Model
<br /><br /> <br /><br />
Consult server log for more details. Consult server log for more details.

View file

@ -1,120 +0,0 @@
@{
Layout = null;
}
@inject BTCPayServer.Services.BTCPayServerEnvironment env
<!DOCTYPE html>
<html lang="en">
<head>
<partial name="Header" />
<link href="~/main/fonts/Montserrat.css" rel="stylesheet" asp-append-version="true">
<style>
.content-wrapper {
padding: 20px 0;
}
@@media screen and (min-width: 768px) {
.content-wrapper {
padding: 20px 0;
}
}
.col-head {
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
text-align: center;
}
@@media screen and (min-width: 768px) {
.col-head {
text-align: left;
flex-direction: row;
justify-content: start;
}
}
.head-logo {
height: 70px;
margin-bottom: 1rem;
}
@@media screen and (min-width: 768px) {
.head-logo {
height: 100px;
margin-bottom: 0;
margin-right: 50px;
}
}
.lead-title {
font-family: Montserrat;
font-style: normal;
font-weight: bold;
font-size: 24px;
line-height: 1.2;
/* or 150% */
letter-spacing: 0.1em;
}
@@media screen and (min-width: 768px) {
.lead-title {
font-size: 40px;
}
}
.lead-login {
font-family: Montserrat;
font-style: normal;
font-weight: normal;
font-size: 18px;
line-height: 33px;
/* or 183% */
letter-spacing: 0.1em;
}
.lead-h {
font-family: Montserrat;
font-style: normal;
margin-bottom: 30px;
font-weight: 600;
font-size: 14px;
line-height: 18px;
/* identical to box height, or 129% */
letter-spacing: 0.1em;
text-transform: uppercase;
}
</style>
</head>
<body>
<center>
<section class="content-wrapper">
<!-- Dummy navbar-brand, hackish way to keep test AssertNoError passing -->
<div class="navbar-brand" style="display:none;"></div>
<div class="container">
<div class="row">
<div class="col-12 col-head" style="justify-content:center;">
<a asp-controller="Home" asp-action="Index">
<img src="~/img/btcpay-logo.svg" alt="BTCPay Server" class="head-logo" asp-append-version="true" />
</a>
<h1 class="lead-title text-uppercase">@ViewData["ErrorTitle"]</h1>
</div>
</div>
<div class="row">
<div class="col-12">
<hr class="primary ml-0" style="margin:20px auto;" />
@RenderBody()
</div>
</div>
<div class="row">
<div class="col-12">
<hr class="primary ml-0" style="margin:20px auto;" />
<partial name="_BTCPaySupporters"/>
</div>
</div>
</div>
</section>
</center>
</body>
</html>

View file

@ -1,3 +1,3 @@
@{ @{
Layout = "_LayoutError"; Layout = "_LayoutSimple";
} }

View file

@ -1,7 +1,6 @@
@{ @{
Layout = null; Layout = null;
} }
@inject BTCPayServer.Services.BTCPayServerEnvironment env
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
@ -31,7 +30,6 @@
.col-head { .col-head {
text-align: left; text-align: left;
flex-direction: row; flex-direction: row;
justify-content: start;
} }
} }
@ -95,32 +93,17 @@
<div class="row"> <div class="row">
<div class="col-12 col-head"> <div class="col-12 col-head">
<a asp-controller="Home" asp-action="Index"><img src="~/img/btcpay-logo.svg" alt="BTCPay Server" class="head-logo" asp-append-version="true" /></a> <a asp-controller="Home" asp-action="Index"><img src="~/img/btcpay-logo.svg" alt="BTCPay Server" class="head-logo" asp-append-version="true" /></a>
<h1 class="lead-title text-uppercase">Welcome to your BTCPay Server</h1> <h1 class="lead-title text-uppercase">@ViewData["Headline"]</h1>
</div> </div>
</div> </div>
<div class="row">
<div class="col-md-7 order-md-1 order-2">
<hr class="primary ml-0" style="margin:30px auto;">
<p class="lead-login" style="margin-bottom:69px;">BTCPay Server is a self-hosted, open-source cryptocurrency payment processor. It is secure, private, censorship-resistant and free.</p>
<partial name="_BTCPaySupporters"/>
</div>
<div class="col-md-5 order-md-2 order-1">
@RenderBody()
@if (env.OnionUrl != null) <hr class="primary" style="display:block;margin:20px auto;" />
{
<div class="input-group form-group"> @RenderBody()
<div class="input-group-prepend">
<a href="@env.OnionUrl" class="input-group-text"> <hr class="primary" style="display:block;margin:20px auto;" />
<span class="input-group-addon"></span>
<img src="~/img/icons/Onion_Color.svg" height="16" asp-append-version="true" /> <partial name="_BTCPaySupporters"/>
</a>
</div>
<input class="form-control" onClick="this.select();" type="text" style="font-size:0.75em;" value="@env.OnionUrl" readonly>
</div>
}
</div>
</div>
</div> </div>
</section> </section>
@await Html.PartialAsync("_ValidationScriptsPartial") @await Html.PartialAsync("_ValidationScriptsPartial")