2020-10-20 13:09:09 +02:00
|
|
|
@inject UserManager<ApplicationUser> UserManager
|
2021-07-27 14:08:54 +02:00
|
|
|
@inject ISettingsRepository SettingsRepository
|
2021-03-19 12:05:46 +01:00
|
|
|
@using BTCPayServer.Views.Notifications
|
2021-07-27 20:00:33 +02:00
|
|
|
@using BTCPayServer.Abstractions.Extensions
|
2021-07-27 14:08:54 +02:00
|
|
|
@using BTCPayServer.Abstractions.Contracts
|
2020-08-12 16:02:13 +09:00
|
|
|
@model BTCPayServer.Components.NotificationsDropdown.NotificationSummaryViewModel
|
2021-01-07 01:07:42 -08:00
|
|
|
@addTagHelper *, BundlerMinifier.TagHelpers
|
2020-06-24 10:23:16 +02:00
|
|
|
|
2021-12-11 04:32:23 +01:00
|
|
|
<div id="Notifications">
|
|
|
|
@if (Model.UnseenCount > 0)
|
|
|
|
{
|
|
|
|
<button id="NotificationsHandle" class="mainMenuButton @ViewData.IsActiveCategory(typeof(NotificationsNavPages))" title="Notifications" type="button" data-bs-toggle="dropdown">
|
|
|
|
<vc:icon symbol="notifications" />
|
|
|
|
<span class="badge rounded-pill bg-danger p-1 ms-1" id="NotificationsBadge">@Model.UnseenCount</span>
|
|
|
|
</button>
|
|
|
|
<div class="dropdown-menu text-center" id="NotificationsDropdown" aria-labelledby="NotificationsHandle">
|
2021-01-07 01:07:42 -08:00
|
|
|
<div class="d-flex align-items-center justify-content-between py-3 px-4 border-bottom border-light">
|
|
|
|
<h5 class="m-0">Notifications</h5>
|
2021-07-16 09:57:37 +02:00
|
|
|
<form id="notificationsForm" asp-controller="Notifications" asp-action="MarkAllAsSeen" asp-route-returnUrl="@Context.Request.GetCurrentPathWithQueryString()" method="post">
|
2021-04-07 19:37:35 -07:00
|
|
|
<button class="btn btn-link p-0" type="submit">Mark all as seen</button>
|
2021-01-07 01:07:42 -08:00
|
|
|
</form>
|
|
|
|
</div>
|
2020-06-24 10:23:16 +02:00
|
|
|
@foreach (var notif in Model.Last5)
|
|
|
|
{
|
2021-01-07 01:07:42 -08:00
|
|
|
<a asp-action="NotificationPassThrough" asp-controller="Notifications" asp-route-id="@notif.Id" class="notification d-flex align-items-center dropdown-item border-bottom border-light py-3 px-4">
|
2021-05-19 04:39:27 +02:00
|
|
|
<div class="me-3">
|
2021-01-07 01:07:42 -08:00
|
|
|
<vc:icon symbol="note" />
|
2020-06-24 10:23:16 +02:00
|
|
|
</div>
|
2021-01-07 01:07:42 -08:00
|
|
|
<div class="notification-item__content">
|
2021-05-19 04:39:27 +02:00
|
|
|
<div class="text-start text-wrap">
|
2021-01-07 01:07:42 -08:00
|
|
|
@notif.Body
|
|
|
|
</div>
|
2021-05-19 04:39:27 +02:00
|
|
|
<div class="text-start d-flex">
|
2021-01-07 01:07:42 -08:00
|
|
|
<small class="text-muted" data-timeago-unixms="@notif.Created.ToUnixTimeMilliseconds()">@notif.Created.ToTimeAgo()</small>
|
|
|
|
</div>
|
2020-06-24 10:23:16 +02:00
|
|
|
</div>
|
|
|
|
</a>
|
|
|
|
}
|
2021-01-07 01:07:42 -08:00
|
|
|
<div class="p-3">
|
2021-04-07 19:37:35 -07:00
|
|
|
<a asp-controller="Notifications" asp-action="Index">View all</a>
|
2021-01-07 01:07:42 -08:00
|
|
|
</div>
|
2020-06-24 10:23:16 +02:00
|
|
|
</div>
|
2021-12-11 04:32:23 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
<a asp-controller="Notifications" asp-action="Index" id="NotificationsHandle" class="mainMenuButton @ViewData.IsActiveCategory(typeof(NotificationsNavPages))" title="Notifications">
|
|
|
|
<vc:icon symbol="notifications" />
|
2020-06-24 10:23:16 +02:00
|
|
|
</a>
|
2021-12-11 04:32:23 +01:00
|
|
|
}
|
|
|
|
</div>
|