2018-07-27 00:08:07 +09:00
@model ListTransactionsViewModel
@{
Layout = "../Shared/_NavLayout.cshtml";
2021-04-08 15:32:42 +02:00
ViewData.SetActivePageAndTitle(WalletsNavPages.Transactions, $"{Model.CryptoCode} Transactions", Context.GetStoreData().StoreName);
2018-07-27 00:08:07 +09:00
}
<style type="text/css">
.smMaxWidth {
max-width: 200px;
}
@@media (min-width: 768px) {
.smMaxWidth {
max-width: 400px;
}
}
2018-11-05 17:26:49 +09:00
2020-04-07 18:12:15 +02:00
.unconf > * {
2018-11-05 17:26:49 +09:00
opacity: 0.5;
}
2019-09-05 19:21:55 -07:00
.switchTimeFormat {
display: block;
max-width: 150px;
width: 150px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
2019-09-09 13:34:51 +09:00
2020-09-20 00:33:29 -07:00
.badge-container:not(:last-child) {
2019-09-08 11:00:57 -07:00
margin-bottom: 4px;
}
2019-09-09 20:40:32 -07:00
2020-09-20 00:33:29 -07:00
.badge-container {
display: flex;
align-items: center;
flex-wrap: nowrap;
}
2019-09-09 20:40:32 -07:00
.removeTransactionLabelForm {
display: inline;
position: absolute;
right: 4px;
}
.removeTransactionLabelForm button {
cursor: pointer;
display: inline;
padding: 0;
background-color: transparent;
border: 0;
}
2020-09-20 00:33:29 -07:00
.transaction-details-icon {
position: relative;
padding-left: 12px;
left: -8px;
}
</style>
2020-04-29 10:11:23 +02:00
2021-04-08 15:32:42 +02:00
<h4 class="mb-3">@ViewData["PageTitle"]</h4>
<p>
If BTCPay Server shows you an invalid balance, <a asp-action="WalletRescan" asp-route-walletId="@Context.GetRouteValue("walletId")">rescan your wallet</a>.
<br/>
If some transactions appear in BTCPay Server, but are missing in another wallet, <a href="https://docs.btcpayserver.org/FAQ/FAQ-Wallet/#missing-payments-in-my-software-or-hardware-wallet">follow these instructions</a>.
</p>
@if (Model.Transactions.Any())
{
@if (Model.Labels.Any())
{
<div class="row mt-4">
<div class="col-md-12">
<div class="d-flex flex-row align-items-start flex-wrap card card-body p-2">
<span class="mr-2">Filter by label:</span>
@foreach (var label in Model.Labels)
{
<a asp-route-labelFilter="@label.Text" class="badge mr-2 my-1 position-relative text-white d-block"
style="background-color: @label.Color;"><span class="text-white">@label.Text</span></a>
}
</div>
2020-04-29 10:11:23 +02:00
</div>
</div>
2021-04-08 15:32:42 +02:00
}
<div class="row">
<div class="col-md-12">
<table class="table table-sm table-responsive-lg">
<thead class="thead-inverse">
2018-07-27 00:08:07 +09:00
<tr>
2019-04-25 18:22:04 -05:00
<th style="min-width: 90px;" class="col-md-auto">
Date
<a href="javascript:switchTimeFormat()">
<span class="fa fa-clock-o" title="Switch date format"></span>
</a>
</th>
2020-04-29 10:11:23 +02:00
<th class="text-left">Label</th>
2018-07-27 00:08:07 +09:00
<th>Transaction Id</th>
2020-09-05 23:41:40 +02:00
<th class="text-right">Amount</th>
2020-04-29 10:11:23 +02:00
<th class="text-right"></th>
2018-07-27 00:08:07 +09:00
</tr>
2021-04-08 15:32:42 +02:00
</thead>
<tbody>
2018-10-26 23:07:39 +09:00
@foreach (var transaction in Model.Transactions)
2018-07-27 00:08:07 +09:00
{
2019-08-03 23:21:09 +09:00
<tr>
2019-04-25 18:22:04 -05:00
<td>
<span class="switchTimeFormat" data-switch="@transaction.Timestamp.ToTimeAgo()">
@transaction.Timestamp.ToBrowserDate()
</span>
</td>
2020-04-29 10:11:23 +02:00
<td class="text-left">
2019-08-03 00:42:30 +09:00
@foreach (var label in transaction.Labels)
{
2020-09-20 00:33:29 -07:00
<div class="badge-container">
<div
class="badge transactionLabel position-relative text-white d-block"
style="background-color: @label.Color; padding-right: 16px; z-index: 1;"
data-toggle="tooltip"
title="@label.Tooltip">
2020-12-12 14:10:47 +09:00
<a asp-route-labelFilter="@label.Text" class="text-white">@label.Text</a>
2020-09-20 00:33:29 -07:00
<form
2020-12-12 07:21:37 +01:00
asp-route-walletId="@Context.GetRouteValue("walletId")"
2020-09-20 00:33:29 -07:00
asp-action="ModifyTransaction"
method="post"
class="removeTransactionLabelForm">
<input type="hidden" name="transactionId" value="@transaction.Id"/>
<button
name="removelabel"
style="color: @label.Color; filter: brightness(0.5);"
type="submit"
2020-12-12 14:10:47 +09:00
value="@label.Text">
2020-09-20 00:33:29 -07:00
<span class="fa fa-close"></span>
</button>
</form>
</div>
2020-04-28 08:06:28 +02:00
@if (!string.IsNullOrEmpty(label.Link))
{
2020-09-20 00:33:29 -07:00
<a href="@label.Link" target="_blank" class="badge transaction-details-icon" style="background-color: @label.Color; filter: brightness(1.1);">
<span class="fa fa-info-circle" title="Transaction details" style="color: @label.Color; filter: brightness(0.5);">
<span class="sr-only">Transaction details</span>
</span>
</a>
2020-04-28 08:06:28 +02:00
}
</div>
2019-08-03 00:42:30 +09:00
}
</td>
2019-08-03 23:21:09 +09:00
<td class="smMaxWidth text-truncate @(transaction.IsConfirmed ? "" : "unconf")">
2018-07-27 00:08:07 +09:00
<a href="@transaction.Link" target="_blank">
@transaction.Id
</a>
</td>
2018-10-26 23:07:39 +09:00
@if (transaction.Positive)
2018-07-27 00:08:07 +09:00
{
2020-04-29 10:11:23 +02:00
<td style="text-align:right; color:green;" class="text-right">@transaction.Balance</td>
2018-07-27 00:08:07 +09:00
}
else
{
2020-04-29 10:11:23 +02:00
<td style="text-align:right; color:red;" class="text-right">@transaction.Balance</td>
2018-07-27 00:08:07 +09:00
}
2020-04-29 10:11:23 +02:00
<td class="text-right">
2021-04-08 15:32:42 +02:00
<div class="dropleft d-inline-block">
2020-08-04 18:51:21 -07:00
<span class="fa fa-tags cursor-pointer" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></span>
2019-08-03 00:42:30 +09:00
<div class="dropdown-menu">
2020-04-06 18:16:41 +02:00
<form asp-action="ModifyTransaction" method="post"
2021-04-08 15:32:42 +02:00
asp-route-walletId="@Context.GetRouteValue("walletId")">
<input type="hidden" name="transactionId" value="@transaction.Id"/>
2020-04-06 18:16:41 +02:00
<div class="input-group p-2">
2021-04-08 15:32:42 +02:00
<input name="addlabel" placeholder="Label name" maxlength="20" type="text" class="form-control form-control-sm"/>
2019-08-03 00:42:30 +09:00
<div class="input-group-append">
<button type="submit" class="btn btn-primary btn-sm"><span class="fa fa-plus"></span></button>
</div>
</div>
2020-04-06 18:16:41 +02:00
@if (Model.Labels.Count > 0)
2019-08-03 00:42:30 +09:00
{
2020-04-06 18:16:41 +02:00
<div class="dropdown-divider"></div>
@foreach (var label in Model.Labels)
2019-08-03 00:42:30 +09:00
{
2020-04-06 18:16:41 +02:00
@if (transaction.Labels.Contains(label))
{
2020-12-12 14:10:47 +09:00
<button name="removelabel" class="btn btn-sm" type="submit" value="@label.Text"><span class="badge" style="display:block;background-color:@label.Color;color:white;text-align:left;"><span class="fa fa-check"></span> @label.Text</span></button>
2020-04-06 18:16:41 +02:00
}
else
{
2020-12-12 14:10:47 +09:00
<button name="addlabelclick" class="btn btn-sm" type="submit" value="@label.Text"><span class="badge" style="display:block;background-color:@label.Color;color:white;text-align:left;">@label.Text</span></button>
2020-04-06 18:16:41 +02:00
}
2019-08-03 00:42:30 +09:00
}
}
</form>
</div>
</div>
2020-11-25 23:57:40 -08:00
<div class="dropleft d-inline-block">
2019-08-03 00:42:30 +09:00
@if (string.IsNullOrEmpty(transaction.Comment))
{
2020-08-04 18:51:21 -07:00
<span class="fa fa-comment cursor-pointer" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></span>
2019-08-03 00:42:30 +09:00
}
else
{
2020-08-04 18:51:21 -07:00
<span class="fa fa-commenting cursor-pointer" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></span>
2019-08-03 00:42:30 +09:00
}
<div class="dropdown-menu">
2020-04-06 18:16:41 +02:00
<form asp-action="ModifyTransaction" method="post"
2021-04-08 15:32:42 +02:00
asp-route-walletId="@Context.GetRouteValue("walletId")">
<input type="hidden" name="transactionId" value="@transaction.Id"/>
2020-04-06 18:16:41 +02:00
<div class="input-group p-2">
<textarea name="addcomment" maxlength="200" rows="2" cols="20" class="form-control form-control-sm">@transaction.Comment</textarea>
</div>
<div class="p-2">
<button type="submit" class="btn btn-primary">Save comment</button>
</div>
2019-08-03 00:42:30 +09:00
</form>
</div>
</div>
</td>
2018-07-27 00:08:07 +09:00
</tr>
}
2021-04-08 15:32:42 +02:00
</tbody>
</table>
<vc:pager view-model="Model"/>
</div>
2018-07-27 00:08:07 +09:00
</div>
2021-04-08 15:32:42 +02:00
}
else
{
<p class="text-secondary mt-3">
There are no transactions yet.
</p>
}