diff --git a/BTCPayServer/Components/UiExtensionPoint/Default.cshtml b/BTCPayServer/Components/UiExtensionPoint/Default.cshtml index 9f9e5d8df..bfb348d5f 100644 --- a/BTCPayServer/Components/UiExtensionPoint/Default.cshtml +++ b/BTCPayServer/Components/UiExtensionPoint/Default.cshtml @@ -1,6 +1,6 @@ -@model IEnumerable +@model BTCPayServer.Components.UIExtensionPoint.UiExtensionPointViewModel -@foreach (var partial in Model) +@foreach (var partial in Model.Partials) { - await Html.RenderPartialAsync(partial); + await Html.RenderPartialAsync(partial, Model.Model); } diff --git a/BTCPayServer/Components/UiExtensionPoint/UIExtensionPoint.cs b/BTCPayServer/Components/UiExtensionPoint/UIExtensionPoint.cs index 75fc2a9e8..7925758c5 100644 --- a/BTCPayServer/Components/UiExtensionPoint/UIExtensionPoint.cs +++ b/BTCPayServer/Components/UiExtensionPoint/UIExtensionPoint.cs @@ -15,9 +15,22 @@ namespace BTCPayServer.Components.UIExtensionPoint _uiExtensions = uiExtensions; } - public IViewComponentResult Invoke(string location) + public IViewComponentResult Invoke(string location, object model) { - return View(_uiExtensions.Where(extension => extension.Location.Equals(location, StringComparison.InvariantCultureIgnoreCase)).Select(extension => extension.Partial)); + return View(new UiExtensionPointViewModel() + { + Partials = _uiExtensions + .Where(extension => + extension.Location.Equals(location, StringComparison.InvariantCultureIgnoreCase)) + .Select(extension => extension.Partial).ToArray(), + Model = model + }); } } + + public class UiExtensionPointViewModel + { + public string[] Partials { get; set; } + public object Model { get; set; } + } } diff --git a/BTCPayServer/Views/Invoice/Checkout.cshtml b/BTCPayServer/Views/Invoice/Checkout.cshtml index 5e01e1115..8b21dc9c4 100644 --- a/BTCPayServer/Views/Invoice/Checkout.cshtml +++ b/BTCPayServer/Views/Invoice/Checkout.cshtml @@ -374,6 +374,6 @@ { } -@await Component.InvokeAsync("UiExtensionPoint" , new { location="checkout-end"}) +@await Component.InvokeAsync("UiExtensionPoint" , new { location="checkout-end", model = Model}) diff --git a/BTCPayServer/Views/Manage/_Nav.cshtml b/BTCPayServer/Views/Manage/_Nav.cshtml index 254be646c..4fb90a7bd 100644 --- a/BTCPayServer/Views/Manage/_Nav.cshtml +++ b/BTCPayServer/Views/Manage/_Nav.cshtml @@ -5,5 +5,5 @@ Two-factor authentication API Keys Notifications - + diff --git a/BTCPayServer/Views/Server/_Nav.cshtml b/BTCPayServer/Views/Server/_Nav.cshtml index 48f2b548b..3f6a88113 100644 --- a/BTCPayServer/Views/Server/_Nav.cshtml +++ b/BTCPayServer/Views/Server/_Nav.cshtml @@ -13,5 +13,5 @@ Logs Files Plugins (experimental) - + diff --git a/BTCPayServer/Views/Shared/Bitcoin/BitcoinLikeMethodCheckout.cshtml b/BTCPayServer/Views/Shared/Bitcoin/BitcoinLikeMethodCheckout.cshtml index a5dc09061..52f9a3808 100644 --- a/BTCPayServer/Views/Shared/Bitcoin/BitcoinLikeMethodCheckout.cshtml +++ b/BTCPayServer/Views/Shared/Bitcoin/BitcoinLikeMethodCheckout.cshtml @@ -51,7 +51,7 @@ - @await Component.InvokeAsync("UiExtensionPoint" , new { location="checkout-bitcoin-post-content"}) + @await Component.InvokeAsync("UiExtensionPoint" , new { location="checkout-bitcoin-post-content", model = Model}) @if (Model.ShowRecommendedFee) { diff --git a/BTCPayServer/Views/Shared/Ethereum/EthereumLikeMethodCheckout.cshtml b/BTCPayServer/Views/Shared/Ethereum/EthereumLikeMethodCheckout.cshtml index e0ca0abe5..1e76846e9 100644 --- a/BTCPayServer/Views/Shared/Ethereum/EthereumLikeMethodCheckout.cshtml +++ b/BTCPayServer/Views/Shared/Ethereum/EthereumLikeMethodCheckout.cshtml @@ -49,7 +49,7 @@ - @await Component.InvokeAsync("UiExtensionPoint" , new { location="checkout-ethereum-post-content"}) + @await Component.InvokeAsync("UiExtensionPoint" , new { location="checkout-ethereum-post-content", model = Model}) @@ -61,7 +61,7 @@
{{$t("Copy")}}
- @await Component.InvokeAsync("UiExtensionPoint" , new { location="checkout-ethereum-post-tabs"}) + @await Component.InvokeAsync("UiExtensionPoint" , new { location="checkout-ethereum-post-tabs", model = Model}) diff --git a/BTCPayServer/Views/Shared/Lightning/LightningLikeMethodCheckout.cshtml b/BTCPayServer/Views/Shared/Lightning/LightningLikeMethodCheckout.cshtml index 0c3c2ca19..85ce594e9 100644 --- a/BTCPayServer/Views/Shared/Lightning/LightningLikeMethodCheckout.cshtml +++ b/BTCPayServer/Views/Shared/Lightning/LightningLikeMethodCheckout.cshtml @@ -58,7 +58,7 @@ - @await Component.InvokeAsync("UiExtensionPoint" , new { location="checkout-lightning-post-content"}) + @await Component.InvokeAsync("UiExtensionPoint" , new { location="checkout-lightning-post-content", model = Model}) @@ -70,7 +70,7 @@
{{$t("Copy")}}
- @await Component.InvokeAsync("UiExtensionPoint" , new { location="checkout-lightning-post-tabs"}) + @await Component.InvokeAsync("UiExtensionPoint" , new { location="checkout-lightning-post-tabs", model = Model}) diff --git a/BTCPayServer/Views/Shared/_Layout.cshtml b/BTCPayServer/Views/Shared/_Layout.cshtml index 2bd171816..354dd9092 100644 --- a/BTCPayServer/Views/Shared/_Layout.cshtml +++ b/BTCPayServer/Views/Shared/_Layout.cshtml @@ -80,7 +80,7 @@ - + } diff --git a/BTCPayServer/Views/Stores/Integrations.cshtml b/BTCPayServer/Views/Stores/Integrations.cshtml index 842eb5f9f..39d87430c 100644 --- a/BTCPayServer/Views/Stores/Integrations.cshtml +++ b/BTCPayServer/Views/Stores/Integrations.cshtml @@ -12,7 +12,7 @@ }
    - +

Other Integrations

diff --git a/BTCPayServer/Views/Stores/_Nav.cshtml b/BTCPayServer/Views/Stores/_Nav.cshtml index f35cedd99..0b84b7fd2 100644 --- a/BTCPayServer/Views/Stores/_Nav.cshtml +++ b/BTCPayServer/Views/Stores/_Nav.cshtml @@ -7,5 +7,5 @@ Pay Button Integrations Webhooks - + diff --git a/BTCPayServer/Views/Wallets/_Nav.cshtml b/BTCPayServer/Views/Wallets/_Nav.cshtml index e05c44ad9..7a958f93e 100644 --- a/BTCPayServer/Views/Wallets/_Nav.cshtml +++ b/BTCPayServer/Views/Wallets/_Nav.cshtml @@ -19,5 +19,5 @@ PSBT Settings } - +