mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-28 16:58:00 +01:00
* Add No JS support for notification seen toggle * Invalidate cache when user toggles seen/massaction * mark notif as seen after click * add additional mass actions * fix formatting * add pav changes * invalidate cache on new notifs
35 lines
1.5 KiB
Text
35 lines
1.5 KiB
Text
@inject BTCPayServer.Services.Notifications.NotificationManager notificationManager
|
|
|
|
@{
|
|
var notificationModel = await notificationManager.GetSummaryNotifications(User);
|
|
}
|
|
|
|
@if (notificationModel.UnseenCount > 0)
|
|
{
|
|
<li class="nav-item dropdown">
|
|
<a class="nav-link js-scroll-trigger" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" id="Notifications">
|
|
<i class="fa fa-bell"></i>
|
|
</a>
|
|
<span class="alerts-badge badge badge-pill badge-danger">@notificationModel.UnseenCount</span>
|
|
<div class="dropdown-menu dropdown-menu-right text-center" aria-labelledby="navbarDropdown">
|
|
@foreach (var notif in notificationModel.Last5)
|
|
{
|
|
<a asp-action="NotificationPassThrough" asp-controller="Notifications" asp-route-id="@notif.Id" class="dropdown-item border-bottom">
|
|
<div class="text-left" style="width: 200px; white-space:normal;">
|
|
@notif.Body
|
|
</div>
|
|
<div class="text-left">
|
|
<small class="text-muted">@notif.Created.ToTimeAgo()</small>
|
|
</div>
|
|
</a>
|
|
}
|
|
<a class="dropdown-item text-info" asp-controller="Notifications" asp-action="Index">See All</a>
|
|
</div>
|
|
</li>
|
|
}
|
|
else
|
|
{
|
|
<li class="nav-item">
|
|
<a asp-controller="Notifications" asp-action="Index" title="Notifications" class="nav-link js-scroll-trigger" id="Notifications"><i class="fa fa-bell"></i></a>
|
|
</li>
|
|
}
|