2022-01-07 12:32:00 +09: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
|
|
|
|
2021-12-11 04:32:23 +01:00
|
|
|
<partial name="_StatusMessage" />
|
2021-04-08 15:32:42 +02:00
|
|
|
|
2021-12-11 04:32:23 +01:00
|
|
|
<div class="d-flex flex-wrap align-items-center justify-content-between mb-2">
|
|
|
|
<h2>@ViewData["Title"]</h2>
|
2022-01-07 12:32:00 +09:00
|
|
|
<a id="NotificationSettings" asp-controller="UIManage" asp-action="NotificationSettings" class="btn btn-secondary">
|
2021-12-11 04:32:23 +01:00
|
|
|
Settings
|
|
|
|
</a>
|
|
|
|
</div>
|
2022-05-02 16:35:28 +09:00
|
|
|
@if (Model.Items.Count > 0)
|
2021-12-11 04:32:23 +01:00
|
|
|
{
|
|
|
|
<form method="post" asp-action="MassAction">
|
2023-11-02 08:12:28 +01:00
|
|
|
@if (Model.Items.Any())
|
|
|
|
{
|
|
|
|
<div class="table-responsive-md">
|
|
|
|
<table class="table table-hover mass-action">
|
|
|
|
<thead class="mass-action-head">
|
2021-12-11 04:32:23 +01:00
|
|
|
<tr>
|
2023-11-02 08:12:28 +01:00
|
|
|
<th class="mass-action-select-col only-for-js">
|
|
|
|
<input name="selectedItems" type="checkbox" class="form-check-input mass-action-select-all" />
|
2021-12-11 04:32:23 +01:00
|
|
|
</th>
|
2023-11-02 08:12:28 +01:00
|
|
|
<th class="date-col">
|
2022-10-07 06:29:03 +02:00
|
|
|
<div class="d-flex align-items-center gap-1">
|
|
|
|
Date
|
|
|
|
<button type="button" class="btn btn-link p-0 fa fa-clock-o switch-time-format" title="Switch date format"></button>
|
|
|
|
</div>
|
2021-12-11 04:32:23 +01:00
|
|
|
</th>
|
|
|
|
<th>Message</th>
|
2023-11-02 08:12:28 +01:00
|
|
|
<th></th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<thead class="mass-action-actions">
|
|
|
|
<tr>
|
|
|
|
<th class="mass-action-select-col only-for-js">
|
|
|
|
<input type="checkbox" class="form-check-input mass-action-select-all" />
|
|
|
|
</th>
|
|
|
|
<th colspan="6">
|
|
|
|
<div class="d-flex flex-wrap align-items-center justify-content-between gap-3">
|
|
|
|
<div>
|
|
|
|
<strong class="mass-action-selected-count">0</strong>
|
|
|
|
selected
|
|
|
|
</div>
|
|
|
|
<div class="d-inline-flex align-items-center gap-3">
|
|
|
|
<button type="submit" name="command" value="mark-seen" class="btn btn-link gap-1">
|
|
|
|
<i class="fa fa-eye"></i>
|
|
|
|
Mark seen
|
|
|
|
</button>
|
|
|
|
<button type="submit" name="command" value="mark-unseen" class="btn btn-link gap-1">
|
|
|
|
<i class="fa fa-eye-slash"></i>
|
|
|
|
Mark unseen
|
|
|
|
</button>
|
|
|
|
<button type="submit" name="command" value="delete" class="btn btn-link gap-1">
|
|
|
|
<i class="fa fa-trash-o"></i>
|
|
|
|
Delete
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</th>
|
2021-12-11 04:32:23 +01:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
@foreach (var item in Model.Items)
|
|
|
|
{
|
2023-11-02 08:12:28 +01:00
|
|
|
<tr data-guid="@item.Id" class="notification-row mass-action-row @(item.Seen ? "seen" : "")">
|
|
|
|
<td class="only-for-js mass-action-select-col">
|
|
|
|
<input name="selectedItems" type="checkbox" class="form-check-input mass-action-select" value="@item.Id" />
|
2021-12-11 04:32:23 +01:00
|
|
|
</td>
|
2023-11-02 08:12:28 +01:00
|
|
|
<td class="date-col">@item.Created.ToBrowserDate()</td>
|
|
|
|
<td>
|
2021-12-11 04:32:23 +01:00
|
|
|
@item.Body
|
|
|
|
</td>
|
2023-11-02 08:12:28 +01:00
|
|
|
<td class="text-end">
|
|
|
|
<div class="d-inline-flex align-items-center gap-3">
|
|
|
|
<button class="btn btn-link p-0 btn-toggle-seen" type="submit" name="command" value="flip-individual:@(item.Id)">
|
|
|
|
<span>Mark</span> <span class="seen-text"></span>
|
|
|
|
</button>
|
|
|
|
@if (!string.IsNullOrEmpty(item.ActionLink))
|
|
|
|
{
|
|
|
|
<a href="@item.ActionLink" class="btn btn-link p-0" rel="noreferrer noopener">Details</a>
|
|
|
|
}
|
|
|
|
</div>
|
2021-12-11 04:32:23 +01:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2020-06-13 19:19:21 -05:00
|
|
|
|
2021-12-11 04:32:23 +01:00
|
|
|
<vc:pager view-model="Model" />
|
|
|
|
</div>
|
2023-11-02 08:12:28 +01:00
|
|
|
}
|
2021-12-11 04:32:23 +01:00
|
|
|
</form>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
<p class="text-secondary mt-3">
|
|
|
|
There are no notifications.
|
|
|
|
</p>
|
|
|
|
}
|
2020-06-10 22:41:52 -05:00
|
|
|
|
2020-06-23 03:06:02 +02:00
|
|
|
<style>
|
2021-07-04 20:22:24 -07:00
|
|
|
.notification-row.loading {
|
|
|
|
cursor: wait;
|
|
|
|
pointer-events: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.seen-text::after {
|
|
|
|
content: "seen";
|
|
|
|
}
|
|
|
|
|
|
|
|
tr.seen td .seen-text::after {
|
|
|
|
content: "unseen";
|
|
|
|
}
|
|
|
|
|
|
|
|
tr td {
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
|
|
|
|
tr.seen td {
|
|
|
|
font-weight: normal;
|
|
|
|
}
|
2020-06-23 03:06:02 +02:00
|
|
|
</style>
|
2021-10-05 08:52:14 +02:00
|
|
|
|
|
|
|
@section PageFootContent {
|
|
|
|
<script type="text/javascript">
|
|
|
|
delegate('click', '.btn-toggle-seen', e => {
|
|
|
|
const row = $(e.target).parents(".notification-row").toggleClass("loading");
|
|
|
|
const guid = row.data("guid");
|
2022-01-07 12:32:00 +09:00
|
|
|
const url = "@Url.Action("FlipRead", "UINotifications", new { id = "placeholder" })".replace("placeholder", guid);
|
2021-10-05 08:52:14 +02:00
|
|
|
$.post(url, function (data) {
|
|
|
|
row.toggleClass("seen loading");
|
|
|
|
});
|
|
|
|
return false;
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
}
|