mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 06:24:24 +01:00
Refactoring: Allow ViewsRazor extension to be used by plugins
Moves the `ViewsRazor` extension into Abstractions, so that it can be used by plugins. Separated out of #2701, prerequisite for the LNbank plugin integration.
This commit is contained in:
committed by
Andrew Camilleri
parent
68595be323
commit
ad8f347989
@@ -3,7 +3,7 @@ using System.Globalization;
|
|||||||
using Microsoft.AspNetCore.Html;
|
using Microsoft.AspNetCore.Html;
|
||||||
using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
||||||
|
|
||||||
namespace BTCPayServer.Views
|
namespace BTCPayServer.Abstractions.Extensions
|
||||||
{
|
{
|
||||||
public static class ViewsRazor
|
public static class ViewsRazor
|
||||||
{
|
{
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
@inject ISettingsRepository SettingsRepository
|
@inject ISettingsRepository SettingsRepository
|
||||||
@using BTCPayServer.HostedServices
|
@using BTCPayServer.HostedServices
|
||||||
@using BTCPayServer.Views.Notifications
|
@using BTCPayServer.Views.Notifications
|
||||||
|
@using BTCPayServer.Abstractions.Extensions
|
||||||
@using BTCPayServer.Abstractions.Contracts
|
@using BTCPayServer.Abstractions.Contracts
|
||||||
@using BTCPayServer.Client
|
@using BTCPayServer.Client
|
||||||
@using BTCPayServer.Services
|
@using BTCPayServer.Services
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using BTCPayServer.Abstractions.Extensions;
|
||||||
using BTCPayServer.Services;
|
using BTCPayServer.Services;
|
||||||
|
|
||||||
namespace BTCPayServer.Models.ServerViewModels
|
namespace BTCPayServer.Models.ServerViewModels
|
||||||
@@ -23,7 +24,7 @@ namespace BTCPayServer.Models.ServerViewModels
|
|||||||
{
|
{
|
||||||
if (Settings?.LastUpdated is DateTimeOffset date)
|
if (Settings?.LastUpdated is DateTimeOffset date)
|
||||||
{
|
{
|
||||||
return Views.ViewsRazor.ToTimeAgo(date);
|
return ViewsRazor.ToTimeAgo(date);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using BTCPayServer.Abstractions.Extensions;
|
||||||
using BTCPayServer.Client.Models;
|
using BTCPayServer.Client.Models;
|
||||||
using BTCPayServer.Data;
|
using BTCPayServer.Data;
|
||||||
using BTCPayServer.Services.Rates;
|
using BTCPayServer.Services.Rates;
|
||||||
using BTCPayServer.Views;
|
|
||||||
using PullPaymentData = BTCPayServer.Data.PullPaymentData;
|
using PullPaymentData = BTCPayServer.Data.PullPaymentData;
|
||||||
|
|
||||||
namespace BTCPayServer.Models
|
namespace BTCPayServer.Models
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
@using BTCPayServer.Views.Apps
|
@using BTCPayServer.Abstractions.Extensions
|
||||||
|
@using BTCPayServer.Views.Apps
|
||||||
@using BTCPayServer.Models.AppViewModels
|
@using BTCPayServer.Models.AppViewModels
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
@using BTCPayServer.Views
|
@using BTCPayServer.Abstractions.Extensions
|
||||||
|
@using BTCPayServer.Views
|
||||||
@using BTCPayServer.Views.Apps
|
@using BTCPayServer.Views.Apps
|
||||||
@{
|
@{
|
||||||
ViewBag.CategoryTitle = "Apps";
|
ViewBag.CategoryTitle = "Apps";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
@using Microsoft.AspNetCore.Mvc.Rendering
|
@using BTCPayServer.Views.Stores
|
||||||
@using BTCPayServer.Views.Stores
|
@using BTCPayServer.Abstractions.Extensions
|
||||||
@model UpdateCoinSwitchSettingsViewModel
|
@model UpdateCoinSwitchSettingsViewModel
|
||||||
@{
|
@{
|
||||||
Layout = "../Shared/_NavLayout.cshtml";
|
Layout = "../Shared/_NavLayout.cshtml";
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
@using BTCPayServer.Views.Stores
|
@using BTCPayServer.Views.Stores
|
||||||
|
@using BTCPayServer.Abstractions.Extensions
|
||||||
@model BTCPayServer.Services.Altcoins.Ethereum.UI.EditEthereumPaymentMethodViewModel
|
@model BTCPayServer.Services.Altcoins.Ethereum.UI.EditEthereumPaymentMethodViewModel
|
||||||
|
|
||||||
@{
|
@{
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
@using BTCPayServer.Views.Stores
|
@using BTCPayServer.Views.Stores
|
||||||
|
@using BTCPayServer.Abstractions.Extensions
|
||||||
@model BTCPayServer.Services.Altcoins.Ethereum.UI.ViewEthereumStoreOptionsViewModel
|
@model BTCPayServer.Services.Altcoins.Ethereum.UI.ViewEthereumStoreOptionsViewModel
|
||||||
@inject SignInManager<ApplicationUser> SignInManager;
|
@inject SignInManager<ApplicationUser> SignInManager;
|
||||||
@inject BTCPayNetworkProvider BTCPayNetworkProvider;
|
@inject BTCPayNetworkProvider BTCPayNetworkProvider;
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
@using BTCPayServer.Views.Manage
|
@using BTCPayServer.Abstractions.Extensions
|
||||||
|
@using BTCPayServer.Views.Manage
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
@using BTCPayServer.Services.Invoices
|
@using BTCPayServer.Abstractions.Extensions
|
||||||
|
@using BTCPayServer.Services.Invoices
|
||||||
@using BTCPayServer.Views.Invoice
|
@using BTCPayServer.Views.Invoice
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
@using BTCPayServer.Abstractions.Extensions
|
||||||
@using BTCPayServer.Views
|
@using BTCPayServer.Views
|
||||||
@using BTCPayServer.Views.Invoice
|
@using BTCPayServer.Views.Invoice
|
||||||
@{
|
@{
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
@using BTCPayServer.Views.Manage
|
@using BTCPayServer.Abstractions.Extensions
|
||||||
|
@using BTCPayServer.Views.Manage
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
@using BTCPayServer.Views
|
@using BTCPayServer.Abstractions.Extensions
|
||||||
|
@using BTCPayServer.Views
|
||||||
@using BTCPayServer.Views.Manage
|
@using BTCPayServer.Views.Manage
|
||||||
@{
|
@{
|
||||||
Layout = "../Shared/_NavLayout.cshtml";
|
Layout = "../Shared/_NavLayout.cshtml";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
@using BTCPayServer.Controllers
|
|
||||||
@using BTCPayServer.Views.Stores
|
@using BTCPayServer.Views.Stores
|
||||||
|
@using BTCPayServer.Abstractions.Extensions
|
||||||
@model BTCPayServer.Services.Altcoins.Monero.UI.MoneroLikeStoreController.MoneroLikePaymentMethodViewModel
|
@model BTCPayServer.Services.Altcoins.Monero.UI.MoneroLikeStoreController.MoneroLikePaymentMethodViewModel
|
||||||
|
|
||||||
@{
|
@{
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
@using BTCPayServer.Views.Stores
|
@using BTCPayServer.Views.Stores
|
||||||
|
@using BTCPayServer.Abstractions.Extensions
|
||||||
@model BTCPayServer.Services.Altcoins.Monero.UI.MoneroLikeStoreController.MoneroLikePaymentMethodListViewModel
|
@model BTCPayServer.Services.Altcoins.Monero.UI.MoneroLikeStoreController.MoneroLikePaymentMethodListViewModel
|
||||||
|
|
||||||
@{
|
@{
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
|
@using BTCPayServer.Abstractions.Extensions
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
@using BTCPayServer.Views
|
@using BTCPayServer.Abstractions.Extensions
|
||||||
|
@using BTCPayServer.Views
|
||||||
@using BTCPayServer.Views.Notifications
|
@using BTCPayServer.Views.Notifications
|
||||||
|
|
||||||
@{
|
@{
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
@using BTCPayServer.Views.PaymentRequest
|
@using BTCPayServer.Abstractions.Extensions
|
||||||
|
@using BTCPayServer.Views.PaymentRequest
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
@using BTCPayServer.Abstractions.Extensions
|
||||||
@using BTCPayServer.Views
|
@using BTCPayServer.Views
|
||||||
@using BTCPayServer.Views.PaymentRequest
|
@using BTCPayServer.Views.PaymentRequest
|
||||||
@{
|
@{
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
@using BTCPayServer.Views.Server
|
@using BTCPayServer.Abstractions.Extensions
|
||||||
|
@using BTCPayServer.Views.Server
|
||||||
@using BTCPayServer.Models.ServerViewModels
|
@using BTCPayServer.Models.ServerViewModels
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
@using BTCPayServer.Views
|
@using BTCPayServer.Abstractions.Extensions
|
||||||
|
@using BTCPayServer.Views
|
||||||
@using BTCPayServer.Views.Server
|
@using BTCPayServer.Views.Server
|
||||||
@{
|
@{
|
||||||
Layout = "../Shared/_NavLayout.cshtml";
|
Layout = "../Shared/_NavLayout.cshtml";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
@using BTCPayServer.Services.Altcoins.Ethereum.UI
|
|
||||||
@using BTCPayServer.Views.Server
|
@using BTCPayServer.Views.Server
|
||||||
@using System.Net.Http
|
@using System.Net.Http
|
||||||
|
@using BTCPayServer.Abstractions.Extensions
|
||||||
@model BTCPayServer.Services.Altcoins.Ethereum.Configuration.EthereumLikeConfiguration
|
@model BTCPayServer.Services.Altcoins.Ethereum.Configuration.EthereumLikeConfiguration
|
||||||
@inject BTCPayNetworkProvider BTCPayNetworkProvider;
|
@inject BTCPayNetworkProvider BTCPayNetworkProvider;
|
||||||
@inject IHttpClientFactory HttpClientFactory;
|
@inject IHttpClientFactory HttpClientFactory;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
@using BTCPayServer.Views.PaymentRequest
|
@using BTCPayServer.Views.PaymentRequest
|
||||||
@using BTCPayServer.Views.Wallets
|
@using BTCPayServer.Views.Wallets
|
||||||
@using BTCPayServer.Abstractions.Contracts
|
@using BTCPayServer.Abstractions.Contracts
|
||||||
|
@using BTCPayServer.Abstractions.Extensions
|
||||||
@inject SignInManager<ApplicationUser> SignInManager
|
@inject SignInManager<ApplicationUser> SignInManager
|
||||||
@inject UserManager<ApplicationUser> UserManager
|
@inject UserManager<ApplicationUser> UserManager
|
||||||
@inject RoleManager<IdentityRole> RoleManager
|
@inject RoleManager<IdentityRole> RoleManager
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
@using BTCPayServer.Views.Stores
|
@using BTCPayServer.Views.Stores
|
||||||
|
@using BTCPayServer.Abstractions.Extensions
|
||||||
@model BTCPayServer.Plugins.Shopify.Models.ShopifySettings
|
@model BTCPayServer.Plugins.Shopify.Models.ShopifySettings
|
||||||
@{
|
@{
|
||||||
|
|
||||||
Layout = "../Shared/_NavLayout.cshtml";
|
Layout = "../Shared/_NavLayout.cshtml";
|
||||||
|
|
||||||
ViewData["NavPartialName"] = "../Stores/_Nav";
|
ViewData["NavPartialName"] = "../Stores/_Nav";
|
||||||
ViewData.SetActivePageAndTitle(StoreNavPages.Integrations, "Integrations");
|
ViewData.SetActivePageAndTitle(StoreNavPages.Integrations, "Integrations");
|
||||||
|
|
||||||
|
|
||||||
var shopifyCredsSet = Model?.IntegratedAt.HasValue is true;
|
var shopifyCredsSet = Model?.IntegratedAt.HasValue is true;
|
||||||
var shopifyUrl = Model?.ShopifyUrl;
|
var shopifyUrl = Model?.ShopifyUrl;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
@using BTCPayServer.Views.Stores
|
@using BTCPayServer.Abstractions.Extensions
|
||||||
|
@using BTCPayServer.Views.Stores
|
||||||
@using BTCPayServer.Models.StoreViewModels
|
@using BTCPayServer.Models.StoreViewModels
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
@using BTCPayServer.Views
|
@using BTCPayServer.Abstractions.Extensions
|
||||||
|
@using BTCPayServer.Views
|
||||||
@using BTCPayServer.Views.Stores
|
@using BTCPayServer.Views.Stores
|
||||||
|
|
||||||
@{
|
@{
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
@using BTCPayServer.Views.Stores
|
@using BTCPayServer.Abstractions.Extensions
|
||||||
|
@using BTCPayServer.Views.Stores
|
||||||
@using BTCPayServer.Models.StoreViewModels
|
@using BTCPayServer.Models.StoreViewModels
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
@using BTCPayServer.Abstractions.Extensions
|
||||||
@using BTCPayServer.Views
|
@using BTCPayServer.Views
|
||||||
@using BTCPayServer.Views.Stores
|
@using BTCPayServer.Views.Stores
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
@using BTCPayServer.Views.Wallets
|
@using BTCPayServer.Abstractions.Extensions
|
||||||
|
@using BTCPayServer.Views.Wallets
|
||||||
@using BTCPayServer.Models.WalletViewModels
|
@using BTCPayServer.Models.WalletViewModels
|
||||||
@addTagHelper *, BundlerMinifier.TagHelpers
|
@addTagHelper *, BundlerMinifier.TagHelpers
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
@using BTCPayServer.Views
|
@using BTCPayServer.Abstractions.Extensions
|
||||||
|
@using BTCPayServer.Views
|
||||||
@using BTCPayServer.Views.Wallets
|
@using BTCPayServer.Views.Wallets
|
||||||
@{
|
@{
|
||||||
ViewBag.CategoryTitle = "Wallets";
|
ViewBag.CategoryTitle = "Wallets";
|
||||||
|
|||||||
Reference in New Issue
Block a user