btcpayserver/BTCPayServer/Views/Shared/LayoutPartials/NotificationsNavItem.cshtml
Andrew Camilleri 13569fe4a2
Improve notifications UI (#1678)
* 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
2020-06-23 10:06:02 +09:00

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>
}