mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-23 14:40:36 +01:00
107 lines
4.3 KiB
Text
107 lines
4.3 KiB
Text
@model BTCPayServer.Models.NotificationViewModels.IndexViewModel
|
|
@{
|
|
ViewData["Title"] = "Notifications";
|
|
}
|
|
|
|
<section>
|
|
<div class="container">
|
|
@if (TempData.HasStatusMessage())
|
|
{
|
|
<div class="row">
|
|
<div class="col-lg-12 text-center">
|
|
<partial name="_StatusMessage" />
|
|
</div>
|
|
</div>
|
|
}
|
|
<div class="row">
|
|
<div class="col-lg-12 section-heading">
|
|
<h2>@ViewData["Title"]</h2>
|
|
<hr class="primary">
|
|
</div>
|
|
</div>
|
|
<div class="row button-row">
|
|
<div class="col-lg-6">
|
|
<span class="dropdown" style="display:none;" id="MassAction">
|
|
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
Actions
|
|
</button>
|
|
<form method="post" asp-action="MassAction" class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
|
@Html.Hidden("csvGuids")
|
|
<button type="submit" class="dropdown-item" name="command" value="delete"><i class="fa fa-trash-o"></i> Delete</button>
|
|
</form>
|
|
</span>
|
|
<a class="btn btn-primary" role="button" asp-action="Generate" id="Generate"><span class="fa fa-plus"></span> Generate Test Notification</a>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-lg-12">
|
|
<table class="table table-sm table-responsive-md">
|
|
<thead>
|
|
<tr>
|
|
<th width="30px"></th>
|
|
<th width="165px">Date</th>
|
|
<th>Message</th>
|
|
<th width="80px"> </th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var item in Model.Items)
|
|
{
|
|
@* TODO: Multiselect akin to Gmail *@
|
|
<tr data-guid="@item.Id">
|
|
<td><input type="checkbox" class="selector" data-guid="@item.Id" /></td>
|
|
<td onclick="rowseen(this)" class="cursor-pointer @(item.Seen ? "": "font-weight-bold")">@item.Created.ToBrowserDate()</td>
|
|
<td onclick="rowseen(this)" class="cursor-pointer @(item.Seen ? "": "font-weight-bold")">@item.Body</td>
|
|
<td>
|
|
@if (!String.IsNullOrEmpty(item.ActionLink))
|
|
{
|
|
<a href="@item.ActionLink">Action <i class="fa fa-angle-double-right"></i></a>
|
|
}
|
|
else
|
|
{
|
|
<span> </span>
|
|
}
|
|
</td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
|
|
<nav aria-label="...">
|
|
<ul class="pagination">
|
|
</ul>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<script type="text/javascript">
|
|
function rowseen(sender) {
|
|
var weightClassName = "font-weight-bold";
|
|
$(sender).parent().children(".cursor-pointer").toggleClass(weightClassName);
|
|
|
|
$.post("/Notifications/FlipRead/" + $(sender).parent().data("guid"), function (data) {
|
|
});
|
|
}
|
|
|
|
$(function () {
|
|
$(".selector").change(updateSelectors);
|
|
updateSelectors();
|
|
});
|
|
|
|
function updateSelectors() {
|
|
var count = $(".selector:checked").length;
|
|
if (count > 0) {
|
|
$("#MassAction").children().eq(0).text("Batch Action (" + count + ")");
|
|
$("#MassAction").show();
|
|
var csvGuids = [];
|
|
$(".selector:checked").each(function () {
|
|
csvGuids.push($(this).data("guid"));
|
|
});
|
|
$("#csvGuids").val(csvGuids.join(","));
|
|
} else {
|
|
$("#MassAction").hide();
|
|
}
|
|
}
|
|
</script>
|