From 378d2bc8ba16678f6505292cfbadbae95b5c9141 Mon Sep 17 00:00:00 2001 From: Dennis Reimann Date: Fri, 23 Oct 2020 20:04:13 +0200 Subject: [PATCH] Store settings: Improve wallet display --- BTCPayServer/Views/Stores/UpdateStore.cshtml | 266 +++++++++---------- 1 file changed, 130 insertions(+), 136 deletions(-) diff --git a/BTCPayServer/Views/Stores/UpdateStore.cshtml b/BTCPayServer/Views/Stores/UpdateStore.cshtml index 0fdf2f476..89c7cc404 100644 --- a/BTCPayServer/Views/Stores/UpdateStore.cshtml +++ b/BTCPayServer/Views/Stores/UpdateStore.cshtml @@ -18,141 +18,145 @@
-

- Wallet - On-chain payments -

- @if (Model.HintWallet) - { -
- -

- A store requires a wallet to receive on-chain payments. - Optionally, you can have a store that only receives Lightning payments, see the next section for more details. -

- -
- } - - - - - - - - - - +
+

+ Wallet + On-chain payments +

+ @if (Model.HintWallet) + { +
+ +

+ A store requires a wallet to receive on-chain payments. + Optionally, you can have a store that only receives Lightning payments, see the next section for more details. +

+ +
+ } +
    @foreach (var scheme in Model.DerivationSchemes.OrderBy(scheme => scheme.Collapsed)) { -
- - - - - + } + + + @if (scheme.Enabled) + { + + + Enabled + + } + else + { + + + Disabled + + } + | + + @(scheme.Enabled ? "Modify" : "Setup") + + + + } - @if (Model.DerivationSchemes.Any(scheme => scheme.Collapsed)) - { - - - - } - -
CryptoDerivation SchemeEnabledActions
- @scheme.Crypto - @if (!string.IsNullOrWhiteSpace(scheme.Value) && scheme.WalletSupported) - { - - - Wallet - } - - @if (string.IsNullOrEmpty(scheme.Value)) - { - Not set - } - else - { - - @scheme.Value - - - @if (scheme.Value.Length > 20) +
  • +
    + + @scheme.Crypto + @if (!string.IsNullOrWhiteSpace(scheme.Value)) + { + | + + + @scheme.Value + + + @if (scheme.Value.Length > 20) + { + var match = Regex.Match(scheme.Value, @"((?:-\[(?:[^\]])+\])+|\S{6})$"); + @match.Value; + } + + + @if (scheme.WalletSupported) { - var match = Regex.Match(scheme.Value, @"((?:-\[(?:[^\]])+\])+|\S{6})$"); - @match.Value; + | + Wallet } - - } -
  • - @if (scheme.Enabled) - { - - } - else - { - - } - - - @(scheme.Enabled ? "Modify" : "Setup") - -
    + + @if (Model.DerivationSchemes.Any(scheme => scheme.Collapsed)) + { + + + } +
    -

    - Lightning - Off-chain payments -

    - @if (Model.HintLightning) - { -
    - -

    - A connection to a Lightning node is required if you want to receive Lightning payments. -

    - -
    - } - -
    - - - - - - - - - - +
    +

    + Lightning + Off-chain payments +

    + @if (Model.HintLightning) + { +
    + +

    + A connection to a Lightning node is required if you want to receive Lightning payments. +

    + +
    + } +
      @foreach (var scheme in Model.LightningNodes) { -
    - - - - - +
  • +
    + + @scheme.CryptoCode + @if (!string.IsNullOrWhiteSpace(scheme.Address)) + { + | + @scheme.Address + } + + + @if (scheme.Enabled) + { + + + Enabled + + } + else + { + + + Disabled + + } + | + + @(scheme.Enabled ? "Modify" : "Setup") + + +
    +
  • } - -
    CryptoAddressEnabledActions
    @scheme.CryptoCode@scheme.Address - @if (scheme.Enabled) - { - - } - else - { - - } - - - @(scheme.Enabled ? "Modify" : "Setup") - -
    +
    @@ -347,14 +351,4 @@ @section Scripts { @await Html.PartialAsync("_ValidationScriptsPartial") - - }