]>
Commit | Line | Data |
---|---|---|
2f1548fd C |
1 | <div *ngIf="componentPagination.totalItems === 0" class="no-notification" i18n>You don't have notifications.</div> |
2 | ||
ad453580 | 3 | <div class="notifications" myInfiniteScroller [autoInit]="true" (nearOfBottom)="onNearOfBottom()" [dataObservable]="onDataSubject.asObservable()"> |
457bb213 | 4 | <div *ngFor="let notification of notifications" class="notification" [ngClass]="{ unread: !notification.read }" (click)="markAsRead(notification)"> |
2f1548fd | 5 | |
457bb213 | 6 | <ng-container [ngSwitch]="notification.type"> |
829523cf | 7 | <ng-container *ngSwitchCase="1"> <!-- UserNotificationType.NEW_VIDEO_FROM_SUBSCRIPTION --> |
c5c09c1e RK |
8 | <ng-container *ngIf="notification.video; then hasVideo; else noVideo"></ng-container> |
9 | ||
10 | <ng-template #hasVideo> | |
11 | <a (click)="markAsRead(notification)" [routerLink]="notification.accountUrl"> | |
12 | <img alt="" aria-labelledby="avatar" class="avatar" [src]="notification.video.channel.avatarUrl" /> | |
13 | </a> | |
14 | ||
15 | <div class="message" i18n> | |
16 | {{ notification.video.channel.displayName }} published a new video: <a (click)="markAsRead(notification)" [routerLink]="notification.videoUrl">{{ notification.video.name }}</a> | |
17 | </div> | |
18 | </ng-template> | |
19 | ||
20 | <ng-template #noVideo> | |
adcf9212 | 21 | <my-global-icon iconName="alert" aria-hidden="true"></my-global-icon> |
d95d1559 | 22 | |
c5c09c1e RK |
23 | <div class="message" i18n> |
24 | The notification concerns a video now unavailable | |
25 | </div> | |
26 | </ng-template> | |
2f1548fd C |
27 | </ng-container> |
28 | ||
829523cf | 29 | <ng-container *ngSwitchCase="5"> <!-- UserNotificationType.UNBLACKLIST_ON_MY_VIDEO --> |
adcf9212 | 30 | <my-global-icon iconName="undo" aria-hidden="true"></my-global-icon> |
457bb213 | 31 | |
ee2b7df0 | 32 | <div class="message" i18n> |
5baee5fc | 33 | Your video <a (click)="markAsRead(notification)" [routerLink]="notification.videoUrl">{{ notification.video.name }}</a> has been unblocked |
457bb213 | 34 | </div> |
2f1548fd C |
35 | </ng-container> |
36 | ||
829523cf | 37 | <ng-container *ngSwitchCase="4"> <!-- UserNotificationType.BLACKLIST_ON_MY_VIDEO --> |
adcf9212 | 38 | <my-global-icon iconName="no" aria-hidden="true"></my-global-icon> |
457bb213 | 39 | |
ee2b7df0 | 40 | <div class="message" i18n> |
5baee5fc | 41 | Your video <a (click)="markAsRead(notification)" [routerLink]="notification.videoUrl">{{ notification.videoBlacklist.video.name }}</a> has been blocked |
457bb213 | 42 | </div> |
2f1548fd C |
43 | </ng-container> |
44 | ||
829523cf | 45 | <ng-container *ngSwitchCase="3"> <!-- UserNotificationType.NEW_ABUSE_FOR_MODERATORS --> |
c41c0e28 | 46 | <my-global-icon iconName="flag" aria-hidden="true"></my-global-icon> |
457bb213 | 47 | |
cfde28ba | 48 | <div class="message" *ngIf="notification.videoUrl" i18n> |
d573926e | 49 | <a (click)="markAsRead(notification)" [routerLink]="notification.abuseUrl" [queryParams]="notification.abuseQueryParams">A new video abuse</a> has been created on video <a (click)="markAsRead(notification)" [routerLink]="notification.videoUrl">{{ notification.abuse.video.name }}</a> |
457bb213 | 50 | </div> |
cfde28ba C |
51 | |
52 | <div class="message" *ngIf="notification.commentUrl" i18n> | |
d573926e | 53 | <a (click)="markAsRead(notification)" [routerLink]="notification.abuseUrl" [queryParams]="notification.abuseQueryParams">A new comment abuse</a> has been created on video <a (click)="markAsRead(notification)" [routerLink]="notification.commentUrl">{{ notification.abuse.comment.video.name }}</a> |
cfde28ba C |
54 | </div> |
55 | ||
56 | <div class="message" *ngIf="notification.accountUrl" i18n> | |
d573926e | 57 | <a (click)="markAsRead(notification)" [routerLink]="notification.abuseUrl" [queryParams]="notification.abuseQueryParams">A new account abuse</a> has been created on account <a (click)="markAsRead(notification)" [routerLink]="notification.accountUrl">{{ notification.abuse.account.displayName }}</a> |
cfde28ba C |
58 | </div> |
59 | ||
60 | <!-- Deleted entity associated to the abuse --> | |
61 | <div class="message" *ngIf="!notification.videoUrl && !notification.commentUrl && !notification.accountUrl" i18n> | |
d573926e C |
62 | <a (click)="markAsRead(notification)" [routerLink]="notification.abuseUrl" [queryParams]="notification.abuseQueryParams">A new abuse</a> has been created |
63 | </div> | |
64 | </ng-container> | |
65 | ||
829523cf | 66 | <ng-container *ngSwitchCase="15"> <!-- UserNotificationType.ABUSE_STATE_CHANGE --> |
d573926e C |
67 | <my-global-icon iconName="flag" aria-hidden="true"></my-global-icon> |
68 | ||
69 | <div class="message" i18n> | |
70 | <a (click)="markAsRead(notification)" [routerLink]="notification.abuseUrl" [queryParams]="notification.abuseQueryParams">Your abuse {{ notification.abuse.id }}</a> has been | |
71 | <ng-container *ngIf="isAccepted(notification)">accepted</ng-container> | |
72 | <ng-container *ngIf="!isAccepted(notification)">rejected</ng-container> | |
73 | </div> | |
74 | </ng-container> | |
75 | ||
829523cf | 76 | <ng-container *ngSwitchCase="16"> <!-- UserNotificationType.ABUSE_NEW_MESSAGE --> |
d573926e C |
77 | <my-global-icon iconName="flag" aria-hidden="true"></my-global-icon> |
78 | ||
79 | <div class="message" i18n> | |
80 | <a (click)="markAsRead(notification)" [routerLink]="notification.abuseUrl" [queryParams]="notification.abuseQueryParams">Abuse {{ notification.abuse.id }}</a> has a new message | |
cfde28ba | 81 | </div> |
2f1548fd C |
82 | </ng-container> |
83 | ||
829523cf | 84 | <ng-container *ngSwitchCase="12"> <!-- UserNotificationType.VIDEO_AUTO_BLACKLIST_FOR_MODERATORS --> |
adcf9212 | 85 | <my-global-icon iconName="no" aria-hidden="true"></my-global-icon> |
7ccddd7b | 86 | |
ee2b7df0 | 87 | <div class="message" i18n> |
3487330d | 88 | The recently added video <a (click)="markAsRead(notification)" [routerLink]="notification.videoUrl">{{ notification.videoBlacklist.video.name }}</a> has been <a (click)="markAsRead(notification)" [routerLink]="notification.videoAutoBlacklistUrl">automatically blocked</a> |
7ccddd7b JM |
89 | </div> |
90 | </ng-container> | |
91 | ||
829523cf | 92 | <ng-container *ngSwitchCase="2"> |
61fd9834 | 93 | <ng-container *ngIf="notification.comment"> |
c5c09c1e RK |
94 | <a (click)="markAsRead(notification)" [routerLink]="notification.accountUrl"> |
95 | <img alt="" aria-labelledby="avatar" class="avatar" [src]="notification.comment.account.avatarUrl" /> | |
96 | </a> | |
d95d1559 | 97 | |
c5c09c1e RK |
98 | <div class="message" i18n> |
99 | <a (click)="markAsRead(notification)" [routerLink]="notification.accountUrl">{{ notification.comment.account.displayName }}</a> commented your video <a (click)="markAsRead(notification)" [routerLink]="notification.commentUrl">{{ notification.comment.video.name }}</a> | |
100 | </div> | |
61fd9834 | 101 | </ng-container> |
c5c09c1e | 102 | |
61fd9834 | 103 | <ng-container *ngIf="!notification.comment"> |
adcf9212 | 104 | <my-global-icon iconName="alert" aria-hidden="true"></my-global-icon> |
d95d1559 | 105 | |
c5c09c1e RK |
106 | <div class="message" i18n> |
107 | The notification concerns a comment now unavailable | |
108 | </div> | |
61fd9834 | 109 | </ng-container> |
2f1548fd C |
110 | </ng-container> |
111 | ||
829523cf | 112 | <ng-container *ngSwitchCase="6"> <!-- UserNotificationType.MY_VIDEO_PUBLISHED --> |
c41c0e28 | 113 | <my-global-icon iconName="film" aria-hidden="true"></my-global-icon> |
457bb213 | 114 | |
ee2b7df0 | 115 | <div class="message" i18n> |
457bb213 C |
116 | Your video <a (click)="markAsRead(notification)" [routerLink]="notification.videoUrl">{{ notification.video.name }}</a> has been published |
117 | </div> | |
2f1548fd C |
118 | </ng-container> |
119 | ||
829523cf | 120 | <ng-container *ngSwitchCase="7"> <!-- UserNotificationType.MY_VIDEO_IMPORT_SUCCESS --> |
6ad971d5 | 121 | <my-global-icon iconName="cloud-download" aria-hidden="true"></my-global-icon> |
457bb213 | 122 | |
ee2b7df0 | 123 | <div class="message" i18n> |
6d28a505 | 124 | <a (click)="markAsRead(notification)" [routerLink]="notification.videoUrl || notification.videoImportUrl">Your video import</a> {{ notification.videoImportIdentifier }} succeeded |
457bb213 | 125 | </div> |
2f1548fd C |
126 | </ng-container> |
127 | ||
829523cf | 128 | <ng-container *ngSwitchCase="8"> <!-- UserNotificationType.MY_VIDEO_IMPORT_ERROR --> |
6ad971d5 | 129 | <my-global-icon iconName="cloud-error" aria-hidden="true"></my-global-icon> |
457bb213 | 130 | |
ee2b7df0 | 131 | <div class="message" i18n> |
457bb213 C |
132 | <a (click)="markAsRead(notification)" [routerLink]="notification.videoImportUrl">Your video import</a> {{ notification.videoImportIdentifier }} failed |
133 | </div> | |
2f1548fd C |
134 | </ng-container> |
135 | ||
829523cf | 136 | <ng-container *ngSwitchCase="9"> <!-- UserNotificationType.NEW_USER_REGISTRATION --> |
adcf9212 | 137 | <my-global-icon iconName="user-add" aria-hidden="true"></my-global-icon> |
457bb213 | 138 | |
ee2b7df0 | 139 | <div class="message" i18n> |
c5c09c1e | 140 | User <a (click)="markAsRead(notification)" [routerLink]="notification.accountUrl">{{ notification.account.name }}</a> registered on your instance |
457bb213 | 141 | </div> |
2f1548fd C |
142 | </ng-container> |
143 | ||
829523cf | 144 | <ng-container *ngSwitchCase="10"> <!-- UserNotificationType.NEW_FOLLOW --> |
c5c09c1e RK |
145 | <a (click)="markAsRead(notification)" [routerLink]="notification.accountUrl"> |
146 | <img alt="" aria-labelledby="avatar" class="avatar" [src]="notification.actorFollow.follower.avatarUrl" /> | |
147 | </a> | |
2f1548fd | 148 | |
ee2b7df0 | 149 | <div class="message" i18n> |
457bb213 C |
150 | <a (click)="markAsRead(notification)" [routerLink]="notification.accountUrl">{{ notification.actorFollow.follower.displayName }}</a> is following |
151 | ||
152 | <ng-container *ngIf="notification.actorFollow.following.type === 'channel'">your channel {{ notification.actorFollow.following.displayName }}</ng-container> | |
153 | <ng-container *ngIf="notification.actorFollow.following.type === 'account'">your account</ng-container> | |
154 | </div> | |
2f1548fd C |
155 | </ng-container> |
156 | ||
829523cf | 157 | <ng-container *ngSwitchCase="11"> |
61fd9834 C |
158 | <ng-container *ngIf="notification.comment"> |
159 | <a (click)="markAsRead(notification)" [routerLink]="notification.accountUrl"> | |
160 | <img alt="" aria-labelledby="avatar" class="avatar" [src]="notification.comment.account.avatarUrl" /> | |
161 | </a> | |
457bb213 | 162 | |
61fd9834 C |
163 | <div class="message" i18n> |
164 | <a (click)="markAsRead(notification)" [routerLink]="notification.accountUrl">{{ notification.comment.account.displayName }}</a> mentioned you on <a (click)="markAsRead(notification)" [routerLink]="notification.commentUrl">video {{ notification.comment.video.name }}</a> | |
165 | </div> | |
166 | </ng-container> | |
167 | ||
168 | <ng-container *ngIf="!notification.comment"> | |
169 | <my-global-icon iconName="alert" aria-hidden="true"></my-global-icon> | |
170 | ||
171 | <div class="message" i18n> | |
172 | The notification concerns a comment now unavailable | |
173 | </div> | |
174 | </ng-container> | |
2f1548fd | 175 | </ng-container> |
8ce1ba6e | 176 | |
829523cf | 177 | <ng-container *ngSwitchCase="13"> <!-- UserNotificationType.NEW_INSTANCE_FOLLOWER --> |
adcf9212 | 178 | <my-global-icon iconName="users" aria-hidden="true"></my-global-icon> |
8ce1ba6e | 179 | |
ee2b7df0 | 180 | <div class="message" i18n> |
ce78f1f6 C |
181 | Your instance has <a (click)="markAsRead(notification)" [routerLink]="notification.instanceFollowUrl">a new follower</a> ({{ notification.actorFollow?.follower.host }}) |
182 | <ng-container *ngIf="notification.actorFollow?.state === 'pending'"> awaiting your approval</ng-container> | |
8ce1ba6e C |
183 | </div> |
184 | </ng-container> | |
e1b49ee5 | 185 | |
829523cf | 186 | <ng-container *ngSwitchCase="14"> <!-- UserNotificationType.AUTO_INSTANCE_FOLLOWING --> |
adcf9212 | 187 | <my-global-icon iconName="users" aria-hidden="true"></my-global-icon> |
e1b49ee5 | 188 | |
ee2b7df0 | 189 | <div class="message" i18n> |
e1b49ee5 C |
190 | Your instance automatically followed <a (click)="markAsRead(notification)" [routerLink]="notification.instanceFollowUrl">{{ notification.actorFollow.following.host }}</a> |
191 | </div> | |
192 | </ng-container> | |
c5c09c1e | 193 | |
32a18cbf C |
194 | <ng-container *ngSwitchCase="17"> <!-- UserNotificationType.NEW_PLUGIN_VERSION --> |
195 | <my-global-icon iconName="cog" aria-hidden="true"></my-global-icon> | |
196 | ||
197 | <div class="message" i18n> | |
198 | <a (click)="markAsRead(notification)" [routerLink]="notification.pluginUrl" [queryParams]="notification.pluginQueryParams">A new version of the plugin/theme {{ notification.plugin.name }}</a> is available: {{ notification.plugin.latestVersion }} | |
199 | </div> | |
200 | </ng-container> | |
201 | ||
202 | <ng-container *ngSwitchCase="18"> <!-- UserNotificationType.NEW_PEERTUBE_VERSION --> | |
203 | <my-global-icon iconName="cog" aria-hidden="true"></my-global-icon> | |
204 | ||
205 | <div class="message" i18n> | |
206 | <a (click)="markAsRead(notification)" [href]="notification.peertubeVersionLink" target="_blank" rel="noopener noreferer">A new version of PeerTube</a> is available: {{ notification.peertube.latestVersion }} | |
207 | </div> | |
208 | </ng-container> | |
209 | ||
c5c09c1e | 210 | <ng-container *ngSwitchDefault> |
adcf9212 | 211 | <my-global-icon iconName="alert" aria-hidden="true"></my-global-icon> |
c5c09c1e RK |
212 | |
213 | <div class="message" i18n> | |
dc5bb5ce | 214 | The notification points to content now unavailable |
c5c09c1e RK |
215 | </div> |
216 | </ng-container> | |
457bb213 | 217 | </ng-container> |
2f1548fd | 218 | |
c5c09c1e | 219 | <div [title]="notification.createdAt" class="from-date">{{ notification.createdAt | myFromNow }}</div> |
2f1548fd C |
220 | </div> |
221 | </div> |