diff --git a/BTCPayServer.Abstractions/Extensions/ViewsRazor.cs b/BTCPayServer.Abstractions/Extensions/ViewsRazor.cs index da1c67ed2..fb2d32b47 100644 --- a/BTCPayServer.Abstractions/Extensions/ViewsRazor.cs +++ b/BTCPayServer.Abstractions/Extensions/ViewsRazor.cs @@ -13,13 +13,18 @@ namespace BTCPayServer.Abstractions.Extensions public static void SetActivePage(this ViewDataDictionary viewData, T activePage, string title = null, string activeId = null) where T : IConvertible + { + SetActivePage(viewData, activePage.ToString(), activePage.GetType().Name,title, activeId ); + } + + public static void SetActivePage(this ViewDataDictionary viewData, string activePage, string category, string title = null, string activeId = null) { // Page Title - viewData["Title"] = title ?? activePage.ToString(); + viewData["Title"] = title ?? activePage; // Navigation viewData[ACTIVE_PAGE_KEY] = activePage; viewData[ACTIVE_ID_KEY] = activeId; - SetActiveCategory(viewData, activePage.GetType()); + SetActiveCategory(viewData, category); } public static void SetActiveCategory(this ViewDataDictionary viewData, T activeCategory) @@ -27,30 +32,43 @@ namespace BTCPayServer.Abstractions.Extensions viewData[ACTIVE_CATEGORY_KEY] = activeCategory; } + public static void SetActiveCategory(this ViewDataDictionary viewData, string activeCategory) + { + viewData[ACTIVE_CATEGORY_KEY] = activeCategory; + } + public static string IsActiveCategory(this ViewDataDictionary viewData, T category, object id = null) + { + return IsActiveCategory(viewData, category.ToString(), id); + } + public static string IsActiveCategory(this ViewDataDictionary viewData, string category, object id = null) { if (!viewData.ContainsKey(ACTIVE_CATEGORY_KEY)) { return null; } var activeId = viewData[ACTIVE_ID_KEY]; - var activeCategory = (T)viewData[ACTIVE_CATEGORY_KEY]; - var categoryMatch = category.Equals(activeCategory); + var activeCategory = viewData[ACTIVE_CATEGORY_KEY]?.ToString(); + var categoryMatch = category.Equals(activeCategory, StringComparison.InvariantCultureIgnoreCase); var idMatch = id == null || activeId == null || id.Equals(activeId); return categoryMatch && idMatch ? "active" : null; } public static string IsActivePage(this ViewDataDictionary viewData, T page, object id = null) where T : IConvertible + { + return IsActivePage(viewData, page.ToString(), page.GetType().Name, id ); + } + public static string IsActivePage(this ViewDataDictionary viewData, string page,string category, object id = null) { if (!viewData.ContainsKey(ACTIVE_PAGE_KEY)) { return null; } var activeId = viewData[ACTIVE_ID_KEY]; - var activePage = (T)viewData[ACTIVE_PAGE_KEY]; - var activeCategory = viewData[ACTIVE_CATEGORY_KEY]; - var categoryAndPageMatch = activeCategory.Equals(activePage.GetType()) && page.Equals(activePage); + var activePage = viewData[ACTIVE_PAGE_KEY]?.ToString(); + var activeCategory = viewData[ACTIVE_CATEGORY_KEY]?.ToString(); + var categoryAndPageMatch = ( category == null || activeCategory.Equals(category, StringComparison.InvariantCultureIgnoreCase )) && page.Equals(activePage, StringComparison.InvariantCultureIgnoreCase); var idMatch = id == null || activeId == null || id.Equals(activeId); return categoryAndPageMatch && idMatch ? "active" : null; } diff --git a/BTCPayServer.Tests/AltcoinTests/AltcoinTests.cs b/BTCPayServer.Tests/AltcoinTests/AltcoinTests.cs index eaacd907f..218440fc9 100644 --- a/BTCPayServer.Tests/AltcoinTests/AltcoinTests.cs +++ b/BTCPayServer.Tests/AltcoinTests/AltcoinTests.cs @@ -404,8 +404,6 @@ namespace BTCPayServer.Tests Assert.Contains("2.20000000 ₿", s.Driver.PageSource); if (rateSelection == "RateThenText") Assert.Contains("1.10000000 ₿", s.Driver.PageSource); - s.GoToHome(); - s.GoToInvoices(); s.GoToInvoice(invoice.Id); s.Driver.FindElement(By.Id("refundlink")).Click(); Assert.Contains("pull-payments", s.Driver.Url); @@ -423,19 +421,19 @@ namespace BTCPayServer.Tests await s.StartAsync(); s.GoToRegister(); s.RegisterNewUser(); - var store = s.CreateNewStore(); + (_, string storeId) = s.CreateNewStore(); s.AddDerivationScheme("BTC"); //check that there is no dropdown since only one payment method is set - var invoiceId = s.CreateInvoice(store.storeName, 10, "USD", "a@g.com"); + var invoiceId = s.CreateInvoice(storeId, 10, "USD", "a@g.com"); s.GoToInvoiceCheckout(invoiceId); s.Driver.FindElement(By.ClassName("payment__currencies_noborder")); s.GoToHome(); - s.GoToStore(store.storeId); + s.GoToStore(storeId); s.AddDerivationScheme("LTC"); s.AddLightningNode("BTC", LightningConnectionType.CLightning); //there should be three now - invoiceId = s.CreateInvoice(store.storeName, 10, "USD", "a@g.com"); + invoiceId = s.CreateInvoice(storeId, 10, "USD", "a@g.com"); s.GoToInvoiceCheckout(invoiceId); var currencyDropdownButton = s.Driver.FindElement(By.ClassName("payment__currencies")); Assert.Contains("BTC", currencyDropdownButton.Text); diff --git a/BTCPayServer.Tests/CheckoutUITests.cs b/BTCPayServer.Tests/CheckoutUITests.cs index 3cdd50cdb..ceb1a93bf 100644 --- a/BTCPayServer.Tests/CheckoutUITests.cs +++ b/BTCPayServer.Tests/CheckoutUITests.cs @@ -28,17 +28,17 @@ namespace BTCPayServer.Tests await s.StartAsync(); s.GoToRegister(); s.RegisterNewUser(); - var store = s.CreateNewStore(); + (_, string storeId) = s.CreateNewStore(); s.AddDerivationScheme("BTC"); - s.GoToStore(store.storeId, StoreNavPages.CheckoutAppearance); + s.GoToStore(storeId, StoreNavPages.CheckoutAppearance); s.Driver.FindElement(By.Id("RequiresRefundEmail")).Click(); s.Driver.FindElement(By.Name("command")).Click(); - var emailAlreadyThereInvoiceId = s.CreateInvoice(store.storeName, 100, "USD", "a@g.com"); + var emailAlreadyThereInvoiceId = s.CreateInvoice(storeId, 100, "USD", "a@g.com"); s.GoToInvoiceCheckout(emailAlreadyThereInvoiceId); s.Driver.AssertElementNotFound(By.Id("emailAddressFormInput")); s.GoToHome(); - var invoiceId = s.CreateInvoice(store.storeName); + s.CreateInvoice(storeId); s.Driver.FindElement(By.ClassName("invoice-details-link")).Click(); s.Driver.AssertNoError(); s.Driver.Navigate().Back(); @@ -79,11 +79,11 @@ namespace BTCPayServer.Tests await s.StartAsync(); s.GoToRegister(); s.RegisterNewUser(); - var store = s.CreateNewStore(); + (_, string storeId) = s.CreateNewStore(); s.AddDerivationScheme("BTC"); // Now create an invoice that requires a refund email - var invoice = s.CreateInvoice(store.storeName, 100, "USD", "", null, true); + var invoice = s.CreateInvoice(storeId, 100, "USD", "", null, true); s.GoToInvoiceCheckout(invoice); var emailInput = s.Driver.FindElement(By.Id("emailAddressFormInput")); @@ -106,7 +106,7 @@ namespace BTCPayServer.Tests s.GoToHome(); // Now create an invoice that doesn't require a refund email - s.CreateInvoice(store.storeName, 100, "USD", "", null, false); + s.CreateInvoice(storeId, 100, "USD", "", null, false); s.Driver.FindElement(By.ClassName("invoice-details-link")).Click(); s.Driver.AssertNoError(); s.Driver.Navigate().Back(); @@ -119,7 +119,7 @@ namespace BTCPayServer.Tests s.GoToHome(); // Now create an invoice that requires refund email but already has one set, email input shouldn't show up - s.CreateInvoice(store.storeName, 100, "USD", "a@g.com", null, true); + s.CreateInvoice(storeId, 100, "USD", "a@g.com", null, true); s.Driver.FindElement(By.ClassName("invoice-details-link")).Click(); s.Driver.AssertNoError(); s.Driver.Navigate().Back(); @@ -139,10 +139,10 @@ namespace BTCPayServer.Tests await s.StartAsync(); s.GoToRegister(); s.RegisterNewUser(); - var store = s.CreateNewStore(); + (_, string storeId) = s.CreateNewStore(); s.AddDerivationScheme("BTC"); - var invoiceId = s.CreateInvoice(store.storeName); + var invoiceId = s.CreateInvoice(storeId); s.GoToInvoiceCheckout(invoiceId); Assert.True(s.Driver.FindElement(By.Id("DefaultLang")).FindElements(By.TagName("option")).Count > 1); var payWithTextEnglish = s.Driver.FindElement(By.Id("pay-with-text")).Text; @@ -171,11 +171,11 @@ namespace BTCPayServer.Tests await s.StartAsync(); s.GoToRegister(); s.RegisterNewUser(true); - var store = s.CreateNewStore(); + (_, string storeId) = s.CreateNewStore(); s.AddLightningNode(); s.AddDerivationScheme("BTC"); - var invoiceId = s.CreateInvoice(store.storeName, defaultPaymentMethod: "BTC_LightningLike"); + var invoiceId = s.CreateInvoice(storeId, defaultPaymentMethod: "BTC_LightningLike"); s.GoToInvoiceCheckout(invoiceId); Assert.Equal("Bitcoin (Lightning) (BTC)", s.Driver.FindElement(By.ClassName("payment__currencies")).Text); @@ -193,7 +193,7 @@ namespace BTCPayServer.Tests await s.StartAsync(); s.GoToRegister(); s.RegisterNewUser(true); - (string storeName, string storeId) = s.CreateNewStore(); + (_, string storeId) = s.CreateNewStore(); s.AddLightningNode(); s.GoToStore(storeId); s.Driver.FindElement(By.Id("Modify-LightningBTC")).Click(); @@ -201,7 +201,7 @@ namespace BTCPayServer.Tests s.Driver.FindElement(By.Id("save")).Click(); Assert.Contains("BTC Lightning settings successfully updated", s.FindAlertMessage().Text); - var invoiceId = s.CreateInvoice(storeName, 10, "USD", "a@g.com"); + var invoiceId = s.CreateInvoice(storeId, 10, "USD", "a@g.com"); s.GoToInvoiceCheckout(invoiceId); Assert.Contains("Sats", s.Driver.FindElement(By.ClassName("payment__currencies_noborder")).Text); } @@ -215,10 +215,10 @@ namespace BTCPayServer.Tests await s.StartAsync(); s.GoToRegister(); s.RegisterNewUser(); - var store = s.CreateNewStore(); - s.GoToStore(store.storeId); + (_, string storeId) = s.CreateNewStore(); + s.GoToStore(storeId); s.AddDerivationScheme(); - var invoiceId = s.CreateInvoice(store.storeId, 0.001m, "BTC", "a@x.com"); + var invoiceId = s.CreateInvoice(storeId, 0.001m, "BTC", "a@x.com"); var invoice = await s.Server.PayTester.InvoiceRepository.GetInvoice(invoiceId); s.Driver.Navigate() .GoToUrl(new Uri(s.ServerUri, $"tests/index.html?invoice={invoiceId}")); diff --git a/BTCPayServer.Tests/PayJoinTests.cs b/BTCPayServer.Tests/PayJoinTests.cs index bed780e94..93723d36d 100644 --- a/BTCPayServer.Tests/PayJoinTests.cs +++ b/BTCPayServer.Tests/PayJoinTests.cs @@ -246,7 +246,7 @@ namespace BTCPayServer.Tests await s.FundStoreWallet(senderWalletId); await s.FundStoreWallet(receiverWalletId); - var invoiceId = s.CreateInvoice(receiver.storeName, null, "BTC"); + var invoiceId = s.CreateInvoice(receiver.storeId, null, "BTC"); s.GoToInvoiceCheckout(invoiceId); var bip21 = s.Driver.FindElement(By.ClassName("payment__details__instruction__open-wallet__btn")) .GetAttribute("href"); @@ -295,7 +295,7 @@ namespace BTCPayServer.Tests var receiverWalletId = new WalletId(receiver.storeId, cryptoCode); //payjoin is enabled by default. - var invoiceId = s.CreateInvoice(receiver.storeName); + var invoiceId = s.CreateInvoice(receiver.storeId); s.GoToInvoiceCheckout(invoiceId); var bip21 = s.Driver.FindElement(By.ClassName("payment__details__instruction__open-wallet__btn")) .GetAttribute("href"); @@ -310,7 +310,7 @@ namespace BTCPayServer.Tests await s.Server.ExplorerNode.GenerateAsync(1); await s.FundStoreWallet(senderWalletId); - invoiceId = s.CreateInvoice(receiver.storeName); + invoiceId = s.CreateInvoice(receiver.storeId); s.GoToInvoiceCheckout(invoiceId); bip21 = s.Driver.FindElement(By.ClassName("payment__details__instruction__open-wallet__btn")) .GetAttribute("href"); @@ -343,7 +343,7 @@ namespace BTCPayServer.Tests StringComparison.InvariantCultureIgnoreCase)); //let's do it all again, except now the receiver has funds and is able to payjoin - invoiceId = s.CreateInvoice(receiver.storeName); + invoiceId = s.CreateInvoice(receiver.storeId); s.GoToInvoiceCheckout(invoiceId); bip21 = s.Driver.FindElement(By.ClassName("payment__details__instruction__open-wallet__btn")) .GetAttribute("href"); @@ -393,7 +393,7 @@ namespace BTCPayServer.Tests var dto = invoice.EntityToDTO(); Assert.Equal(InvoiceStatusLegacy.Paid, invoice.Status); }); - s.GoToInvoices(); + s.GoToInvoices(receiver.storeId); paymentValueRowColumn = s.Driver.FindElement(By.Id($"invoice_details_{invoiceId}")) .FindElement(By.ClassName("payment-value")); Assert.False(paymentValueRowColumn.Text.Contains("payjoin", diff --git a/BTCPayServer.Tests/SeleniumTester.cs b/BTCPayServer.Tests/SeleniumTester.cs index 6bce78a2b..ab73c9d80 100644 --- a/BTCPayServer.Tests/SeleniumTester.cs +++ b/BTCPayServer.Tests/SeleniumTester.cs @@ -332,17 +332,10 @@ namespace BTCPayServer.Tests Driver.FindElement(By.Id("Password")).SendKeys(password); Driver.FindElement(By.Id("LoginButton")).Click(); } - - public void GoToApps() - { - Driver.FindElement(By.Id("StoreNav-Apps")).Click(); - } public void GoToStore(string storeId, StoreNavPages storeNavPage = StoreNavPages.PaymentMethods) { - GoToHome(); - Driver.WaitForAndClick(By.Id("StoreSelectorToggle")); - Driver.WaitForAndClick(By.Id($"StoreSelectorMenuItem-{storeId}")); + GoToUrl($"/stores/{storeId}/"); if (storeNavPage != StoreNavPages.PaymentMethods) { @@ -360,8 +353,15 @@ namespace BTCPayServer.Tests public void GoToWalletSettings(string storeId, string cryptoCode = "BTC") { - GoToStore(storeId); - Driver.FindElement(By.Id($"Modify{cryptoCode}")).Click(); + try + { + GoToStore(storeId); + Driver.FindElement(By.Id($"Modify{cryptoCode}")).Click(); + } + catch (NoSuchElementException) + { + GoToWallet(new WalletId(storeId, cryptoCode), WalletsNavPages.Settings); + } } public void GoToLightningSettings(string storeId, string cryptoCode = "BTC") @@ -377,10 +377,14 @@ namespace BTCPayServer.Tests CheckForJSErrors(); } - public void GoToInvoices() + public void GoToInvoice(string id) { - GoToHome(); - Driver.FindElement(By.Id("Nav-Invoices")).Click(); + GoToUrl($"/invoices/{id}/"); + } + + public void GoToInvoices(string storeId = null) + { + GoToUrl(storeId == null ? "/invoices/" : $"/stores/{storeId}/invoices/"); } public void GoToProfile(ManageNavPages navPages = ManageNavPages.Index) @@ -394,11 +398,11 @@ namespace BTCPayServer.Tests public void GoToLogin() { - Driver.Navigate().GoToUrl(new Uri(ServerUri, "/login")); + GoToUrl("/login"); } public string CreateInvoice( - string storeName, + string storeId, decimal? amount = 100, string currency = "USD", string refundEmail = "", @@ -407,7 +411,7 @@ namespace BTCPayServer.Tests StatusMessageModel.StatusSeverity expectedSeverity = StatusMessageModel.StatusSeverity.Success ) { - GoToInvoices(); + GoToInvoices(storeId); Driver.FindElement(By.Id("CreateNewInvoice")).Click(); if (amount is decimal v) Driver.FindElement(By.Id("Amount")).SendKeys(v.ToString(CultureInfo.InvariantCulture)); @@ -415,7 +419,6 @@ namespace BTCPayServer.Tests currencyEl.Clear(); currencyEl.SendKeys(currency); Driver.FindElement(By.Id("BuyerEmail")).SendKeys(refundEmail); - Driver.FindElement(By.Name("StoreId")).SendKeys(storeName); if (defaultPaymentMethod is string) new SelectElement(Driver.FindElement(By.Name("DefaultPaymentMethod"))).SelectByValue(defaultPaymentMethod); if (requiresRefundEmail is bool) @@ -501,18 +504,5 @@ namespace BTCPayServer.Tests Driver.FindElement(By.Id($"SectionNav-{navPages}")).Click(); } } - - public void GoToInvoice(string id) - { - GoToInvoices(); - foreach (var el in Driver.FindElements(By.ClassName("invoice-details-link"))) - { - if (el.GetAttribute("href").Contains(id, StringComparison.OrdinalIgnoreCase)) - { - el.Click(); - break; - } - } - } } } diff --git a/BTCPayServer.Tests/SeleniumTests.cs b/BTCPayServer.Tests/SeleniumTests.cs index 890d510a5..7eef619f4 100644 --- a/BTCPayServer.Tests/SeleniumTests.cs +++ b/BTCPayServer.Tests/SeleniumTests.cs @@ -360,7 +360,7 @@ namespace BTCPayServer.Tests s.Server.ActivateLightning(); await s.StartAsync(); var alice = s.RegisterNewUser(true); - var (storeName, storeId) = s.CreateNewStore(); + (string storeName, string storeId) = s.CreateNewStore(); var onchainHint = "Set up your wallet to receive payments at your store."; var offchainHint = "A connection to a Lightning node is required to receive Lightning payments."; @@ -392,8 +392,8 @@ namespace BTCPayServer.Tests var storeUrl = s.Driver.Url; s.ClickOnAllSectionLinks(); - s.GoToInvoices(); - var invoiceId = s.CreateInvoice(storeName); + s.GoToInvoices(storeId); + var invoiceId = s.CreateInvoice(storeId); s.FindAlertMessage(); s.Driver.FindElement(By.ClassName("invoice-details-link")).Click(); var invoiceUrl = s.Driver.Url; @@ -402,16 +402,17 @@ namespace BTCPayServer.Tests Assert.DoesNotContain("Archived", s.Driver.FindElement(By.Id("btn-archive-toggle")).Text); s.Driver.FindElement(By.Id("btn-archive-toggle")).Click(); Assert.Contains("Unarchive", s.Driver.FindElement(By.Id("btn-archive-toggle")).Text); + //check that it no longer appears in list - s.GoToInvoices(); - + s.GoToInvoices(storeId); Assert.DoesNotContain(invoiceId, s.Driver.PageSource); + //ok, let's unarchive and see that it shows again s.Driver.Navigate().GoToUrl(invoiceUrl); s.Driver.FindElement(By.Id("btn-archive-toggle")).Click(); s.FindAlertMessage(); Assert.DoesNotContain("Unarchive", s.Driver.FindElement(By.Id("btn-archive-toggle")).Text); - s.GoToInvoices(); + s.GoToInvoices(storeId); Assert.Contains(invoiceId, s.Driver.PageSource); // When logout out we should not be able to access store and invoice details @@ -614,7 +615,7 @@ namespace BTCPayServer.Tests { await s.StartAsync(); s.RegisterNewUser(true); - var (_, storeId) = s.CreateNewStore(); + (_, string storeId) = s.CreateNewStore(); s.GenerateWallet("BTC", "", false, true); var walletId = new WalletId(storeId, "BTC"); s.GoToWallet(walletId, WalletsNavPages.Receive); @@ -676,7 +677,7 @@ namespace BTCPayServer.Tests { await s.StartAsync(); s.RegisterNewUser(true); - var (storeName, storeId) = s.CreateNewStore(); + (_, string storeId) = s.CreateNewStore(); s.GoToStore(storeId, StoreNavPages.Webhooks); TestLogs.LogInformation("Let's create two webhooks"); @@ -733,7 +734,7 @@ namespace BTCPayServer.Tests TestLogs.LogInformation("Let's see if we can generate an event"); s.GoToStore(storeId); s.AddDerivationScheme(); - s.CreateInvoice(storeName); + s.CreateInvoice(storeId); var request = await server.GetNextRequest(); var headers = request.Request.Headers; var actualSig = headers["BTCPay-Sig"].First(); @@ -745,14 +746,14 @@ namespace BTCPayServer.Tests server.Done(); TestLogs.LogInformation("Let's make a failed event"); - s.CreateInvoice(storeName); + s.CreateInvoice(storeId); request = await server.GetNextRequest(); request.Response.StatusCode = 404; server.Done(); // The delivery is done asynchronously, so small wait here await Task.Delay(500); - s.GoToStore(storeId, Views.Stores.StoreNavPages.Webhooks); + s.GoToStore(storeId, StoreNavPages.Webhooks); s.Driver.FindElement(By.LinkText("Modify")).Click(); var elements = s.Driver.FindElements(By.ClassName("redeliver")); // One worked, one failed @@ -768,7 +769,7 @@ namespace BTCPayServer.Tests TestLogs.LogInformation("Can we browse the json content?"); CanBrowseContent(s); - s.GoToInvoices(); + s.GoToInvoices(storeId); s.Driver.FindElement(By.LinkText("Details")).Click(); CanBrowseContent(s); var element = s.Driver.FindElement(By.ClassName("redeliver")); @@ -798,7 +799,7 @@ namespace BTCPayServer.Tests foreach (var isHotwallet in new[] { false, true }) { var cryptoCode = "BTC"; - var (_, storeId) = s.CreateNewStore(); + (_, string storeId) = s.CreateNewStore(); s.GenerateWallet(cryptoCode, "melody lizard phrase voice unique car opinion merge degree evil swift cargo", privkeys: isHotwallet); s.GoToWalletSettings(storeId, cryptoCode); if (isHotwallet) @@ -816,7 +817,7 @@ namespace BTCPayServer.Tests { await s.StartAsync(); s.RegisterNewUser(true); - (string storeName, string storeId) = s.CreateNewStore(); + (_, string storeId) = s.CreateNewStore(); const string cryptoCode = "BTC"; // In this test, we try to spend from a manual seed. We import the xpub 49'/0'/0', @@ -865,7 +866,7 @@ namespace BTCPayServer.Tests Assert.NotEqual(receiveAddr, s.Driver.FindElement(By.Id("address")).GetAttribute("value")); - var invoiceId = s.CreateInvoice(storeName); + var invoiceId = s.CreateInvoice(storeId); var invoice = await s.Server.PayTester.InvoiceRepository.GetInvoice(invoiceId); var address = invoice.EntityToDTO().Addresses["BTC"]; @@ -878,7 +879,7 @@ namespace BTCPayServer.Tests //lets import and save private keys var root = mnemonic.DeriveExtKey(); - invoiceId = s.CreateInvoice(storeName); + invoiceId = s.CreateInvoice(storeId); invoice = await s.Server.PayTester.InvoiceRepository.GetInvoice(invoiceId); address = invoice.EntityToDTO().Addresses["BTC"]; result = await s.Server.ExplorerNode.GetAddressInfoAsync( @@ -978,8 +979,8 @@ namespace BTCPayServer.Tests { await s.StartAsync(); s.RegisterNewUser(true); - (string _, string storeId) = s.CreateNewStore(); - var cryptoCode = "BTC"; + (_, string storeId) = s.CreateNewStore(); + const string cryptoCode = "BTC"; var mnemonic = s.GenerateWallet(cryptoCode, "click chunk owner kingdom faint steak safe evidence bicycle repeat bulb wheel"); // Make sure wallet info is correct @@ -1294,7 +1295,7 @@ namespace BTCPayServer.Tests new[] { s.Server.MerchantLightningD }, new[] { s.Server.MerchantLnd.Client }); s.RegisterNewUser(true); - (string storeName, string storeId) = s.CreateNewStore(); + (_, string storeId) = s.CreateNewStore(); var network = s.Server.NetworkProvider.GetNetwork(cryptoCode).NBitcoinNetwork; s.GoToStore(storeId); s.AddLightningNode(cryptoCode, LightningConnectionType.CLightning, false); @@ -1307,7 +1308,7 @@ namespace BTCPayServer.Tests SudoForceSaveLightningSettingsRightNowAndFast(s, cryptoCode); // Topup Invoice test - var i = s.CreateInvoice(storeName, null, cryptoCode); + var i = s.CreateInvoice(storeId, null, cryptoCode); s.GoToInvoiceCheckout(i); s.Driver.FindElement(By.Id("copy-tab")).Click(); var lnurl = s.Driver.FindElement(By.CssSelector("input.checkoutTextbox")).GetAttribute("value"); @@ -1339,8 +1340,8 @@ namespace BTCPayServer.Tests }); // Standard invoice test - s.GoToHome(); - i = s.CreateInvoice(storeName, 0.0000001m, cryptoCode); + s.GoToStore(storeId); + i = s.CreateInvoice(storeId, 0.0000001m, cryptoCode); s.GoToInvoiceCheckout(i); s.Driver.FindElement(By.ClassName("payment__currencies")).Click(); // BOLT11 is also available for standard invoices @@ -1382,12 +1383,12 @@ namespace BTCPayServer.Tests s.Driver.FindElement(By.Id("save")).Click(); Assert.Contains($"{cryptoCode} Lightning settings successfully updated", s.FindAlertMessage().Text); - i = s.CreateInvoice(storeName, 0.000001m, cryptoCode); + i = s.CreateInvoice(storeId, 0.000001m, cryptoCode); s.GoToInvoiceCheckout(i); s.Driver.FindElement(By.ClassName("payment__currencies_noborder")); - s.GoToHome(); - i = s.CreateInvoice(storeName, null, cryptoCode); + s.GoToStore(storeId); + i = s.CreateInvoice(storeId, null, cryptoCode); s.GoToInvoiceCheckout(i); s.Driver.FindElement(By.ClassName("payment__currencies_noborder")); @@ -1409,9 +1410,9 @@ namespace BTCPayServer.Tests //even though we set DisableBolt11PaymentMethod to true, logic when saving it turns it back off as otherwise no lightning option is available at all! Assert.False(s.Driver.FindElement(By.Id("DisableBolt11PaymentMethod")).Selected); // Invoice creation should fail, because it is a standard invoice with amount, but DisableBolt11PaymentMethod = true and LNURLStandardInvoiceEnabled = false - s.CreateInvoice(storeName, 0.0000001m, cryptoCode,"",null, expectedSeverity: StatusMessageModel.StatusSeverity.Success); + s.CreateInvoice(storeId, 0.0000001m, cryptoCode,"",null, expectedSeverity: StatusMessageModel.StatusSeverity.Success); - i = s.CreateInvoice(storeName, null, cryptoCode); + i = s.CreateInvoice(storeId, null, cryptoCode); s.GoToInvoiceCheckout(i); s.Driver.FindElement(By.ClassName("payment__currencies_noborder")); s.Driver.FindElement(By.Id("copy-tab")).Click(); @@ -1427,7 +1428,7 @@ namespace BTCPayServer.Tests s.Driver.SetCheckbox(By.Id("DisableBolt11PaymentMethod"), true); s.Driver.FindElement(By.Id("save")).Click(); Assert.Contains($"{cryptoCode} Lightning settings successfully updated", s.FindAlertMessage().Text); - var invForPP = s.CreateInvoice(newStore.storeName, 0.0000001m, cryptoCode); + var invForPP = s.CreateInvoice(newStore.storeId, 0.0000001m, cryptoCode); s.GoToInvoiceCheckout(invForPP); s.Driver.FindElement(By.Id("copy-tab")).Click(); lnurl = s.Driver.FindElement(By.CssSelector("input.checkoutTextbox")).GetAttribute("value"); @@ -1486,25 +1487,19 @@ namespace BTCPayServer.Tests s.RegisterNewUser(true); //ln address tests s.CreateNewStore(); - s.GoToStore(s.StoreId, StoreNavPages.Integrations); //ensure ln address is not available as Lightning is not enable - s.Driver.FindElement(By.Id("lightning-address-option")) - .FindElement(By.LinkText("You need to setup Lightning first")); + s.Driver.AssertElementNotFound(By.Id("StoreNav-LightningAddress")); s.GoToStore(s.StoreId); s.AddLightningNode("BTC", LightningConnectionType.LndREST, false); - s.GoToStore(s.StoreId, StoreNavPages.Integrations); //ensure ln address is not available as lnurl is not configured - s.Driver.FindElement(By.Id("lightning-address-option")) - .FindElement(By.LinkText("You need LNURL configured first")); + s.Driver.AssertElementNotFound(By.Id("StoreNav-LightningAddress")); s.GoToLightningSettings(s.StoreId, cryptoCode); s.Driver.SetCheckbox(By.Id("LNURLEnabled"), true); SudoForceSaveLightningSettingsRightNowAndFast(s, cryptoCode); - s.GoToStore(s.StoreId, StoreNavPages.Integrations); - s.Driver.FindElement(By.Id("lightning-address-option")) - .FindElement(By.Id("lightning-address-setup-link")).Click(); + s.Driver.FindElement(By.Id("StoreNav-LightningAddress")).Click(); s.Driver.ToggleCollapse("AddAddress"); var lnaddress1 = Guid.NewGuid().ToString(); diff --git a/BTCPayServer.Tests/ThirdPartyTests.cs b/BTCPayServer.Tests/ThirdPartyTests.cs index 96b9ae289..198c1a0eb 100644 --- a/BTCPayServer.Tests/ThirdPartyTests.cs +++ b/BTCPayServer.Tests/ThirdPartyTests.cs @@ -339,7 +339,7 @@ namespace BTCPayServer.Tests tester.PayTester.MockRates = false; await tester.StartAsync(); var user = tester.NewAccount(); - user.GrantAccess(); + await user.GrantAccessAsync(); user.RegisterDerivationScheme("BTC"); List rates = new List(); rates.Add(await CreateInvoice(tester, user, "coingecko")); diff --git a/BTCPayServer.Tests/UnitTest1.cs b/BTCPayServer.Tests/UnitTest1.cs index 152207f78..204bf7c30 100644 --- a/BTCPayServer.Tests/UnitTest1.cs +++ b/BTCPayServer.Tests/UnitTest1.cs @@ -794,11 +794,11 @@ namespace BTCPayServer.Tests { await tester.StartAsync(); var acc = tester.NewAccount(); - acc.GrantAccess(); + await acc.GrantAccessAsync(); acc.RegisterDerivationScheme("BTC"); // First we try payment with a merchant having only BTC - var invoice = acc.BitPay.CreateInvoice( - new Invoice() + var invoice = await acc.BitPay.CreateInvoiceAsync( + new Invoice { Price = 500, Currency = "USD", @@ -811,21 +811,22 @@ namespace BTCPayServer.Tests var cashCow = tester.ExplorerNode; var invoiceAddress = BitcoinAddress.Create(invoice.CryptoInfo[0].Address, cashCow.Network); var firstPayment = invoice.CryptoInfo[0].TotalDue - Money.Satoshis(10); - cashCow.SendToAddress(invoiceAddress, firstPayment); + await cashCow.SendToAddressAsync(invoiceAddress, firstPayment); TestUtils.Eventually(() => { invoice = acc.BitPay.GetInvoice(invoice.Id); Assert.Equal(firstPayment, invoice.CryptoInfo[0].Paid); }); - + AssertSearchInvoice(acc, true, invoice.Id, null); + AssertSearchInvoice(acc, true, invoice.Id, null, acc.StoreId); AssertSearchInvoice(acc, true, invoice.Id, $"storeid:{acc.StoreId}"); - AssertSearchInvoice(acc, false, invoice.Id, $"storeid:blah"); + AssertSearchInvoice(acc, false, invoice.Id, "storeid:doesnotexist"); AssertSearchInvoice(acc, true, invoice.Id, $"{invoice.Id}"); - AssertSearchInvoice(acc, true, invoice.Id, $"exceptionstatus:paidPartial"); - AssertSearchInvoice(acc, false, invoice.Id, $"exceptionstatus:paidOver"); - AssertSearchInvoice(acc, true, invoice.Id, $"unusual:true"); - AssertSearchInvoice(acc, false, invoice.Id, $"unusual:false"); + AssertSearchInvoice(acc, true, invoice.Id, "exceptionstatus:paidPartial"); + AssertSearchInvoice(acc, false, invoice.Id, "exceptionstatus:paidOver"); + AssertSearchInvoice(acc, true, invoice.Id, "unusual:true"); + AssertSearchInvoice(acc, false, invoice.Id, "unusual:false"); var time = invoice.InvoiceTime; AssertSearchInvoice(acc, true, invoice.Id, $"startdate:{time.ToString("yyyy-MM-dd HH:mm:ss")}"); @@ -929,11 +930,11 @@ namespace BTCPayServer.Tests } } - private void AssertSearchInvoice(TestAccount acc, bool expected, string invoiceId, string filter) + private void AssertSearchInvoice(TestAccount acc, bool expected, string invoiceId, string filter, string storeId = null) { var result = (InvoicesModel)((ViewResult)acc.GetController() - .ListInvoices(new InvoicesModel { SearchTerm = filter }).Result).Model; + .ListInvoices(new InvoicesModel { SearchTerm = filter, StoreId = storeId }).Result).Model; Assert.Equal(expected, result.Invoices.Any(i => i.InvoiceId == invoiceId)); } diff --git a/BTCPayServer/Components/MainNav/Default.cshtml b/BTCPayServer/Components/MainNav/Default.cshtml index ea809535f..ce4247570 100644 --- a/BTCPayServer/Components/MainNav/Default.cshtml +++ b/BTCPayServer/Components/MainNav/Default.cshtml @@ -23,59 +23,7 @@
@if (SignInManager.IsSignedIn(User)) { - @if (Model.Store == null) - { -
- - -
-
- - -
- } - else + @if (Model.Store != null) {
@@ -84,16 +32,16 @@ { var isSetUp = !string.IsNullOrWhiteSpace(scheme.Value);
+
+ + +
@@ -30,12 +28,11 @@ @section PageFootContent { } - diff --git a/BTCPayServer/Views/Manage/_ViewStart.cshtml b/BTCPayServer/Views/Manage/_ViewStart.cshtml index 42cd52b87..94b20c1c4 100644 --- a/BTCPayServer/Views/Manage/_ViewStart.cshtml +++ b/BTCPayServer/Views/Manage/_ViewStart.cshtml @@ -3,6 +3,5 @@ @using BTCPayServer.Views.Manage @{ Layout = "../Shared/_NavLayout.cshtml"; - ViewBag.CategoryTitle = "Account"; ViewData.SetActiveCategory(typeof(ManageNavPages)); } diff --git a/BTCPayServer/Views/MoneroLikeStore/GetStoreMoneroLikePaymentMethod.cshtml b/BTCPayServer/Views/MoneroLikeStore/GetStoreMoneroLikePaymentMethod.cshtml index 86c09cf89..90958a407 100644 --- a/BTCPayServer/Views/MoneroLikeStore/GetStoreMoneroLikePaymentMethod.cshtml +++ b/BTCPayServer/Views/MoneroLikeStore/GetStoreMoneroLikePaymentMethod.cshtml @@ -5,7 +5,7 @@ @{ Layout = "../Shared/_NavLayout.cshtml"; ViewData["NavPartialName"] = "../Stores/_Nav"; - ViewData.SetActivePage(StoreNavPages.ActivePage, $"{Model.CryptoCode} Settings"); + ViewData.SetActivePage(StoreNavPages.OnchainSettings, $"{Model.CryptoCode} Settings"); }
diff --git a/BTCPayServer/Views/MoneroLikeStore/GetStoreMoneroLikePaymentMethods.cshtml b/BTCPayServer/Views/MoneroLikeStore/GetStoreMoneroLikePaymentMethods.cshtml index ba9980326..984a4dc54 100644 --- a/BTCPayServer/Views/MoneroLikeStore/GetStoreMoneroLikePaymentMethods.cshtml +++ b/BTCPayServer/Views/MoneroLikeStore/GetStoreMoneroLikePaymentMethods.cshtml @@ -4,7 +4,7 @@ @{ Layout = "../Shared/_NavLayout.cshtml"; - ViewData.SetActivePage(StoreNavPages.ActivePage, "Monero Settings"); + ViewData.SetActivePage(StoreNavPages.OnchainSettings, "Monero Settings"); ViewData["NavPartialName"] = "../Stores/_Nav"; } diff --git a/BTCPayServer/Views/Notifications/StoreNavPages.cs b/BTCPayServer/Views/Notifications/NotificationsNavPages.cs similarity index 100% rename from BTCPayServer/Views/Notifications/StoreNavPages.cs rename to BTCPayServer/Views/Notifications/NotificationsNavPages.cs diff --git a/BTCPayServer/Views/PaymentRequest/EditPaymentRequest.cshtml b/BTCPayServer/Views/PaymentRequest/EditPaymentRequest.cshtml index 01ca1df60..7f0be284f 100644 --- a/BTCPayServer/Views/PaymentRequest/EditPaymentRequest.cshtml +++ b/BTCPayServer/Views/PaymentRequest/EditPaymentRequest.cshtml @@ -3,7 +3,7 @@ @model BTCPayServer.Models.PaymentRequestViewModels.UpdatePaymentRequestViewModel @addTagHelper *, BundlerMinifier.TagHelpers @{ - ViewData.SetActivePage(PaymentRequestsNavPages.Create, (string.IsNullOrEmpty(Model.Id) ? "Create" : "Edit") + " Payment Request"); + ViewData.SetActivePage(PaymentRequestsNavPages.Create, $"{(string.IsNullOrEmpty(Model.Id) ? "Create" : "Edit")} Payment Request", Model.Id); } @section PageHeadContent { diff --git a/BTCPayServer/Views/Server/ListPlugins.cshtml b/BTCPayServer/Views/Server/ListPlugins.cshtml index 8ccb204c8..4b42c3db9 100644 --- a/BTCPayServer/Views/Server/ListPlugins.cshtml +++ b/BTCPayServer/Views/Server/ListPlugins.cshtml @@ -3,6 +3,7 @@ @model BTCPayServer.Controllers.ServerController.ListPluginsViewModel @inject BTCPayServerOptions BTCPayServerOptions @{ + Layout = "_Layout"; ViewData.SetActivePage(ServerNavPages.Plugins); var installed = Model.Installed.ToDictionary(plugin => plugin.Identifier.ToLowerInvariant(), plugin => plugin.Version); var availableAndNotInstalled = Model.Available @@ -95,6 +96,9 @@ .version-switch .nav-link { display: inline; } .version-switch .nav-link.active { display: none; } + + + @if (Model.Disabled.Any()) {
diff --git a/BTCPayServer/Views/Server/_Nav.cshtml b/BTCPayServer/Views/Server/_Nav.cshtml index 2fc063f37..f6444dc34 100644 --- a/BTCPayServer/Views/Server/_Nav.cshtml +++ b/BTCPayServer/Views/Server/_Nav.cshtml @@ -13,6 +13,6 @@ } Logs Files - Plugins (experimental) + diff --git a/BTCPayServer/Views/Server/_ViewStart.cshtml b/BTCPayServer/Views/Server/_ViewStart.cshtml index 505b03774..b1d9a4560 100644 --- a/BTCPayServer/Views/Server/_ViewStart.cshtml +++ b/BTCPayServer/Views/Server/_ViewStart.cshtml @@ -3,6 +3,5 @@ @using BTCPayServer.Views.Server @{ Layout = "../Shared/_NavLayout.cshtml"; - ViewBag.CategoryTitle = "Server settings"; ViewData.SetActiveCategory(typeof(ServerNavPages)); } diff --git a/BTCPayServer/Views/Shared/LNURL/AdditionalPaymentMethodDetails.cshtml b/BTCPayServer/Views/Shared/LNURL/AdditionalPaymentMethodDetails.cshtml index d9bbf6791..c3a93c5fa 100644 --- a/BTCPayServer/Views/Shared/LNURL/AdditionalPaymentMethodDetails.cshtml +++ b/BTCPayServer/Views/Shared/LNURL/AdditionalPaymentMethodDetails.cshtml @@ -2,21 +2,17 @@ @if (!string.IsNullOrEmpty(Model.ProvidedComment)) { - - - - - LNURL Comment: @Model.ProvidedComment - - + + + LNURL Comment: @Model.ProvidedComment + + } @if (!string.IsNullOrEmpty(Model.ConsumedLightningAddress)) { - - - - - Lightning address used: @Model.ConsumedLightningAddress - - + + + Lightning address used: @Model.ConsumedLightningAddress + + } diff --git a/BTCPayServer/Views/Shared/LNURL/LightningAddressNav.cshtml b/BTCPayServer/Views/Shared/LNURL/LightningAddressNav.cshtml new file mode 100644 index 000000000..fb61eb58d --- /dev/null +++ b/BTCPayServer/Views/Shared/LNURL/LightningAddressNav.cshtml @@ -0,0 +1,23 @@ +@using BTCPayServer.Payments.Lightning +@using BTCPayServer.Views.Stores +@using BTCPayServer.Abstractions.Extensions +@inject BTCPayNetworkProvider BTCPayNetworkProvider +@{ + var store = Context.GetStoreData(); + var isLightningEnabled = store.IsLightningEnabled(BTCPayNetworkProvider); + var isLNUrlEnabled = store.IsLNUrlEnabled(BTCPayNetworkProvider); + var possible = + isLightningEnabled && + isLNUrlEnabled && + store.GetSupportedPaymentMethods(BTCPayNetworkProvider).OfType().Any(type => type.CryptoCode == "BTC"); +} + +@if (possible) +{ + +} diff --git a/BTCPayServer/Views/Shared/Shopify/StoreIntegrationShopifyOption.cshtml b/BTCPayServer/Views/Shared/Shopify/StoreIntegrationsList.cshtml similarity index 100% rename from BTCPayServer/Views/Shared/Shopify/StoreIntegrationShopifyOption.cshtml rename to BTCPayServer/Views/Shared/Shopify/StoreIntegrationsList.cshtml diff --git a/BTCPayServer/Views/Shared/Shopify/StoreIntegrationsNav.cshtml b/BTCPayServer/Views/Shared/Shopify/StoreIntegrationsNav.cshtml new file mode 100644 index 000000000..e98993657 --- /dev/null +++ b/BTCPayServer/Views/Shared/Shopify/StoreIntegrationsNav.cshtml @@ -0,0 +1,12 @@ +@using BTCPayServer.Views.Stores +@using BTCPayServer.Abstractions.Extensions +@{ + var store = Context.GetStoreData(); +} + + diff --git a/BTCPayServer/Views/Shared/_Confirm.cshtml b/BTCPayServer/Views/Shared/_Confirm.cshtml index ed67b0567..e37914d9e 100644 --- a/BTCPayServer/Views/Shared/_Confirm.cshtml +++ b/BTCPayServer/Views/Shared/_Confirm.cshtml @@ -28,6 +28,7 @@ $text.removeAttribute('hidden') $continue.setAttribute('disabled', 'disabled') $inputText.textContent = confirmInput + $input.setAttribute("autocomplete", "off"); $input.addEventListener('input', event => { event.target.value.trim() === confirmInput ? $continue.removeAttribute('disabled') diff --git a/BTCPayServer/Views/Shared/_LayoutSimple.cshtml b/BTCPayServer/Views/Shared/_LayoutSimple.cshtml index da37d5416..77086a972 100644 --- a/BTCPayServer/Views/Shared/_LayoutSimple.cshtml +++ b/BTCPayServer/Views/Shared/_LayoutSimple.cshtml @@ -9,7 +9,7 @@ @await RenderSectionAsync("PageHeadContent", false) -
+
diff --git a/BTCPayServer/Views/Shopify/EditShopifyIntegration.cshtml b/BTCPayServer/Views/Shopify/EditShopifyIntegration.cshtml index 21441196e..6ec3b60f8 100644 --- a/BTCPayServer/Views/Shopify/EditShopifyIntegration.cshtml +++ b/BTCPayServer/Views/Shopify/EditShopifyIntegration.cshtml @@ -2,23 +2,23 @@ @using BTCPayServer.Abstractions.Extensions @model BTCPayServer.Plugins.Shopify.Models.ShopifySettings @{ - Layout = "../Shared/_NavLayout.cshtml"; - - ViewData["NavPartialName"] = "../Stores/_Nav"; - ViewData.SetActivePage(StoreNavPages.Integrations, "Integrations"); - + ViewData.SetActivePage("shopify", nameof(StoreNavPages), "Shopify", Context.GetStoreData().Id); + var shopifyCredsSet = Model?.IntegratedAt.HasValue is true; var shopifyUrl = Model?.ShopifyUrl; } + + + +

+ @ViewData["Title"] + + + + + +

-

- Shopify - - - - - -

@if (!shopifyCredsSet) {

Create a Shopify Private App with the permissions "Orders - Read and write"

@@ -39,7 +39,7 @@ { https:// } - + @if (!Model?.ShopName?.Contains(".") is true) { @@ -51,13 +51,13 @@
- +
- +
@@ -65,7 +65,7 @@ In Shopify please paste following script at Settings > Checkout > Order Processing > Additional Scripts

- @($"") + @($"")

diff --git a/BTCPayServer/Views/StorePullPayments/NewPullPayment.cshtml b/BTCPayServer/Views/StorePullPayments/NewPullPayment.cshtml index 588c8a4d8..0cffae547 100644 --- a/BTCPayServer/Views/StorePullPayments/NewPullPayment.cshtml +++ b/BTCPayServer/Views/StorePullPayments/NewPullPayment.cshtml @@ -2,14 +2,14 @@ @using BTCPayServer.Views.Stores @model BTCPayServer.Models.WalletViewModels.NewPullPaymentModel @{ - ViewData.SetActivePage(StoreNavPages.PullPayments, "New pull payment", Context.GetStoreData().StoreName); + ViewData.SetActivePage(StoreNavPages.PullPayments, "New pull payment", Context.GetStoreData().Id); }

-

@ViewData["Title"]

+

@ViewData["Title"]

PayoutHandlers; @{ - ViewData.SetActivePage(StoreNavPages.Payouts, $"Payouts{(string.IsNullOrEmpty(Model.PullPaymentName) ? string.Empty : " for pull payment " + Model.PullPaymentName)}", Context.GetStoreData().StoreName); + ViewData.SetActivePage(StoreNavPages.Payouts, $"Payouts{(string.IsNullOrEmpty(Model.PullPaymentName) ? string.Empty : " for pull payment " + Model.PullPaymentName)}", Context.GetStoreData().Id); Model.PaginationQuery ??= new Dictionary(); Model.PaginationQuery.Add("pullPaymentId", Model.PullPaymentId); Model.PaginationQuery.Add("paymentMethodId", Model.PaymentMethodId); diff --git a/BTCPayServer/Views/StorePullPayments/PullPayments.cshtml b/BTCPayServer/Views/StorePullPayments/PullPayments.cshtml index 9944edb35..f879692bf 100644 --- a/BTCPayServer/Views/StorePullPayments/PullPayments.cshtml +++ b/BTCPayServer/Views/StorePullPayments/PullPayments.cshtml @@ -3,7 +3,7 @@ @using BTCPayServer.Client @model BTCPayServer.Models.WalletViewModels.PullPaymentsModel @{ - ViewData.SetActivePage(StoreNavPages.PullPayments, "Pull payments", Context.GetStoreData().StoreName); + ViewData.SetActivePage(StoreNavPages.PullPayments, "Pull payments", Context.GetStoreData().Id); var nextStartDateSortOrder = (string)ViewData["NextStartSortOrder"]; string startDateSortOrder = null; switch (nextStartDateSortOrder) diff --git a/BTCPayServer/Views/Stores/CheckoutAppearance.cshtml b/BTCPayServer/Views/Stores/CheckoutAppearance.cshtml index 4fdac9fdf..d1aaf24f5 100644 --- a/BTCPayServer/Views/Stores/CheckoutAppearance.cshtml +++ b/BTCPayServer/Views/Stores/CheckoutAppearance.cshtml @@ -2,7 +2,7 @@ @model CheckoutAppearanceViewModel @{ Layout = "../Shared/_NavLayout.cshtml"; - ViewData.SetActivePage(StoreNavPages.CheckoutAppearance, "Checkout experience", Context.GetStoreData().StoreName); + ViewData.SetActivePage(StoreNavPages.CheckoutAppearance, "Checkout experience", Context.GetStoreData().Id); }
diff --git a/BTCPayServer/Views/Stores/CreateToken.cshtml b/BTCPayServer/Views/Stores/CreateToken.cshtml index fb3a5aae3..77b121ea0 100644 --- a/BTCPayServer/Views/Stores/CreateToken.cshtml +++ b/BTCPayServer/Views/Stores/CreateToken.cshtml @@ -1,7 +1,7 @@ @model CreateTokenViewModel @{ Layout = "../Shared/_NavLayout.cshtml"; - ViewData.SetActivePage(StoreNavPages.Tokens, "Create New Token", Context.GetStoreData()?.StoreName); + ViewData.SetActivePage(StoreNavPages.Tokens, "Create New Token", Context.GetStoreData()?.Id); ViewBag.HidePublicKey = ViewBag.HidePublicKey ?? false; ViewBag.ShowStores = ViewBag.ShowStores ?? false; } diff --git a/BTCPayServer/Views/Stores/Emails.cshtml b/BTCPayServer/Views/Stores/Emails.cshtml index 6ef68f6e9..70ce7b4b0 100644 --- a/BTCPayServer/Views/Stores/Emails.cshtml +++ b/BTCPayServer/Views/Stores/Emails.cshtml @@ -1,7 +1,7 @@ @model BTCPayServer.Models.ServerViewModels.EmailsViewModel @{ Layout = "../Shared/_NavLayout.cshtml"; - ViewData.SetActivePage(StoreNavPages.GeneralSettings, "Email Settings", Context.GetStoreData().StoreName); + ViewData.SetActivePage(StoreNavPages.GeneralSettings, "Email Settings", Context.GetStoreData().Id); } diff --git a/BTCPayServer/Views/Stores/GeneralSettings.cshtml b/BTCPayServer/Views/Stores/GeneralSettings.cshtml index 463539791..333f9bfef 100644 --- a/BTCPayServer/Views/Stores/GeneralSettings.cshtml +++ b/BTCPayServer/Views/Stores/GeneralSettings.cshtml @@ -1,7 +1,7 @@ @model GeneralSettingsViewModel @{ Layout = "../Shared/_NavLayout.cshtml"; - ViewData.SetActivePage(StoreNavPages.GeneralSettings, "General Settings", Context.GetStoreData().StoreName); + ViewData.SetActivePage(StoreNavPages.GeneralSettings, "General Settings", Context.GetStoreData().Id); }
diff --git a/BTCPayServer/Views/Stores/GenerateWallet.cshtml b/BTCPayServer/Views/Stores/GenerateWallet.cshtml index 1995dd58b..a282552e3 100644 --- a/BTCPayServer/Views/Stores/GenerateWallet.cshtml +++ b/BTCPayServer/Views/Stores/GenerateWallet.cshtml @@ -4,7 +4,7 @@ var isHotWallet = Model.Method == WalletSetupMethod.HotWallet; var type = isHotWallet ? "Hot" : "Watch-Only"; Layout = "_LayoutWalletSetup"; - ViewData.SetActivePage(StoreNavPages.PaymentMethods, $"Create {Model.CryptoCode} {type} Wallet", Context.GetStoreData().StoreName); + ViewData.SetActivePage(StoreNavPages.OnchainSettings, $"Create {Model.CryptoCode} {type} Wallet", Context.GetStoreData().Id); ViewData.Add(nameof(Model.CanUseHotWallet), Model.CanUseHotWallet); ViewData.Add(nameof(Model.CanUseRPCImport), Model.CanUseRPCImport); ViewData.Add(nameof(Model.SupportSegwit), Model.SupportSegwit); diff --git a/BTCPayServer/Views/Stores/GenerateWalletOptions.cshtml b/BTCPayServer/Views/Stores/GenerateWalletOptions.cshtml index dfe21d74b..1f5d3a37a 100644 --- a/BTCPayServer/Views/Stores/GenerateWalletOptions.cshtml +++ b/BTCPayServer/Views/Stores/GenerateWalletOptions.cshtml @@ -2,7 +2,7 @@ @addTagHelper *, BundlerMinifier.TagHelpers @{ Layout = "_LayoutWalletSetup"; - ViewData.SetActivePage(StoreNavPages.PaymentMethods, $"Generate {Model.CryptoCode} Wallet", Context.GetStoreData().StoreName); + ViewData.SetActivePage(StoreNavPages.OnchainSettings, $"Generate {Model.CryptoCode} Wallet", Context.GetStoreData().Id); } @section Navbar { diff --git a/BTCPayServer/Views/Stores/ImportWallet/ConfirmAddresses.cshtml b/BTCPayServer/Views/Stores/ImportWallet/ConfirmAddresses.cshtml index 92c8286d9..479598105 100644 --- a/BTCPayServer/Views/Stores/ImportWallet/ConfirmAddresses.cshtml +++ b/BTCPayServer/Views/Stores/ImportWallet/ConfirmAddresses.cshtml @@ -2,7 +2,7 @@ @addTagHelper *, BundlerMinifier.TagHelpers @{ Layout = "_LayoutWalletSetup"; - ViewData.SetActivePage(StoreNavPages.PaymentMethods, "Confirm addresses", Context.GetStoreData().StoreName); + ViewData.SetActivePage(StoreNavPages.OnchainSettings, "Confirm addresses", Context.GetStoreData().Id); } @section Navbar { diff --git a/BTCPayServer/Views/Stores/ImportWallet/File.cshtml b/BTCPayServer/Views/Stores/ImportWallet/File.cshtml index 98381a7e1..d2639da9d 100644 --- a/BTCPayServer/Views/Stores/ImportWallet/File.cshtml +++ b/BTCPayServer/Views/Stores/ImportWallet/File.cshtml @@ -2,7 +2,7 @@ @addTagHelper *, BundlerMinifier.TagHelpers @{ Layout = "_LayoutWalletSetup"; - ViewData.SetActivePage(StoreNavPages.PaymentMethods, "Import your wallet file", Context.GetStoreData().StoreName); + ViewData.SetActivePage(StoreNavPages.OnchainSettings, "Import your wallet file", Context.GetStoreData().Id); } @section Navbar { diff --git a/BTCPayServer/Views/Stores/ImportWallet/Hardware.cshtml b/BTCPayServer/Views/Stores/ImportWallet/Hardware.cshtml index 9792a814e..e8a183323 100644 --- a/BTCPayServer/Views/Stores/ImportWallet/Hardware.cshtml +++ b/BTCPayServer/Views/Stores/ImportWallet/Hardware.cshtml @@ -2,7 +2,7 @@ @addTagHelper *, BundlerMinifier.TagHelpers @{ Layout = "_LayoutWalletSetup"; - ViewData.SetActivePage(StoreNavPages.PaymentMethods, "Connect your hardware wallet", Context.GetStoreData().StoreName); + ViewData.SetActivePage(StoreNavPages.OnchainSettings, "Connect your hardware wallet", Context.GetStoreData().Id); } @section Navbar { diff --git a/BTCPayServer/Views/Stores/ImportWallet/Scan.cshtml b/BTCPayServer/Views/Stores/ImportWallet/Scan.cshtml index 5cdaefe6a..b5c516020 100644 --- a/BTCPayServer/Views/Stores/ImportWallet/Scan.cshtml +++ b/BTCPayServer/Views/Stores/ImportWallet/Scan.cshtml @@ -2,7 +2,7 @@ @addTagHelper *, BundlerMinifier.TagHelpers @{ Layout = "_LayoutWalletSetup"; - ViewData.SetActivePage(StoreNavPages.PaymentMethods, "Scan QR code", Context.GetStoreData().StoreName); + ViewData.SetActivePage(StoreNavPages.OnchainSettings, "Scan QR code", Context.GetStoreData().Id); } @section Navbar { diff --git a/BTCPayServer/Views/Stores/ImportWallet/Seed.cshtml b/BTCPayServer/Views/Stores/ImportWallet/Seed.cshtml index 11948f5e4..d071eab8b 100644 --- a/BTCPayServer/Views/Stores/ImportWallet/Seed.cshtml +++ b/BTCPayServer/Views/Stores/ImportWallet/Seed.cshtml @@ -2,7 +2,7 @@ @addTagHelper *, BundlerMinifier.TagHelpers @{ Layout = "_LayoutWalletSetup"; - ViewData.SetActivePage(StoreNavPages.PaymentMethods, "Enter the wallet seed", Context.GetStoreData().StoreName); + ViewData.SetActivePage(StoreNavPages.OnchainSettings, "Enter the wallet seed", Context.GetStoreData().Id); } @section Navbar { diff --git a/BTCPayServer/Views/Stores/ImportWallet/Xpub.cshtml b/BTCPayServer/Views/Stores/ImportWallet/Xpub.cshtml index 96a132ce9..a7df081c0 100644 --- a/BTCPayServer/Views/Stores/ImportWallet/Xpub.cshtml +++ b/BTCPayServer/Views/Stores/ImportWallet/Xpub.cshtml @@ -2,7 +2,7 @@ @addTagHelper *, BundlerMinifier.TagHelpers @{ Layout = "_LayoutWalletSetup"; - ViewData.SetActivePage(StoreNavPages.PaymentMethods, "Enter your extended public key", Context.GetStoreData().StoreName); + ViewData.SetActivePage(StoreNavPages.OnchainSettings, "Enter your extended public key", Context.GetStoreData().Id); } @section Navbar { diff --git a/BTCPayServer/Views/Stores/ImportWalletOptions.cshtml b/BTCPayServer/Views/Stores/ImportWalletOptions.cshtml index 4dfb9d3d8..24a492567 100644 --- a/BTCPayServer/Views/Stores/ImportWalletOptions.cshtml +++ b/BTCPayServer/Views/Stores/ImportWalletOptions.cshtml @@ -3,7 +3,7 @@ @addTagHelper *, BundlerMinifier.TagHelpers @{ Layout = "_LayoutWalletSetup"; - ViewData.SetActivePage(StoreNavPages.PaymentMethods, $"Import {Model.CryptoCode} Wallet", Context.GetStoreData().StoreName); + ViewData.SetActivePage(StoreNavPages.OnchainSettings, $"Import {Model.CryptoCode} Wallet", Context.GetStoreData().Id); } @section Navbar { diff --git a/BTCPayServer/Views/Stores/Integrations.cshtml b/BTCPayServer/Views/Stores/Integrations.cshtml index a70073726..49d0d4878 100644 --- a/BTCPayServer/Views/Stores/Integrations.cshtml +++ b/BTCPayServer/Views/Stores/Integrations.cshtml @@ -1,7 +1,7 @@ @model IntegrationsViewModel @{ Layout = "../Shared/_NavLayout.cshtml"; - ViewData.SetActivePage(StoreNavPages.Integrations, "Integrations", Context.GetStoreData().StoreName); + ViewData.SetActivePage(StoreNavPages.Integrations, "Integrations", Context.GetStoreData().Id); }
@@ -12,7 +12,7 @@ }
    - +

Other Integrations

diff --git a/BTCPayServer/Views/Stores/LightningSettings.cshtml b/BTCPayServer/Views/Stores/LightningSettings.cshtml index e26c17735..750fb4b48 100644 --- a/BTCPayServer/Views/Stores/LightningSettings.cshtml +++ b/BTCPayServer/Views/Stores/LightningSettings.cshtml @@ -2,7 +2,7 @@ @model LightningSettingsViewModel @{ Layout = "../Shared/_NavLayout.cshtml"; - ViewData.SetActivePage(StoreNavPages.PaymentMethods, $"{Model.CryptoCode} Lightning Settings", Context.GetStoreData().StoreName); + ViewData.SetActivePage(StoreNavPages.LightningSettings, $"{Model.CryptoCode} Lightning Settings", Context.GetStoreData().Id); }
diff --git a/BTCPayServer/Views/Stores/ListTokens.cshtml b/BTCPayServer/Views/Stores/ListTokens.cshtml index 733c8aea0..602d8a155 100644 --- a/BTCPayServer/Views/Stores/ListTokens.cshtml +++ b/BTCPayServer/Views/Stores/ListTokens.cshtml @@ -1,7 +1,7 @@ @model TokensViewModel @{ Layout = "../Shared/_NavLayout.cshtml"; - ViewData.SetActivePage(StoreNavPages.Tokens, "Access Tokens", Context.GetStoreData().StoreName); + ViewData.SetActivePage(StoreNavPages.Tokens, "Access Tokens", Context.GetStoreData().Id); } @if (Model.StoreNotConfigured) diff --git a/BTCPayServer/Views/Stores/ModifyWebhook.cshtml b/BTCPayServer/Views/Stores/ModifyWebhook.cshtml index f06c39219..5cbcb54b1 100644 --- a/BTCPayServer/Views/Stores/ModifyWebhook.cshtml +++ b/BTCPayServer/Views/Stores/ModifyWebhook.cshtml @@ -2,7 +2,7 @@ @using BTCPayServer.Client.Models; @{ Layout = "../Shared/_NavLayout.cshtml"; - ViewData.SetActivePage(StoreNavPages.Webhooks, "Webhook Settings", Context.GetStoreData().StoreName); + ViewData.SetActivePage(StoreNavPages.Webhooks, "Webhook Settings", Context.GetStoreData().Id); } @section PageHeadContent { diff --git a/BTCPayServer/Views/Stores/PayButton.cshtml b/BTCPayServer/Views/Stores/PayButton.cshtml index e6605857f..f17f3f2c4 100644 --- a/BTCPayServer/Views/Stores/PayButton.cshtml +++ b/BTCPayServer/Views/Stores/PayButton.cshtml @@ -1,8 +1,7 @@ @inject BTCPayServer.Security.ContentSecurityPolicies csp @model PayButtonViewModel @{ - Layout = "../Shared/_NavLayout.cshtml"; - ViewData.SetActivePage(StoreNavPages.PayButton, "Pay Button", Context.GetStoreData().StoreName); + ViewData.SetActivePage(StoreNavPages.PayButton, "Pay Button", Context.GetStoreData().Id); csp.AllowUnsafeHashes("onBTCPayFormSubmit(event);return false"); } @@ -69,10 +68,13 @@ } + + +

@ViewData["Title"]

+
-

@ViewData["Title"]

Configure your Pay Button, and the generated code will be displayed at the bottom of the page to copy into your project.

General Settings

diff --git a/BTCPayServer/Views/Stores/PayButtonEnable.cshtml b/BTCPayServer/Views/Stores/PayButtonEnable.cshtml index 44ad990a2..80f2cfc36 100644 --- a/BTCPayServer/Views/Stores/PayButtonEnable.cshtml +++ b/BTCPayServer/Views/Stores/PayButtonEnable.cshtml @@ -1,11 +1,11 @@ @{ - Layout = "../Shared/_NavLayout.cshtml"; - ViewData.SetActivePage(StoreNavPages.PayButton, "Pay Button", Context.GetStoreData().StoreName); + ViewData.SetActivePage(StoreNavPages.PayButton, "Pay Button", Context.GetStoreData().Id); } +

@ViewData["Title"]

+
-

@ViewData["Title"]

To start using Pay Button, you need to enable this feature explicitly. Once you do so, anyone could create an invoice on your store (via API, for example). diff --git a/BTCPayServer/Views/Stores/PaymentMethods.cshtml b/BTCPayServer/Views/Stores/PaymentMethods.cshtml index 2fa8dc26d..c804c0211 100644 --- a/BTCPayServer/Views/Stores/PaymentMethods.cshtml +++ b/BTCPayServer/Views/Stores/PaymentMethods.cshtml @@ -1,10 +1,9 @@ @using System.Text.RegularExpressions @using BTCPayServer.Lightning -@using BTCPayServer.Services @model PaymentMethodsViewModel @{ Layout = "../Shared/_NavLayout.cshtml"; - ViewData.SetActivePage(StoreNavPages.PaymentMethods, "Wallets", Context.GetStoreData().StoreName); + ViewData.SetActivePage(StoreNavPages.PaymentMethods, "Wallets", Context.GetStoreData().Id); }

diff --git a/BTCPayServer/Views/Stores/Rates.cshtml b/BTCPayServer/Views/Stores/Rates.cshtml index 085a91ae9..a7421b7cf 100644 --- a/BTCPayServer/Views/Stores/Rates.cshtml +++ b/BTCPayServer/Views/Stores/Rates.cshtml @@ -1,7 +1,7 @@ @model BTCPayServer.Models.StoreViewModels.RatesViewModel @{ Layout = "../Shared/_NavLayout.cshtml"; - ViewData.SetActivePage(StoreNavPages.Rates, "Rates", Context.GetStoreData().StoreName); + ViewData.SetActivePage(StoreNavPages.Rates, "Rates", Context.GetStoreData().Id); }
diff --git a/BTCPayServer/Views/Stores/RequestPairing.cshtml b/BTCPayServer/Views/Stores/RequestPairing.cshtml index 96e118c88..fb0cd878b 100644 --- a/BTCPayServer/Views/Stores/RequestPairing.cshtml +++ b/BTCPayServer/Views/Stores/RequestPairing.cshtml @@ -1,7 +1,7 @@ @model PairingModel @{ Layout = "../Shared/_NavLayout.cshtml"; - ViewData.SetActivePage(StoreNavPages.Tokens, "Pairing Permission", Context.GetStoreData()?.StoreName); + ViewData.SetActivePage(StoreNavPages.Tokens, "Pairing Permission", Context.GetStoreData()?.Id); }

@ViewData["Title"]

diff --git a/BTCPayServer/Views/Stores/SetupLightningNode.cshtml b/BTCPayServer/Views/Stores/SetupLightningNode.cshtml index 9f230d8db..cf0188a7b 100644 --- a/BTCPayServer/Views/Stores/SetupLightningNode.cshtml +++ b/BTCPayServer/Views/Stores/SetupLightningNode.cshtml @@ -1,7 +1,7 @@ @model LightningNodeViewModel @{ Layout = "_LayoutWalletSetup.cshtml"; - ViewData.SetActivePage(StoreNavPages.PaymentMethods, "Connect to a Lightning node", Context.GetStoreData().StoreName); + ViewData.SetActivePage(StoreNavPages.LightningSettings, "Connect to a Lightning node", Context.GetStoreData().Id); }
diff --git a/BTCPayServer/Views/Stores/SetupWallet.cshtml b/BTCPayServer/Views/Stores/SetupWallet.cshtml index 35d74ec26..b73190545 100644 --- a/BTCPayServer/Views/Stores/SetupWallet.cshtml +++ b/BTCPayServer/Views/Stores/SetupWallet.cshtml @@ -1,7 +1,7 @@ @model WalletSetupViewModel @{ Layout = "_LayoutWalletSetup"; - ViewData.SetActivePage(StoreNavPages.PaymentMethods, $"Setup {Model.CryptoCode} Wallet", Context.GetStoreData().StoreName); + ViewData.SetActivePage(StoreNavPages.OnchainSettings, $"Setup {Model.CryptoCode} Wallet", Context.GetStoreData().Id); }

Let's get started

diff --git a/BTCPayServer/Views/Stores/ShowToken.cshtml b/BTCPayServer/Views/Stores/ShowToken.cshtml index c2b7e14ce..175561868 100644 --- a/BTCPayServer/Views/Stores/ShowToken.cshtml +++ b/BTCPayServer/Views/Stores/ShowToken.cshtml @@ -1,7 +1,7 @@ @model BTCPayServer.Security.Bitpay.BitTokenEntity @{ Layout = "../Shared/_NavLayout.cshtml"; - ViewData.SetActivePage(StoreNavPages.Tokens, "Access Tokens", Context.GetStoreData().StoreName); + ViewData.SetActivePage(StoreNavPages.Tokens, "Access Tokens", Context.GetStoreData().Id); }

@ViewData["Title"]

diff --git a/BTCPayServer/Views/Stores/StoreNavPages.cs b/BTCPayServer/Views/Stores/StoreNavPages.cs index a8a10cfa9..ff966798d 100644 --- a/BTCPayServer/Views/Stores/StoreNavPages.cs +++ b/BTCPayServer/Views/Stores/StoreNavPages.cs @@ -2,6 +2,6 @@ namespace BTCPayServer.Views.Stores { public enum StoreNavPages { - Index, Create, Rates, PaymentMethods, CheckoutAppearance, GeneralSettings, Tokens, Users, PayButton, Integrations, Webhooks, ActivePage, PullPayments, Payouts + Index, Create, Rates, PaymentMethods, OnchainSettings, LightningSettings, CheckoutAppearance, GeneralSettings, Tokens, Users, PayButton, Integrations, Webhooks, PullPayments, Payouts } } diff --git a/BTCPayServer/Views/Stores/StoreUsers.cshtml b/BTCPayServer/Views/Stores/StoreUsers.cshtml index ea982bed1..e912e4016 100644 --- a/BTCPayServer/Views/Stores/StoreUsers.cshtml +++ b/BTCPayServer/Views/Stores/StoreUsers.cshtml @@ -1,7 +1,7 @@ @model StoreUsersViewModel @{ Layout = "../Shared/_NavLayout.cshtml"; - ViewData.SetActivePage(StoreNavPages.Users, "Store Users", Context.GetStoreData().StoreName); + ViewData.SetActivePage(StoreNavPages.Users, "Store Users", Context.GetStoreData().Id); }
diff --git a/BTCPayServer/Views/Stores/TestWebhook.cshtml b/BTCPayServer/Views/Stores/TestWebhook.cshtml index 62362eb59..4a988f62c 100644 --- a/BTCPayServer/Views/Stores/TestWebhook.cshtml +++ b/BTCPayServer/Views/Stores/TestWebhook.cshtml @@ -2,7 +2,7 @@ @using BTCPayServer.Client.Models; @{ Layout = "../Shared/_NavLayout.cshtml"; - ViewData.SetActivePage(StoreNavPages.Webhooks, "Send a test event to a webhook endpoint", Context.GetStoreData().StoreName); + ViewData.SetActivePage(StoreNavPages.Webhooks, "Send a test event to a webhook endpoint", Context.GetStoreData().Id); }
diff --git a/BTCPayServer/Views/Stores/WalletSettings.cshtml b/BTCPayServer/Views/Stores/WalletSettings.cshtml index 8662bb7d3..d09bab316 100644 --- a/BTCPayServer/Views/Stores/WalletSettings.cshtml +++ b/BTCPayServer/Views/Stores/WalletSettings.cshtml @@ -4,7 +4,8 @@ @model WalletSettingsViewModel @{ Layout = "../Shared/_NavLayout.cshtml"; - ViewData.SetActivePage(StoreNavPages.PaymentMethods, $"{Model.CryptoCode} Wallet Settings", Context.GetStoreData().StoreName); + ViewData["NavPartialName"] = "../Wallets/_Nav"; + ViewData.SetActivePage(StoreNavPages.OnchainSettings, $"{Model.CryptoCode} Wallet Settings", Context.GetStoreData().Id); } @section PageHeadContent { diff --git a/BTCPayServer/Views/Stores/Webhooks.cshtml b/BTCPayServer/Views/Stores/Webhooks.cshtml index 8655fc6db..238768ecc 100644 --- a/BTCPayServer/Views/Stores/Webhooks.cshtml +++ b/BTCPayServer/Views/Stores/Webhooks.cshtml @@ -1,7 +1,7 @@ @model WebhooksViewModel @{ Layout = "../Shared/_NavLayout.cshtml"; - ViewData.SetActivePage(StoreNavPages.Webhooks, "Webhooks", Context.GetStoreData().StoreName); + ViewData.SetActivePage(StoreNavPages.Webhooks, "Webhooks", Context.GetStoreData().Id); }
diff --git a/BTCPayServer/Views/Stores/_Nav.cshtml b/BTCPayServer/Views/Stores/_Nav.cshtml index 42028e82f..c172f872e 100644 --- a/BTCPayServer/Views/Stores/_Nav.cshtml +++ b/BTCPayServer/Views/Stores/_Nav.cshtml @@ -6,7 +6,6 @@ General Settings Access Tokens Users - Pay Button Integrations Webhooks diff --git a/BTCPayServer/Views/Stores/_ViewStart.cshtml b/BTCPayServer/Views/Stores/_ViewStart.cshtml index f351ba3be..f1d4cfab1 100644 --- a/BTCPayServer/Views/Stores/_ViewStart.cshtml +++ b/BTCPayServer/Views/Stores/_ViewStart.cshtml @@ -3,6 +3,5 @@ @using BTCPayServer.Views.Stores @{ - ViewBag.CategoryTitle = "Stores"; ViewData.SetActiveCategory(typeof(StoreNavPages)); } diff --git a/BTCPayServer/Views/UserStores/ListStores.cshtml b/BTCPayServer/Views/UserStores/ListStores.cshtml index e33dd38f8..1e6edd8b7 100644 --- a/BTCPayServer/Views/UserStores/ListStores.cshtml +++ b/BTCPayServer/Views/UserStores/ListStores.cshtml @@ -69,13 +69,13 @@ } - Invoices - + Invoices - Pull Payments @if (store.IsOwner) { - Settings - - Delete - + Delete } diff --git a/BTCPayServer/Views/Wallets/SignWithSeed.cshtml b/BTCPayServer/Views/Wallets/SignWithSeed.cshtml index 7d5b7fb76..eef167690 100644 --- a/BTCPayServer/Views/Wallets/SignWithSeed.cshtml +++ b/BTCPayServer/Views/Wallets/SignWithSeed.cshtml @@ -1,14 +1,15 @@ @model SignWithSeedViewModel @{ + var walletId = Context.GetRouteValue("walletId").ToString(); Layout = "_LayoutWizard"; - ViewData.SetActivePage(WalletsNavPages.Send, "Sign PSBT", Context.GetStoreData().StoreName); + ViewData.SetActivePage(WalletsNavPages.Send, "Sign PSBT", walletId); } @section Navbar { - + - + } @@ -39,7 +40,7 @@
- +
diff --git a/BTCPayServer/Views/Wallets/WalletPSBT.cshtml b/BTCPayServer/Views/Wallets/WalletPSBT.cshtml index 2dd0d7302..b9ea09898 100644 --- a/BTCPayServer/Views/Wallets/WalletPSBT.cshtml +++ b/BTCPayServer/Views/Wallets/WalletPSBT.cshtml @@ -1,8 +1,9 @@ @model WalletPSBTViewModel @addTagHelper *, BundlerMinifier.TagHelpers @{ + var walletId = Context.GetRouteValue("walletId").ToString(); Layout = "../Shared/_NavLayout.cshtml"; - ViewData.SetActivePage(WalletsNavPages.PSBT, "Decode PSBT", Context.GetStoreData().StoreName); + ViewData.SetActivePage(WalletsNavPages.PSBT, "Decode PSBT", walletId); } @section PageHeadContent { @@ -41,7 +42,7 @@ }

You can decode a PSBT by either pasting its content, uploading the file or scanning the wallet QR code.

- +
diff --git a/BTCPayServer/Views/Wallets/WalletPSBTCombine.cshtml b/BTCPayServer/Views/Wallets/WalletPSBTCombine.cshtml index 9d29614d6..a307a92a5 100644 --- a/BTCPayServer/Views/Wallets/WalletPSBTCombine.cshtml +++ b/BTCPayServer/Views/Wallets/WalletPSBTCombine.cshtml @@ -1,7 +1,8 @@ @model WalletPSBTCombineViewModel @{ + var walletId = Context.GetRouteValue("walletId").ToString(); Layout = "_LayoutWizard"; - ViewData.SetActivePage(WalletsNavPages.PSBT, "Combine PSBT", Context.GetStoreData().StoreName); + ViewData.SetActivePage(WalletsNavPages.PSBT, "Combine PSBT", walletId); } @section Navbar { diff --git a/BTCPayServer/Views/Wallets/WalletPSBTDecoded.cshtml b/BTCPayServer/Views/Wallets/WalletPSBTDecoded.cshtml index efd5d4fff..ccfdb36ab 100644 --- a/BTCPayServer/Views/Wallets/WalletPSBTDecoded.cshtml +++ b/BTCPayServer/Views/Wallets/WalletPSBTDecoded.cshtml @@ -1,11 +1,12 @@ @model WalletPSBTViewModel @addTagHelper *, BundlerMinifier.TagHelpers @{ + var walletId = Context.GetRouteValue("walletId").ToString(); var isReady = !Model.HasErrors; var isSignable = !isReady && Model.NBXSeedAvailable; var needsExport = !isSignable && !isReady; Layout = "_LayoutWizard"; - ViewData.SetActivePage(WalletsNavPages.PSBT, isReady ? "Confirm broadcasting this transaction" : "Transaction Details", Context.GetStoreData().StoreName); + ViewData.SetActivePage(WalletsNavPages.PSBT, isReady ? "Confirm broadcasting this transaction" : "Transaction Details", walletId); } @section PageHeadContent { @@ -49,7 +50,7 @@ @if (isSignable) { - + @@ -61,7 +62,7 @@ } else if (isReady) { - + @@ -97,7 +98,7 @@ else
- +
@@ -146,7 +147,7 @@ else
- +
@@ -173,7 +174,7 @@ else
- + diff --git a/BTCPayServer/Views/Wallets/WalletReceive.cshtml b/BTCPayServer/Views/Wallets/WalletReceive.cshtml index 57f837595..932ce6825 100644 --- a/BTCPayServer/Views/Wallets/WalletReceive.cshtml +++ b/BTCPayServer/Views/Wallets/WalletReceive.cshtml @@ -1,8 +1,9 @@ @addTagHelper *, BundlerMinifier.TagHelpers @model BTCPayServer.Controllers.WalletReceiveViewModel @{ + var walletId = Context.GetRouteValue("walletId").ToString(); Layout = "../Shared/_NavLayout.cshtml"; - ViewData.SetActivePage(WalletsNavPages.Receive, $"Receive {Model.CryptoCode}", Context.GetStoreData().StoreName); + ViewData.SetActivePage(WalletsNavPages.Receive, $"Receive {Model.CryptoCode}", walletId); } @section PageHeadContent diff --git a/BTCPayServer/Views/Wallets/WalletRescan.cshtml b/BTCPayServer/Views/Wallets/WalletRescan.cshtml index 5e46b70c9..69508e560 100644 --- a/BTCPayServer/Views/Wallets/WalletRescan.cshtml +++ b/BTCPayServer/Views/Wallets/WalletRescan.cshtml @@ -1,7 +1,8 @@ @model RescanWalletModel @{ + var walletId = Context.GetRouteValue("walletId").ToString(); Layout = "../Shared/_NavLayout.cshtml"; - ViewData.SetActivePage(WalletsNavPages.Rescan, "Rescan wallet", Context.GetStoreData().StoreName); + ViewData.SetActivePage(WalletsNavPages.Rescan, "Rescan wallet", walletId); }

@ViewData["Title"]

diff --git a/BTCPayServer/Views/Wallets/WalletSend.cshtml b/BTCPayServer/Views/Wallets/WalletSend.cshtml index cbbc45cc2..ec1910d9f 100644 --- a/BTCPayServer/Views/Wallets/WalletSend.cshtml +++ b/BTCPayServer/Views/Wallets/WalletSend.cshtml @@ -3,8 +3,9 @@ @using Microsoft.AspNetCore.Mvc.ModelBinding @model WalletSendModel @{ + var walletId = Context.GetRouteValue("walletId").ToString(); Layout = "../Shared/_NavLayout.cshtml"; - ViewData.SetActivePage(WalletsNavPages.Send, $"Send {Model.CryptoCode}", Context.GetStoreData().StoreName); + ViewData.SetActivePage(WalletsNavPages.Send, $"Send {Model.CryptoCode}", walletId); csp.Add("worker-src", "blob:"); } @@ -30,7 +31,7 @@

@ViewData["Title"]

- + diff --git a/BTCPayServer/Views/Wallets/WalletSendVault.cshtml b/BTCPayServer/Views/Wallets/WalletSendVault.cshtml index e09401b94..6c0fb0c41 100644 --- a/BTCPayServer/Views/Wallets/WalletSendVault.cshtml +++ b/BTCPayServer/Views/Wallets/WalletSendVault.cshtml @@ -1,14 +1,15 @@ @model WalletSendVaultModel @{ + var walletId = Context.GetRouteValue("walletId").ToString(); Layout = "_LayoutWizard"; - ViewData.SetActivePage(WalletsNavPages.Send, "Sign the transaction", Context.GetStoreData().StoreName); + ViewData.SetActivePage(WalletsNavPages.Send, "Sign the transaction", walletId); } @section Navbar { - + - + } @@ -26,7 +27,7 @@
- + diff --git a/BTCPayServer/Views/Wallets/WalletSigningOptions.cshtml b/BTCPayServer/Views/Wallets/WalletSigningOptions.cshtml index e1442a3d1..32c3b4852 100644 --- a/BTCPayServer/Views/Wallets/WalletSigningOptions.cshtml +++ b/BTCPayServer/Views/Wallets/WalletSigningOptions.cshtml @@ -2,9 +2,9 @@ @inject BTCPayNetworkProvider BTCPayNetworkProvider @addTagHelper *, BundlerMinifier.TagHelpers @{ - Layout = "_LayoutWizard"; - ViewData.SetActivePage(WalletsNavPages.Send, "Sign the transaction", Context.GetStoreData().StoreName); var walletId = WalletId.Parse(Context.GetRouteValue("walletId").ToString()); + Layout = "_LayoutWizard"; + ViewData.SetActivePage(WalletsNavPages.Send, "Sign the transaction", walletId.ToString()); } @section Navbar { diff --git a/BTCPayServer/Views/Wallets/WalletTransactions.cshtml b/BTCPayServer/Views/Wallets/WalletTransactions.cshtml index da4343a7c..0b134529f 100644 --- a/BTCPayServer/Views/Wallets/WalletTransactions.cshtml +++ b/BTCPayServer/Views/Wallets/WalletTransactions.cshtml @@ -1,7 +1,8 @@ @model ListTransactionsViewModel @{ + var walletId = Context.GetRouteValue("walletId").ToString(); Layout = "../Shared/_NavLayout.cshtml"; - ViewData.SetActivePage(WalletsNavPages.Transactions, $"{Model.CryptoCode} Transactions", Context.GetStoreData().StoreName); + ViewData.SetActivePage(WalletsNavPages.Transactions, $"{Model.CryptoCode} Transactions", walletId); } @section PageHeadContent { diff --git a/BTCPayServer/Views/Wallets/WalletsNavPages.cs b/BTCPayServer/Views/Wallets/WalletsNavPages.cs index 25f83d116..5b56ed7ba 100644 --- a/BTCPayServer/Views/Wallets/WalletsNavPages.cs +++ b/BTCPayServer/Views/Wallets/WalletsNavPages.cs @@ -7,6 +7,7 @@ namespace BTCPayServer.Views.Wallets Transactions, Rescan, PSBT, - Receive + Receive, + Settings } } diff --git a/BTCPayServer/Views/Wallets/_Nav.cshtml b/BTCPayServer/Views/Wallets/_Nav.cshtml index 82b86400a..cdac2d069 100644 --- a/BTCPayServer/Views/Wallets/_Nav.cshtml +++ b/BTCPayServer/Views/Wallets/_Nav.cshtml @@ -1,20 +1,25 @@ -@inject SignInManager SignInManager -@inject BTCPayNetworkProvider BtcPayNetworkProvider +@using BTCPayServer.Views.Stores +@using BTCPayServer.Client +@inject BTCPayNetworkProvider _btcPayNetworkProvider @{ - var wallet = WalletId.Parse(Context.GetRouteValue("walletId").ToString()); - var network = BtcPayNetworkProvider.GetNetwork(wallet.CryptoCode); + var walletId = Context.GetRouteValue("walletId")?.ToString(); + var storeId = Context.GetRouteValue("storeId")?.ToString(); + var cryptoCode = Context.GetRouteValue("cryptoCode")?.ToString(); + var wallet = walletId != null ? WalletId.Parse(walletId) : new WalletId(storeId, cryptoCode); + var network = _btcPayNetworkProvider.GetNetwork(wallet.CryptoCode); } diff --git a/BTCPayServer/Views/Wallets/_ViewStart.cshtml b/BTCPayServer/Views/Wallets/_ViewStart.cshtml index 7618401c4..c24143a1e 100644 --- a/BTCPayServer/Views/Wallets/_ViewStart.cshtml +++ b/BTCPayServer/Views/Wallets/_ViewStart.cshtml @@ -2,6 +2,5 @@ @using BTCPayServer.Views @using BTCPayServer.Views.Wallets @{ - ViewBag.CategoryTitle = "Wallets"; ViewData.SetActiveCategory(typeof(WalletsNavPages)); } diff --git a/BTCPayServer/wwwroot/img/icon-sprite.svg b/BTCPayServer/wwwroot/img/icon-sprite.svg index d19ecb236..eb0cee809 100644 --- a/BTCPayServer/wwwroot/img/icon-sprite.svg +++ b/BTCPayServer/wwwroot/img/icon-sprite.svg @@ -29,4 +29,5 @@ + diff --git a/BTCPayServer/wwwroot/main/layout.css b/BTCPayServer/wwwroot/main/layout.css index c1abf6e0b..ad44070d9 100644 --- a/BTCPayServer/wwwroot/main/layout.css +++ b/BTCPayServer/wwwroot/main/layout.css @@ -8,9 +8,7 @@ :root { --mobile-header-height: 4rem; --desktop-header-height: 8rem; - --sidebar-width: 15%; - --sidebar-min-width: 250px; - --sidebar-max-width: 350px; + --sidebar-width: 280px; } /* Main Menu */ @@ -278,8 +276,6 @@ bottom: 0; left: 0; width: var(--sidebar-width); - min-width: var(--sidebar-min-width); - max-width: var(--sidebar-max-width); z-index: 1045; color: var(--btcpay-body-text); visibility: hidden; @@ -381,8 +377,6 @@ bottom: 0; left: 0; width: var(--sidebar-width); - min-width: var(--sidebar-min-width); - max-width: var(--sidebar-max-width); height: 100vh; } @@ -412,7 +406,7 @@ } #mainContent { - margin-left: clamp(var(--sidebar-min-width), var(--sidebar-width), var(--sidebar-max-width)); + margin-left: var(--sidebar-width); } #mainContent > section {