From 26374ef47627dd7ea4c7e8431c6e556bcb0d95d1 Mon Sep 17 00:00:00 2001 From: d11n Date: Wed, 13 Dec 2023 10:53:37 +0100 Subject: [PATCH] Policies: Add warnings for certain options (#5554) --- BTCPayServer/Views/Shared/ListRoles.cshtml | 5 ++- .../Views/UIHome/RecoverySeedBackup.cshtml | 2 +- .../ListInvoicesPaymentsPartial.cshtml | 2 +- BTCPayServer/Views/UIManage/APIKeys.cshtml | 5 ++- BTCPayServer/Views/UIManage/AddApiKey.cshtml | 3 +- .../EditPaymentRequest.cshtml | 10 ++++-- BTCPayServer/Views/UIServer/Policies.cshtml | 34 +++++++++++++++++++ .../Views/UIStores/WalletSettings.cshtml | 7 ++-- .../Views/UIWallets/WalletSend.cshtml | 8 ++++- .../wwwroot/main/bootstrap/bootstrap.css | 4 +++ BTCPayServer/wwwroot/main/site.css | 12 +++++++ .../wwwroot/main/themes/default-dark.css | 1 + BTCPayServer/wwwroot/main/themes/default.css | 5 +-- 13 files changed, 85 insertions(+), 13 deletions(-) diff --git a/BTCPayServer/Views/Shared/ListRoles.cshtml b/BTCPayServer/Views/Shared/ListRoles.cshtml index 17372358e..f93104a76 100644 --- a/BTCPayServer/Views/Shared/ListRoles.cshtml +++ b/BTCPayServer/Views/Shared/ListRoles.cshtml @@ -96,7 +96,10 @@ @if (!role.Permissions.Any()) { - No policies + + + No policies + } else { diff --git a/BTCPayServer/Views/UIHome/RecoverySeedBackup.cshtml b/BTCPayServer/Views/UIHome/RecoverySeedBackup.cshtml index a5ccea057..7df998760 100644 --- a/BTCPayServer/Views/UIHome/RecoverySeedBackup.cshtml +++ b/BTCPayServer/Views/UIHome/RecoverySeedBackup.cshtml @@ -70,7 +70,7 @@ Do not photograph the recovery phrase, and do not store it digitally.


-

+

The recovery phrase will be permanently erased from the server.

} diff --git a/BTCPayServer/Views/UIInvoice/ListInvoicesPaymentsPartial.cshtml b/BTCPayServer/Views/UIInvoice/ListInvoicesPaymentsPartial.cshtml index 0e56335f4..b454e964a 100644 --- a/BTCPayServer/Views/UIInvoice/ListInvoicesPaymentsPartial.cshtml +++ b/BTCPayServer/Views/UIInvoice/ListInvoicesPaymentsPartial.cshtml @@ -9,7 +9,7 @@ @if (invoice.Overpaid) { var usedPaymentMethods = invoice.CryptoPayments.Count(p => p.Paid != null); -

+

This invoice got overpaid. @if (usedPaymentMethods > 1) diff --git a/BTCPayServer/Views/UIManage/APIKeys.cshtml b/BTCPayServer/Views/UIManage/APIKeys.cshtml index 9e854c998..a36c3c53a 100644 --- a/BTCPayServer/Views/UIManage/APIKeys.cshtml +++ b/BTCPayServer/Views/UIManage/APIKeys.cshtml @@ -56,7 +56,10 @@ } @if (!permissions.Any()) { - No permissions + + + No permissions + } else { diff --git a/BTCPayServer/Views/UIManage/AddApiKey.cshtml b/BTCPayServer/Views/UIManage/AddApiKey.cshtml index 76a9d3695..34e4b1b6f 100644 --- a/BTCPayServer/Views/UIManage/AddApiKey.cshtml +++ b/BTCPayServer/Views/UIManage/AddApiKey.cshtml @@ -84,7 +84,8 @@ @if (!Model.Stores.Any()) { -

+

+ You currently have no stores configured.

} diff --git a/BTCPayServer/Views/UIPaymentRequest/EditPaymentRequest.cshtml b/BTCPayServer/Views/UIPaymentRequest/EditPaymentRequest.cshtml index 0e6ab8bc6..d1c33fa3d 100644 --- a/BTCPayServer/Views/UIPaymentRequest/EditPaymentRequest.cshtml +++ b/BTCPayServer/Views/UIPaymentRequest/EditPaymentRequest.cshtml @@ -54,7 +54,10 @@ @if (!Model.AmountAndCurrencyEditable) { -

Amount and currency are not editable once payment request has invoices

+

+ + Amount and currency are not editable once payment request has invoices +

}
@@ -89,7 +92,10 @@ email rules. @if (Model.HasEmailRules is not true) { -
No payment request related email rules have been configured for this store.
+ }
diff --git a/BTCPayServer/Views/UIServer/Policies.cshtml b/BTCPayServer/Views/UIServer/Policies.cshtml index d3667e9fd..b5a4bcdca 100644 --- a/BTCPayServer/Views/UIServer/Policies.cshtml +++ b/BTCPayServer/Views/UIServer/Policies.cshtml @@ -9,6 +9,20 @@ var linkProviders = TransactionLinkProviders.ToArray(); } +@section PageHeadContent { + +} +

@ViewData["Title"]

@if (!ViewContext.ModelState.IsValid) @@ -28,6 +42,10 @@ +
@@ -36,11 +54,19 @@ +
+
@@ -70,12 +96,20 @@ +
+
diff --git a/BTCPayServer/Views/UIStores/WalletSettings.cshtml b/BTCPayServer/Views/UIStores/WalletSettings.cshtml index f7ca0e138..2aa15586d 100644 --- a/BTCPayServer/Views/UIStores/WalletSettings.cshtml +++ b/BTCPayServer/Views/UIStores/WalletSettings.cshtml @@ -176,15 +176,16 @@ - - +

diff --git a/BTCPayServer/Views/UIWallets/WalletSend.cshtml b/BTCPayServer/Views/UIWallets/WalletSend.cshtml index 8fbb543ed..09c2a881c 100644 --- a/BTCPayServer/Views/UIWallets/WalletSend.cshtml +++ b/BTCPayServer/Views/UIWallets/WalletSend.cshtml @@ -116,7 +116,13 @@ @Model.CryptoCode. @if (Model.ImmatureBalance > 0) { -
@Model.ImmatureBalance @Model.CryptoCode are still immature and require additional confirmations.
+ +
+ + + @Model.ImmatureBalance @Model.CryptoCode are still immature and require additional confirmations. + +
}
diff --git a/BTCPayServer/wwwroot/main/bootstrap/bootstrap.css b/BTCPayServer/wwwroot/main/bootstrap/bootstrap.css index 7a5a0af32..d0ab8bd1b 100644 --- a/BTCPayServer/wwwroot/main/bootstrap/bootstrap.css +++ b/BTCPayServer/wwwroot/main/bootstrap/bootstrap.css @@ -12255,6 +12255,10 @@ ul:not([class]) li { color: var(--btcpay-body-text-muted) !important; } +.text-warning { + color: rgba(var(--btcpay-body-text-warning-rgb), var(--btcpay-text-opacity)) !important; +} + /* Modals */ .modal-content { box-shadow: 0 20px 20px rgba(0, 0, 0, 0.15); diff --git a/BTCPayServer/wwwroot/main/site.css b/BTCPayServer/wwwroot/main/site.css index 6ffee06b7..6bcac1f3c 100644 --- a/BTCPayServer/wwwroot/main/site.css +++ b/BTCPayServer/wwwroot/main/site.css @@ -97,6 +97,18 @@ a.unobtrusive-link { transform: rotate(-180deg); } +/* Icon and text, used for warnings of additional info text. Adjust spacing and color via utility classes. */ +.info-note { + display: inline-flex; + align-items: baseline; + gap: var(--btcpay-space-s); +} + +.info-note .icon { + position: relative; + top: var(--btcpay-space-xs); +} + /* Badges */ .badge-new, .badge-pending { diff --git a/BTCPayServer/wwwroot/main/themes/default-dark.css b/BTCPayServer/wwwroot/main/themes/default-dark.css index 95d61d899..8e704df1c 100644 --- a/BTCPayServer/wwwroot/main/themes/default-dark.css +++ b/BTCPayServer/wwwroot/main/themes/default-dark.css @@ -16,6 +16,7 @@ --btcpay-body-bg-rgb: 22, 27, 34; --btcpay-body-text: var(--btcpay-white); --btcpay-body-text-muted: var(--btcpay-neutral-600); + --btcpay-body-text-warning-rgb: 255, 192, 67; --btcpay-body-text-rgb: 255, 255, 255; --btcpay-body-link-accent: var(--btcpay-primary-accent); --btcpay-body-link-accent-rgb: var(--btcpay-primary-accent-rgb); diff --git a/BTCPayServer/wwwroot/main/themes/default.css b/BTCPayServer/wwwroot/main/themes/default.css index ce8d0b2a1..7db57a839 100644 --- a/BTCPayServer/wwwroot/main/themes/default.css +++ b/BTCPayServer/wwwroot/main/themes/default.css @@ -119,8 +119,8 @@ --btcpay-yellow-400-rgb: 255,207,112; --btcpay-yellow-500: #FFC043; --btcpay-yellow-500-rgb: 255,192,67; - --btcpay-yellow-600: #BC8B2C; - --btcpay-yellow-600-rgb: 188,139,44; + --btcpay-yellow-600: #B57E12; + --btcpay-yellow-600-rgb: 181,126,18; --btcpay-yellow-700: #997328; --btcpay-yellow-700-rgb: 153,115,40; --btcpay-yellow-800: #674D1B; @@ -193,6 +193,7 @@ --btcpay-body-text-hover: var(--btcpay-body-text); --btcpay-body-text-active: var(--btcpay-primary-text-active); --btcpay-body-text-muted: var(--btcpay-neutral-500); + --btcpay-body-text-warning-rgb: 181, 126, 18; --btcpay-body-text-rgb: 41, 41, 41; --btcpay-body-link: var(--btcpay-primary); --btcpay-body-link-rgb: var(--btcpay-primary-rgb);