2024-07-25 22:46:02 +09:00
@using BTCPayServer.Abstractions.Models
2023-09-19 02:55:04 +02:00
@model WalletLabelsModel
@{
var walletId = Context.GetRouteValue("walletId").ToString();
2024-10-25 15:48:53 +02:00
ViewData.SetActivePage(WalletsNavPages.Settings, StringLocalizer["{0} Wallet Labels", Model.WalletId.CryptoCode], walletId);
2023-09-19 02:55:04 +02:00
}
@section PageFootContent {
<script>
delegate('click', '.btn-delete', event => { event.preventDefault() })
</script>
}
2024-07-25 22:46:02 +09:00
<h2 class="mb-2 mb-lg-3" text-translate="true">@ViewData["Title"]</h2>
2024-06-19 15:23:10 +02:00
<partial name="_StatusMessage" />
2023-09-19 02:55:04 +02:00
@if (Model.Labels.Any())
{
2024-06-19 15:23:10 +02:00
<div class="table-responsive-md">
<table class="table table-hover">
<thead>
<tr>
2024-10-17 15:51:40 +02:00
<th text-translate="true">Label</th>
<th text-translate="true" class="text-end">Actions</th>
2024-06-19 15:23:10 +02:00
</tr>
</thead>
<tbody>
@foreach (var label in Model.Labels)
{
2023-09-19 02:55:04 +02:00
<tr>
<td>
<div class="transaction-label" style="--label-bg:@label.Color;--label-fg:@label.TextColor">
<span>@label.Label</span>
</div>
</td>
<td class="text-end">
<form method="post" asp-action="RemoveWalletLabel" asp-route-walletId="@Model.WalletId" asp-route-id="@label.Label">
2024-10-25 15:48:53 +02:00
<button class="btn btn-link btn-delete p-0" type="submit" data-bs-toggle="modal" data-bs-target="#ConfirmModal" data-description="@StringLocalizer["The label {0} will be removed from this wallet and its associated transactions.", Html.Encode(label.Label)]" data-confirm-input="@StringLocalizer["DELETE"]" text-translate="true">Remove</button>
2023-09-19 02:55:04 +02:00
</form>
</td>
</tr>
2024-06-19 15:23:10 +02:00
}
</tbody>
</table>
</div>
2024-10-25 15:48:53 +02:00
<partial name="_Confirm" model="@(new ConfirmModel(StringLocalizer["Remove label"], StringLocalizer["This label will be removed from this wallet and its associated transactions."], StringLocalizer["Remove"]))" />
2023-09-19 02:55:04 +02:00
}
else
{
<p class="text-secondary mt-3">
2024-10-25 15:48:53 +02:00
@ViewLocalizer["There are no custom labels yet. You can create custom labels by assigning them to your {0}.",
Html.ActionLink(StringLocalizer["transactions"], "WalletTransactions", "UIWallets", new { walletId })]
2023-09-19 02:55:04 +02:00
</p>
}