2020-10-20 13:09:09 +02:00
|
|
|
@inject UserManager<ApplicationUser> UserManager
|
2021-07-27 14:08:54 +02:00
|
|
|
@inject ISettingsRepository SettingsRepository
|
2020-10-20 13:09:09 +02:00
|
|
|
@using BTCPayServer.HostedServices
|
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
|
|
|
|
@using BTCPayServer.Client
|
|
|
|
@using BTCPayServer.Services
|
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
|
|
|
|
|
|
|
@if (Model.UnseenCount > 0)
|
|
|
|
{
|
|
|
|
<li class="nav-item dropdown" id="notifications-nav-item">
|
2021-05-19 04:39:27 +02:00
|
|
|
<a class="nav-link js-scroll-trigger @ViewData.IsActiveCategory(typeof(NotificationsNavPages))" href="#" id="NotificationsDropdownToggle" role="button" data-bs-toggle="dropdown">
|
2021-04-21 17:38:17 +02:00
|
|
|
<span class="d-inline-block d-lg-none">Notifications</span>
|
|
|
|
<i class="fa fa-bell d-lg-inline-block d-none"></i>
|
2021-05-19 04:39:27 +02:00
|
|
|
<span class="notification-badge badge rounded-pill bg-danger">@Model.UnseenCount</span>
|
2020-06-24 10:23:16 +02:00
|
|
|
</a>
|
2021-05-19 04:39:27 +02:00
|
|
|
<div class="dropdown-menu dropdown-menu-end text-center notification-dropdown" aria-labelledby="NotificationsDropdownToggle">
|
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>
|
|
|
|
</li>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
<li class="nav-item" id="notifications-nav-item">
|
2021-03-19 12:05:46 +01:00
|
|
|
<a asp-controller="Notifications" asp-action="Index" title="Notifications" class="nav-link js-scroll-trigger @ViewData.IsActiveCategory(typeof(NotificationsNavPages))" id="Notifications">
|
2021-03-05 08:48:15 +01:00
|
|
|
<span class="d-lg-none d-sm-block">Notifications</span><i class="fa fa-bell d-lg-inline-block d-none"></i>
|
2020-06-24 10:23:16 +02:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
}
|