btcpayserver/BTCPayServer/Views/UIWallets/_PSBTInfo.cshtml
d11n 95f3e429b4
Wallet transactions: Add label manager (#4796)
* Wallet transactions: Add label manager

* Update BTCPayServer/Views/UIWallets/WalletTransactions.cshtml

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>

* Add rich label info

* Fixes

* support labels in wallet send

* add labels to tx info page

* Remove noscript parts

* Allow click on transaction label info

* update psbt info labelstyling

* revert red pixel fix as it broke all

---------

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>
2023-03-26 20:42:38 +09:00

85 lines
2.6 KiB
Plaintext

@model WalletPSBTReadyViewModel
<script src="~/js/wallet/wallet-camera-scanner.js" asp-append-version="true"></script>
<script src="~/js/wallet/WalletSend.js" asp-append-version="true"></script>
@if (Model.CanCalculateBalance)
{
<p class="lead text-center text-secondary">
This transaction will change your balance:
<br>
<span class="text-@(Model.Positive ? "success" : "danger")">@Model.BalanceChange</span>
</p>
}
<div id="inputs">
<h4 class="mb-n3">Inputs</h4>
<table class="table">
<thead>
<tr>
<th>Index</th>
<th>Labels</th>
<th class="text-end">Amount</th>
</tr>
</thead>
<tbody>
@foreach (var input in Model.Inputs)
{
<tr>
@if (input.Error != null)
{
<td>
@input.Index <span class="fa fa-exclamation-triangle text-danger" title="@input.Error"></span>
</td>
}
else
{
<td>@input.Index</td>
}<td>
@foreach (var label in input.Labels)
{
<div class="transaction-label" style="--label-bg:@label.Value;--label-fg:@ColorPalette.Default.TextColor(label.Value)">@label.Key</div>
}
</td>
<td class="text-end text-@(input.Positive ? "success" : "danger")">@input.BalanceChange</td>
</tr>
}
</tbody>
</table>
</div>
<div id="outputs" class="mt-4">
<h4 class="mb-n3">Outputs</h4>
<table class="table">
<thead>
<tr>
<th>Destination</th>
<th>Labels</th>
<th class="text-end">Amount</th>
</tr>
</thead>
<tbody>
@foreach (var destination in Model.Destinations)
{
<tr>
<td class="text-break">@destination.Destination</td>
<td>
@foreach (var label in destination.Labels)
{
<div class="transaction-label" style="--label-bg:@label.Value;--label-fg:@ColorPalette.Default.TextColor(label.Value)">@label.Key</div>
}
</td>
<td class="text-end text-@(destination.Positive ? "success" : "danger")">@destination.Balance</td>
</tr>
}
</tbody>
</table>
</div>
@if (Model.FeeRate != null)
{
<p class="text-muted text-end">Transaction fee rate: <b>@Model.FeeRate</b></p>
}