]>
Commit | Line | Data |
---|---|---|
1 | <ng-template #notificationNumber> | |
2 | <div *ngIf="unreadNotifications > 0 && unreadNotifications < 100" class="unread-notifications">{{ unreadNotifications }}</div> | |
3 | <div *ngIf="unreadNotifications >= 100" class="unread-notifications">99+</div> | |
4 | </ng-template> | |
5 | ||
6 | <div | |
7 | [ngbPopover]="popContent" autoClose="outside" placement="bottom" container={this} popoverClass="popover-notifications" | |
8 | i18n-title title="View your notifications" [ngClass]="{ 'notification-inbox-popover': true, 'shown': opened, 'hidden': isInMobileView }" | |
9 | #popover="ngbPopover" (shown)="onPopoverShown()" (hidden)="onPopoverHidden()" | |
10 | > | |
11 | <ng-container *ngTemplateOutlet="notificationNumber"></ng-container> | |
12 | ||
13 | <my-global-icon iconName="bell"></my-global-icon> | |
14 | </div> | |
15 | ||
16 | <div *ngIf="isInMobileView" i18n-title title="View your notifications" class="notification-inbox-link"> | |
17 | <ng-container *ngTemplateOutlet="notificationNumber"></ng-container> | |
18 | ||
19 | <a routerLink="/my-account/notifications" routerLinkActive="active" #link (click)="onNavigate(link)"> | |
20 | <my-global-icon iconName="bell"></my-global-icon> | |
21 | </a> | |
22 | </div> | |
23 | ||
24 | <ng-template #popContent> | |
25 | <div class="content" [ngClass]="{ loaded: loaded }"> | |
26 | <div class="notifications-header"> | |
27 | <div i18n>Notifications</div> | |
28 | ||
29 | <div> | |
30 | <button | |
31 | *ngIf="unreadNotifications" | |
32 | i18n-title title="Mark all as read" class="me-2" | |
33 | (click)="markAllAsRead()" | |
34 | > | |
35 | <my-global-icon iconName="tick"></my-global-icon> | |
36 | </button> | |
37 | ||
38 | <a | |
39 | i18n-title title="Update your notification preferences" | |
40 | routerLink="/my-account/settings" fragment="notifications" | |
41 | #settingsNotifications (click)="onNavigate(settingsNotifications)" | |
42 | > | |
43 | <my-global-icon iconName="cog"></my-global-icon> | |
44 | </a> | |
45 | </div> | |
46 | </div> | |
47 | ||
48 | <div *ngIf="!loaded" class="loader mt-4"> | |
49 | <my-loader size="xl" [loading]="!loaded"></my-loader> | |
50 | </div> | |
51 | ||
52 | <my-user-notifications | |
53 | [ignoreLoadingBar]="true" [infiniteScroll]="false" [itemsPerPage]="10" | |
54 | [markAllAsReadSubject]="markAllAsReadSubject" (notificationsLoaded)="onNotificationLoaded()" | |
55 | ></my-user-notifications> | |
56 | ||
57 | <a *ngIf="loaded" class="all-notifications" routerLink="/my-account/notifications" #notifications (click)="onNavigate(notifications)"> | |
58 | <my-global-icon class="me-1" iconName="bell" aria-hidden="true"></my-global-icon> | |
59 | <span i18n>See all your notifications</span> | |
60 | </a> | |
61 | </div> | |
62 | </ng-template> |