btcpayserver/BTCPayServer/Views/Shared/LayoutPartials/NotificationsNavItem.cshtml

36 lines
1.5 KiB
Text
Raw Normal View History

@inject BTCPayServer.Services.Notifications.NotificationManager notificationManager
@{
2020-06-17 11:26:21 +09:00
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>
}