mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-10-24 16:48:55 +00:00
Enhancement: notifications improvements (#14500)
This commit is contained in:
1 parent
c657fceea5
commit
98fb7c3b63
77 files changed
+1535
-627
No files matched your search
+20
-17
@@ -1,28 +1,31 @@
|
||||
|
||||
<li ngbDropdown class="nav-item position-relative" (openChange)="onOpenChange($event)">
|
||||
@if (toasts().length) {
|
||||
<span class="notification-count badge rounded-pill z-3 pe-none bg-secondary position-absolute">{{ toasts().length }}</span>
|
||||
@if (unread().length) {
|
||||
<span class="notification-count badge rounded-pill z-3 pe-none position-absolute" [class.bg-danger]="hasUnreadError()" [class.bg-secondary]="!hasUnreadError()">{{ unread().length }}</span>
|
||||
}
|
||||
<button class="btn navbar-action border-0" id="notificationsDropdown" ngbDropdownToggle aria-label="Notifications" i18n-aria-label>
|
||||
<i-bs width="1.3em" height="1.3em" name="bell"></i-bs>
|
||||
</button>
|
||||
<div ngbDropdownMenu class="dropdown-menu-end shadow p-3" aria-labelledby="notificationsDropdown">
|
||||
<div class="btn-toolbar align-items-center" role="toolbar">
|
||||
<h6 i18n>Notifications</h6>
|
||||
<div class="btn-group ms-auto">
|
||||
<button class="btn btn-sm btn-outline-secondary mb-2 ms-auto"
|
||||
(click)="toastService.clearToasts()"
|
||||
[disabled]="toasts().length === 0"
|
||||
i18n>Clear All</button>
|
||||
</div>
|
||||
<div ngbDropdownMenu class="dropdown-menu-end shadow p-2" aria-labelledby="notificationsDropdown">
|
||||
<div class="d-flex align-items-center px-1 mb-2">
|
||||
<h6 class="mb-0" i18n>Notifications</h6>
|
||||
@if (toasts().length) {
|
||||
<button class="btn btn-link btn-sm p-0 ms-auto text-body-secondary text-decoration-none clear-all"
|
||||
(click)="toastService.clearToasts()">
|
||||
<i-bs width="1em" height="1em" name="check2-all" class="me-1"></i-bs><ng-container i18n>Clear All</ng-container>
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
@if (toasts().length === 0) {
|
||||
<p class="text-center mb-0 small text-muted"><em i18n>No notifications</em></p>
|
||||
}
|
||||
<div class="scroll-list">
|
||||
@for (toast of toasts(); track toast.id) {
|
||||
<pngx-toast [autohide]="false" [toast]="toast" (hidden)="onHidden(toast)" (closed)="toastService.closeToast(toast)"></pngx-toast>
|
||||
}
|
||||
<div class="text-center text-body-secondary small py-4">
|
||||
<i-bs width="1.5em" height="1.5em" name="bell" class="d-block mx-auto mb-2 opacity-50"></i-bs>
|
||||
<ng-container i18n>No notifications</ng-container>
|
||||
</div>
|
||||
}
|
||||
<div class="scroll-list d-flex flex-column gap-2">
|
||||
@for (toast of toasts(); track toast.id) {
|
||||
<pngx-toast [autohide]="false" [toast]="toast" [now]="now()" [isNew]="newIds().has(toast.id)" (closed)="toastService.closeToast(toast)" (actioned)="onActioned(toast)"></pngx-toast>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
Reference in new issue
Block a user