2020-05-27 18:35:25 -05:00
|
|
|
@model BTCPayServer.Models.NotificationViewModels.IndexViewModel
|
2020-05-03 17:42:01 -06:00
|
|
|
@{
|
2020-05-28 16:19:02 -05:00
|
|
|
ViewData["Title"] = "Notifications";
|
2020-05-03 17:42:01 -06:00
|
|
|
}
|
2020-06-11 17:40:40 -05:00
|
|
|
|
2020-05-03 17:42:01 -06:00
|
|
|
<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">
|
2020-05-28 22:32:31 -05:00
|
|
|
<h2>@ViewData["Title"]</h2>
|
2020-05-03 17:42:01 -06:00
|
|
|
<hr class="primary">
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-05-28 22:32:31 -05:00
|
|
|
<div class="row button-row">
|
|
|
|
<div class="col-lg-6">
|
2020-06-10 23:41:18 -05:00
|
|
|
<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>
|
2020-05-28 22:32:31 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-05-03 17:42:01 -06:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-12">
|
|
|
|
<table class="table table-sm table-responsive-md">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2020-06-10 23:40:40 -05:00
|
|
|
<th width="30px"></th>
|
2020-05-28 22:32:31 -05:00
|
|
|
<th width="165px">Date</th>
|
2020-05-03 17:42:01 -06:00
|
|
|
<th>Message</th>
|
2020-06-11 00:27:05 -05:00
|
|
|
<th width="80px"> </th>
|
2020-05-03 17:42:01 -06:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
@foreach (var item in Model.Items)
|
|
|
|
{
|
2020-05-28 22:57:18 -05:00
|
|
|
@* TODO: Multiselect akin to Gmail *@
|
2020-06-10 23:40:40 -05:00
|
|
|
<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>
|
2020-05-28 16:19:02 -05:00
|
|
|
<td>
|
|
|
|
@if (!String.IsNullOrEmpty(item.ActionLink))
|
|
|
|
{
|
2020-06-11 00:27:05 -05:00
|
|
|
<a href="@item.ActionLink">Action <i class="fa fa-angle-double-right"></i></a>
|
2020-05-28 16:19:02 -05:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
<span> </span>
|
|
|
|
}
|
2020-05-28 22:32:31 -05:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
}
|
2020-05-03 17:42:01 -06:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<nav aria-label="...">
|
|
|
|
<ul class="pagination">
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</section>
|
2020-06-10 22:41:52 -05:00
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
function rowseen(sender) {
|
|
|
|
var weightClassName = "font-weight-bold";
|
2020-06-10 23:40:40 -05:00
|
|
|
$(sender).parent().children(".cursor-pointer").toggleClass(weightClassName);
|
2020-06-10 22:41:52 -05:00
|
|
|
|
2020-06-10 23:40:40 -05:00
|
|
|
$.post("/Notifications/FlipRead/" + $(sender).parent().data("guid"), function (data) {
|
2020-06-10 22:41:52 -05:00
|
|
|
});
|
|
|
|
}
|
2020-06-10 23:41:18 -05:00
|
|
|
|
|
|
|
$(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();
|
|
|
|
}
|
|
|
|
}
|
2020-06-10 22:41:52 -05:00
|
|
|
</script>
|