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