From dfdb99165baab95b6f0ce9a6fa9474b9a0011c6e Mon Sep 17 00:00:00 2001 From: Umar Bolatov Date: Fri, 8 Nov 2019 22:38:37 -0800 Subject: [PATCH] Vary page layout for registering new accounts address #1138 --- BTCPayServer/Controllers/AccountController.cs | 3 ++- BTCPayServer/Views/Account/Register.cshtml | 6 ++++-- BTCPayServer/Views/Server/ListUsers.cshtml | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/BTCPayServer/Controllers/AccountController.cs b/BTCPayServer/Controllers/AccountController.cs index 4cd84d90f..247491352 100644 --- a/BTCPayServer/Controllers/AccountController.cs +++ b/BTCPayServer/Controllers/AccountController.cs @@ -364,7 +364,7 @@ namespace BTCPayServer.Controllers [HttpGet] [AllowAnonymous] - public async Task Register(string returnUrl = null, bool logon = true) + public async Task Register(string returnUrl = null, bool logon = true, bool useBasicLayout = false) { var policies = await _SettingsRepository.GetSettingAsync() ?? new PoliciesSettings(); if (policies.LockSubscription && !User.IsInRole(Roles.ServerAdmin)) @@ -372,6 +372,7 @@ namespace BTCPayServer.Controllers ViewData["ReturnUrl"] = returnUrl; ViewData["Logon"] = logon.ToString(CultureInfo.InvariantCulture).ToLowerInvariant(); ViewData["AllowIsAdmin"] = _Options.AllowAdminRegistration; + ViewData["UseBasicLayout"] = useBasicLayout; return View(); } diff --git a/BTCPayServer/Views/Account/Register.cshtml b/BTCPayServer/Views/Account/Register.cshtml index 667dff7e7..a94cfd704 100644 --- a/BTCPayServer/Views/Account/Register.cshtml +++ b/BTCPayServer/Views/Account/Register.cshtml @@ -1,10 +1,12 @@ @model RegisterViewModel @{ ViewData["Title"] = "Register"; - Layout = "_WelcomeLayout.cshtml"; + var useBasicLayout = ViewData["UseBasicLayout"] is true; + Layout = useBasicLayout ? "../Shared/_Layout.cshtml" : "_WelcomeLayout.cshtml"; } -