btcpayserver/BTCPayServer/Views/Wallets/Payouts.cshtml
d11n ed7031981b
Bootstrap v5 migration (#2490)
* Swap bootstrap asset files

* Update themes and color definitions

* Move general bootstrap customizations

* Theme updates

Theme updates

* Remove BuildBundlerMinifier

This lead to an error, because BuildBundlerMinifier and BundlerMinifier.Core seem to conflict here. Details: https://stackoverflow.com/a/61119586

* Rewplace btn-block class with w-100

* Update badge classes

* Remove old font family head variable

* Update margin classes

* Cleanups

* Update float classes

* Update text classes

* Update padding classes

* Update border classes

* UPdate dropdown classes

* Update select classes

* Update neutral custom props

* Update bootstrap and customizations

* Update ChromeDriver; disable smooth scroll

https://github.com/SeleniumHQ/selenium/issues/8295

* Improve alert messages

* Improve bootstrap customizations

* Disable reduced motion

See also 7358282f

* Update Bootstrap data attributes

* Update file inputs

* Update input groups

* Replace deprecated jumbotron class

* Update variables; re-add negative margin util classes

* Update cards

* Update form labels

* Debug alerts

* Fix aria-labelledby associations

* Dropdown-related test fixes

* Fix CanUseWebhooks test

* Test fixes

* Nav updates

* Fix nav usage in wallet send and payouts

* Update alert and modal close buttons

* Re-add backdrop properties

* Upgrade Bootstrap to v5 final

* Update screen reader classes

* Update font-weight classes

* Update monospace font classes

* Update accordians

* Update close icon usage

* Cleanup

* Update scripts and style integrations

* Update input group texts

* Update LN node setup page

* Update more form control classes

* Update inline forms

* Add js specific test

* Upgrade Vue.js

* Remove unused JS

* Upgrade Bootstrap to v5.0.1

* Try container related test updates

* Separate jQuery bundle

* Remove jQuery from LND seed backup page

* Remove unused code

* Refactor email autofill js

* Refactor camera scanner JS

* Re-add tests

* Re-add BuildBundlerMinifier

* Do not minify bundles containing Bootstrap

Details https://github.com/madskristensen/BundlerMinifier/issues/558

* Update bundles

* Cleanup JS test

* Cleanup tests involving dropdowns

* Cleanup tests involving collapses

* Cleanup locale additions in ConfigureCore

* Cleanup bundles

* Remove duplicate status message

* Cleanup formatting

* Fix missing validation scripts

* Remove unused unminified Bootstrap js files

* Fix classic theme

* Fix Casa theme

* Fix PoS validation
2021-05-19 11:39:27 +09:00

145 lines
7 KiB
Text

@using BTCPayServer.Client.Models
@model PayoutsModel
@inject IEnumerable<IPayoutHandler> PayoutHandlers;
@{
Layout = "../Shared/_NavLayout.cshtml";
ViewData.SetActivePageAndTitle(WalletsNavPages.Payouts, "Manage payouts", Context.GetStoreData().StoreName);
}
@section PageFootContent {
<script>
function selectAll(e, elementClass)
{
const items = document.getElementsByClassName("selection-item-"+elementClass);
for (let i = 0; i < items.length; i++) {
items[i].checked = e.checked;
}
}
</script>
}
<form method="post">
<h4 class="mb-3">@ViewData["Title"]</h4>
@if (!Model.PayoutStateSets.Any())
{
<p class="text-secondary mt-3">
There are no payouts yet.
</p>
}
<div class="row">
<ul class="nav nav-pills">
@for (var index = 0; index < Model.PayoutStateSets.Count; index++)
{
var state = Model.PayoutStateSets[index];
<li class="nav-item py-0">
<a class="nav-link me-1 @(index == 0 ? "active" : "")" data-bs-toggle="tab" href="#@state.State" role="tab">@state.State.GetStateString() (@state.Payouts.Count)</a>
</li>
}
</ul>
</div>
<div class="row">
<div class="tab-content w-100">
@for (var index = 0; index < Model.PayoutStateSets.Count; index++)
{
var state = Model.PayoutStateSets[index];
var stateActions = new List<(string Action, string Text)>();
switch (state.State)
{
case PayoutState.AwaitingApproval:
stateActions.Add(("approve", "Approve selected payouts"));
stateActions.Add(("approve-pay", "Approve & Send selected payouts"));
stateActions.Add(("cancel", "Cancel selected payouts"));
break;
case PayoutState.AwaitingPayment:
stateActions.Add(("pay", "Send selected payouts"));
stateActions.Add(("cancel", "Cancel selected payouts"));
break;
}
<div class="tab-pane @(index == 0 ? "active" : "") " id="@state.State" role="tabpanel">
<input type="hidden" asp-for="PayoutStateSets[index].State"/>
<input type="hidden" asp-for="PaymentMethodId"/>
@if (state.Payouts.Any() && stateActions.Any())
{
<div class="dropdown mt-2">
<button class="btn btn-primary dropdown-toggle" type="button" data-bs-toggle="dropdown" id="@state.State-actions">
Actions
</button>
<div class="dropdown-menu" aria-labelledby="@state.State-actions">
@foreach (var action in stateActions)
{
<button type="submit" id="@state.State-@action.Action" name="Command" class="dropdown-item" role="button" value="@state.State-@action.Action">@action.Text</button>
}
</div>
</div>
}
<div>
@if (state.Payouts.Any())
{
<table class="table table-sm table-responsive-lg">
<thead class="thead-inverse">
<tr>
<th>
<input id="@state.State-selectAllCheckbox" type="checkbox" onclick="selectAll(this, '@state.State.ToString()'); return true;"/>
</th>
<th style="min-width: 90px;" class="col-md-auto">
Date
</th>
<th class="text-start">Source</th>
<th class="text-start">Destination</th>
<th class="text-end">Amount</th>
@if (state.State != PayoutState.AwaitingApproval)
{
<th class="text-end">Transaction</th>
}
</tr>
</thead>
<tbody>
@for (int i = 0; i < state.Payouts.Count; i++)
{
var pp = state.Payouts[i];
<tr class="payout">
<td>
<span>
<input type="checkbox" class="selection-item-@state.State.ToString()" asp-for="PayoutStateSets[index].Payouts[i].Selected"/>
<input type="hidden" asp-for="PayoutStateSets[index].Payouts[i].PayoutId"/>
</span>
</td>
<td>
<span>@pp.Date.ToBrowserDate()</span>
</td>
<td class="mw-100">
<span>@pp.PullPaymentName</span>
</td>
<td>
<span>@pp.Destination</span>
</td>
<td class="text-end">
<span>@pp.Amount</span>
</td>
@if (state.State != PayoutState.AwaitingApproval)
{
<td class="text-end">
@if (!(pp.TransactionLink is null))
{
<a class="transaction-link" href="@pp.TransactionLink">Link</a>
}
</td>
}
</tr>
}
</tbody>
</table>
}
else
{
<p class="mb-0 p-4" id="@state.State-no-payouts">No payouts.</p>
}
</div>
</div>
}
</div>
</div>
</form>