|
5 | 5 |
|
6 | 6 | <mat-expansion-panel |
7 | 7 | class="notifications-container" |
8 | | - (opened)="showSystemNotifications = false" |
9 | | - (closed)="showSystemNotifications = true" |
| 8 | + (opened)="notificationPanelToggle('open')" |
| 9 | + (closed)="notificationPanelToggle('close')" |
10 | 10 | > |
11 | | - <mat-expansion-panel-header> |
| 11 | + <mat-expansion-panel-header |
| 12 | + [ngClass]="notificationDisplayClass()" |
| 13 | + > |
12 | 14 | <mat-panel-title> |
13 | | - <b *ngIf="showSystemNotifications == false || notification == undefined" |
14 | | - >Notifications</b |
| 15 | + <span |
| 16 | + *ngIf="useBadge" |
| 17 | + class="notification-badge" |
| 18 | + matBadge="{{ newNotificationCount }}" |
| 19 | + matBadgeOverlap="false" |
| 20 | + matBadgeColor="warn" |
| 21 | + matBadgePosition="before" |
| 22 | + matBadgeHidden="{{ newNotificationCount < 1 }}" |
| 23 | + matBadgeSize="small" |
15 | 24 | > |
16 | | - <div *ngIf="showSystemNotifications == true && notification != undefined"> |
17 | | - <div id="wrapper"> |
18 | | - <div id="title"> |
19 | | - <b>Notifications: </b> |
20 | | - </div> |
21 | | - <div |
22 | | - id="time" |
23 | | - title="{{ notification.broadcastTime | date: 'MM/dd/yyyy HH:mm' }}" |
24 | | - style="font-size: 100%" |
25 | | - > |
26 | | - <b>{{ notification.broadcastTime | date: 'HH:mm' }}</b> |
27 | | - </div> |
28 | | - <div id="from" style="font-size: 100%"> |
29 | | - {{ notification.fromName }} |
30 | | - </div> |
31 | | - <div id="link"> |
32 | | - <a |
33 | | - *ngIf="notification.link" |
34 | | - href="{{ notification.link }}" |
35 | | - target="_blank" |
36 | | - title="Goto: {{ notification.link }}" |
37 | | - >Open</a |
38 | | - > |
39 | | - </div> |
40 | | - <div id="message"> |
41 | | - {{ notification.text }} |
42 | | - </div> |
43 | | - </div> |
44 | | - </div> |
| 25 | + </span> |
| 26 | + <span class="notification-panel-title" > |
| 27 | + <b> |
| 28 | + Notifications |
| 29 | + </b> |
| 30 | + </span> |
| 31 | + <mat-icon |
| 32 | + *ngIf="hasViewAdmin && showSystemNotifications && notificationsHistory.length > 0" |
| 33 | + fontIcon="mdi-trash-can" |
| 34 | + title="Delete ALL notifications" |
| 35 | + (click)="deleteViewNotifications()" |
| 36 | + ></mat-icon> |
45 | 37 | </mat-panel-title> |
46 | 38 | </mat-expansion-panel-header> |
47 | | - <div id="historywrapper"> |
48 | | - <div id="navigation"> |
49 | | - <div> |
50 | | - <button |
51 | | - *ngIf="showUp" |
52 | | - mat-icon-button |
53 | | - (click)="showNotificationPage(1)" |
54 | | - > |
55 | | - <mat-icon |
56 | | - svgIcon="ic_expand_more_black_24px" |
57 | | - style="transform: rotate(180deg)" |
58 | | - ></mat-icon> |
59 | | - </button> |
60 | | - <button |
61 | | - *ngIf="!showUp" |
62 | | - mat-icon-button |
63 | | - style="opacity: 0.3; filter: alpha(opacity=30)" |
| 39 | + <mat-list |
| 40 | + *ngIf="notificationsHistory != undefined" |
| 41 | + > |
| 42 | + <mat-list-item |
| 43 | + *ngFor=" |
| 44 | + let notif of notificationsHistory |
| 45 | + " |
| 46 | + > |
| 47 | + <div id="wrapper"> |
| 48 | + <div |
| 49 | + id="time" |
| 50 | + title="{{ notif.broadcastTime | date: 'MM/dd/yyyy HH:mm' }}" |
64 | 51 | > |
| 52 | + <b>{{ notif.broadcastTime | date: 'HH:mm' }}</b> |
| 53 | + </div> |
| 54 | + <div id="from"> |
| 55 | + {{ notif.fromName }} |
| 56 | + </div> |
| 57 | + <div id="link"> |
| 58 | + <a |
| 59 | + *ngIf="notif.link" |
| 60 | + href="{{ notif.link }}" |
| 61 | + target="_blank" |
| 62 | + title="Goto: {{ notif.link }}" |
| 63 | + >Open</a |
| 64 | + > |
| 65 | + </div> |
| 66 | + <div id="message"> |
| 67 | + {{ notif.text }} |
| 68 | + </div> |
| 69 | + <div *ngIf="hasViewAdmin" id="deleteButton"> |
65 | 70 | <mat-icon |
66 | | - svgIcon="ic_expand_more_black_24px" |
67 | | - style="transform: rotate(180deg)" |
| 71 | + fontIcon="mdi-trash-can" |
| 72 | + title="Delete notification" |
| 73 | + (click)="deleteNotification(notif)" |
68 | 74 | ></mat-icon> |
69 | | - </button> |
70 | | - </div> |
71 | | - <div> |
72 | | - <button |
73 | | - *ngIf="showDown" |
74 | | - mat-icon-button |
75 | | - (click)="showNotificationPage(-1)" |
76 | | - > |
77 | | - <mat-icon svgIcon="ic_expand_more_black_24px"></mat-icon> |
78 | | - </button> |
79 | | - <button |
80 | | - *ngIf="!showDown" |
81 | | - mat-icon-button |
82 | | - style="opacity: 0.3; filter: alpha(opacity=30)" |
83 | | - > |
84 | | - <mat-icon svgIcon="ic_expand_more_black_24px"></mat-icon> |
85 | | - </button> |
| 75 | + </div> |
86 | 76 | </div> |
87 | | - </div> |
88 | | - <div id="history"> |
89 | | - <mat-list |
90 | | - *ngIf="notificationsHistory != undefined" |
91 | | - style="min-width: 500px; width: 100%" |
92 | | - > |
93 | | - <mat-list-item |
94 | | - *ngFor=" |
95 | | - let notif of notificationsHistory | slice: startIndex:endIndex |
96 | | - " |
97 | | - > |
98 | | - <div id="wrapper"> |
99 | | - <div |
100 | | - id="time" |
101 | | - title="{{ notif.broadcastTime | date: 'MM/dd/yyyy HH:mm' }}" |
102 | | - > |
103 | | - <b>{{ notif.broadcastTime | date: 'HH:mm' }}</b> |
104 | | - </div> |
105 | | - <div id="from"> |
106 | | - {{ notif.fromName }} |
107 | | - </div> |
108 | | - <div id="link"> |
109 | | - <a |
110 | | - *ngIf="notif.link" |
111 | | - href="{{ notif.link }}" |
112 | | - target="_blank" |
113 | | - title="Goto: {{ notif.link }}" |
114 | | - >Open</a |
115 | | - > |
116 | | - </div> |
117 | | - <div id="message"> |
118 | | - {{ notif.text }} |
119 | | - </div> |
120 | | - </div> |
121 | | - </mat-list-item> |
122 | | - </mat-list> |
123 | | - </div> |
124 | | - </div> |
| 77 | + </mat-list-item> |
| 78 | + </mat-list> |
125 | 79 |
|
126 | | - <div *ngIf="showSendMessage" class="send-message"> |
| 80 | + <div *ngIf="hasViewAdmin" class="send-message"> |
127 | 81 | <form #notificationForm="ngForm" (ngSubmit)="sendMessage()"> |
128 | 82 | <mat-form-field class="input-message"> |
129 | 83 | <input |
|
0 commit comments