mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-04 09:58:13 +01:00
57 lines
3 KiB
Text
57 lines
3 KiB
Text
@inject UserManager<ApplicationUser> UserManager
|
|
@inject ISettingsRepository SettingsRepository
|
|
@using BTCPayServer.HostedServices
|
|
@using BTCPayServer.Views.Notifications
|
|
@using BTCPayServer.Abstractions.Extensions
|
|
@using BTCPayServer.Abstractions.Contracts
|
|
@using BTCPayServer.Client
|
|
@using BTCPayServer.Services
|
|
@model BTCPayServer.Components.NotificationsDropdown.NotificationSummaryViewModel
|
|
@addTagHelper *, BundlerMinifier.TagHelpers
|
|
|
|
@if (Model.UnseenCount > 0)
|
|
{
|
|
<li class="nav-item dropdown" id="notifications-nav-item">
|
|
<a class="nav-link js-scroll-trigger @ViewData.IsActiveCategory(typeof(NotificationsNavPages))" href="#" id="NotificationsDropdownToggle" role="button" data-bs-toggle="dropdown">
|
|
<span class="d-inline-block d-lg-none">Notifications</span>
|
|
<i class="fa fa-bell d-lg-inline-block d-none"></i>
|
|
<span class="notification-badge badge rounded-pill bg-danger">@Model.UnseenCount</span>
|
|
</a>
|
|
<div class="dropdown-menu dropdown-menu-end text-center notification-dropdown" aria-labelledby="NotificationsDropdownToggle">
|
|
<div class="d-flex align-items-center justify-content-between py-3 px-4 border-bottom border-light">
|
|
<h5 class="m-0">Notifications</h5>
|
|
<form id="notificationsForm" asp-controller="Notifications" asp-action="MarkAllAsSeen" asp-route-returnUrl="@Context.Request.GetCurrentPathWithQueryString()" method="post">
|
|
<button class="btn btn-link p-0" type="submit">Mark all as seen</button>
|
|
</form>
|
|
</div>
|
|
@foreach (var notif in Model.Last5)
|
|
{
|
|
<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">
|
|
<div class="me-3">
|
|
<vc:icon symbol="note" />
|
|
</div>
|
|
|
|
<div class="notification-item__content">
|
|
<div class="text-start text-wrap">
|
|
@notif.Body
|
|
</div>
|
|
<div class="text-start d-flex">
|
|
<small class="text-muted" data-timeago-unixms="@notif.Created.ToUnixTimeMilliseconds()">@notif.Created.ToTimeAgo()</small>
|
|
</div>
|
|
</div>
|
|
</a>
|
|
}
|
|
<div class="p-3">
|
|
<a asp-controller="Notifications" asp-action="Index">View all</a>
|
|
</div>
|
|
</div>
|
|
</li>
|
|
}
|
|
else
|
|
{
|
|
<li class="nav-item" id="notifications-nav-item">
|
|
<a asp-controller="Notifications" asp-action="Index" title="Notifications" class="nav-link js-scroll-trigger @ViewData.IsActiveCategory(typeof(NotificationsNavPages))" id="Notifications">
|
|
<span class="d-lg-none d-sm-block">Notifications</span><i class="fa fa-bell d-lg-inline-block d-none"></i>
|
|
</a>
|
|
</li>
|
|
}
|