aboutsummaryrefslogblamecommitdiffhomepage
path: root/client/src/app/menu/notification.component.html
blob: 907828efb7cb070eb8a0478b165984b377392ef7 (plain) (tree)
1
2
3
4
5
6
7
8
9




                                                                                                                                
       
                                                                                                                        

                                                                                                                           
                                                                               
 
                                                                      
 
                                                   
         

                                                                                                       
                                                                      



                                                                                                       


                         


                                                      
 


                                     
                                                          
                                   



                                                           
          
                                                                 
                                                                    
                                                                            


                                                          
            

          
                                             
                                                           
          
 
                          
                                                                            
                                                                                                  
                             
 
                                                                                                                                          
                                                                                       

                                                  
        
              
<ng-template #notificationNumber>
  <div *ngIf="unreadNotifications > 0 && unreadNotifications < 100" class="unread-notifications">{{ unreadNotifications }}</div>
  <div *ngIf="unreadNotifications >= 100" class="unread-notifications">99+</div>
</ng-template>

<button
  [ngbPopover]="popContent" autoClose="outside" placement="bottom" container={this} popoverClass="popover-notifications"
  i18n-title title="View your notifications"
  class="border-0 text-start" [ngClass]="{ 'notification-inbox-popover': true, 'shown': opened, 'hidden': isInMobileView }"
  #popover="ngbPopover" (shown)="onPopoverShown()" (hidden)="onPopoverHidden()"
>
  <ng-container *ngTemplateOutlet="notificationNumber"></ng-container>

  <my-global-icon iconName="bell"></my-global-icon>
</button>

<div *ngIf="isInMobileView" i18n-title title="View your notifications" class="notification-inbox-link">
  <ng-container *ngTemplateOutlet="notificationNumber"></ng-container>

  <a routerLink="/my-account/notifications" routerLinkActive="active" #link (click)="onNavigate(link)">
    <my-global-icon iconName="bell"></my-global-icon>
  </a>
</div>

<ng-template #popContent>
  <div class="content" [ngClass]="{ loaded: loaded }">
    <div class="notifications-header">
      <div i18n>Notifications</div>

      <div>
        <button
          *ngIf="unreadNotifications"
          i18n-title title="Mark all as read" class="me-2"
          (click)="markAllAsRead()"
        >
          <my-global-icon iconName="tick"></my-global-icon>
        </button>

        <a
          i18n-title title="Update your notification preferences"
          routerLink="/my-account/settings" fragment="notifications"
          #settingsNotifications (click)="onNavigate(settingsNotifications)"
        >
          <my-global-icon iconName="cog"></my-global-icon>
        </a>
      </div>
    </div>

    <div *ngIf="!loaded" class="loader mt-4">
      <my-loader size="xl" [loading]="!loaded"></my-loader>
    </div>

    <my-user-notifications
      [ignoreLoadingBar]="true" [infiniteScroll]="false" [itemsPerPage]="10"
      [markAllAsReadSubject]="markAllAsReadSubject" (notificationsLoaded)="onNotificationLoaded()"
    ></my-user-notifications>

    <a *ngIf="loaded" class="all-notifications" routerLink="/my-account/notifications" #notifications (click)="onNavigate(notifications)">
      <my-global-icon class="me-1" iconName="bell" aria-hidden="true"></my-global-icon>
      <span i18n>See all your notifications</span>
    </a>
  </div>
</ng-template>