]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/menu/avatar-notification.component.html
Replace keyboard shortcut icon
[github/Chocobozzz/PeerTube.git] / client / src / app / menu / avatar-notification.component.html
index 2f0b7c669480a8ccdc5ef9ca4e4222ea1ecaa028..b24bd030910ee0b864d96d2429016dd865c0e4d2 100644 (file)
@@ -1,6 +1,6 @@
 <div
   [ngbPopover]="popContent" autoClose="outside" placement="bottom-left" container="body" popoverClass="popover-notifications"
-  i18n-title title="View your notifications" class="notification-avatar" #popover="ngbPopover"
+  i18n-title title="View your notifications" class="notification-avatar" #popover="ngbPopover" (hidden)="onPopoverHidden()"
 >
   <div *ngIf="unreadNotifications > 0" class="unread-notifications">{{ unreadNotifications }}</div>
 
@@ -8,16 +8,36 @@
 </div>
 
 <ng-template #popContent>
-  <div class="notifications-header">
-    <div i18n>Notifications</div>
+  <div class="content" [ngClass]="{ loaded: loaded }">
+    <div class="notifications-header">
+      <div i18n>Notifications</div>
 
-    <a
-      i18n-title title="Update your notification preferences" class="glyphicon glyphicon-cog"
-      routerLink="/my-account/settings" fragment="notifications"
-    ></a>
-  </div>
+      <div>
+        <button
+          *ngIf="unreadNotifications"
+          i18n-title title="Mark all as read" class="glyphicon glyphicon-inbox mr-2"
+          (click)="markAllAsRead()"
+        ></button>
+        <a
+          i18n-title title="Update your notification preferences" class="glyphicon glyphicon-cog"
+          routerLink="/my-account/settings" fragment="notifications"
+          #settingsNotifications (click)="onNavigate(settingsNotifications)"
+        ></a>
+      </div>
+    </div>
+
+    <div *ngIf="!loaded" class="loader mt-4">
+      <my-loader [loading]="!loaded"></my-loader>
+    </div>
 
-  <my-user-notifications [ignoreLoadingBar]="true" [infiniteScroll]="false"></my-user-notifications>
+    <my-user-notifications
+      [ignoreLoadingBar]="true" [infiniteScroll]="false" [itemsPerPage]="10"
+      [markAllAsReadSubject]="markAllAsReadSubject" (notificationsLoaded)="onNotificationLoaded()"
+    ></my-user-notifications>
 
-  <a class="all-notifications" routerLink="/my-account/notifications" i18n>See all your notifications</a>
+    <a *ngIf="loaded" class="all-notifications" routerLink="/my-account/notifications" #notifications (click)="onNavigate(notifications)">
+      <my-global-icon class="mr-1" iconName="inbox-full" aria-hidden="true"></my-global-icon>
+      <span i18n>See all your notifications</span>
+    </a>
+  </div>
 </ng-template>