]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/shared/shared-main/users/user-notifications.component.html
Bumped to version v5.2.1
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-main / users / user-notifications.component.html
1 <div *ngIf="componentPagination.totalItems === 0" class="no-notification" i18n>You don't have notifications.</div>
2
3 <div class="notifications" myInfiniteScroller (nearOfBottom)="onNearOfBottom()" [dataObservable]="onDataSubject.asObservable()">
4 <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->
5 <div *ngFor="let notification of notifications" class="notification" [ngClass]="{ unread: !notification.read }" (click)="markAsRead(notification)">
6
7 <ng-container [ngSwitch]="notification.type">
8 <ng-container *ngSwitchCase="1"> <!-- UserNotificationType.NEW_VIDEO_FROM_SUBSCRIPTION -->
9 <ng-container *ngIf="notification.video; then hasVideo; else noVideo"></ng-container>
10
11 <ng-template #hasVideo>
12 <a (click)="markAsRead(notification)" [routerLink]="notification.accountUrl">
13 <img alt="" aria-labelledby="avatar" class="avatar" [src]="notification.video.channel.avatarUrl" />
14 </a>
15
16 <div class="message" i18n>
17 {{ notification.video.channel.displayName }} published a new video: <a (click)="markAsRead(notification)" [routerLink]="notification.videoUrl">{{ notification.video.name }}</a>
18 </div>
19 </ng-template>
20
21 <ng-template #noVideo>
22 <my-global-icon iconName="alert" aria-hidden="true"></my-global-icon>
23
24 <div class="message" i18n>
25 The notification concerns a video now unavailable
26 </div>
27 </ng-template>
28 </ng-container>
29
30 <ng-container *ngSwitchCase="5"> <!-- UserNotificationType.UNBLACKLIST_ON_MY_VIDEO -->
31 <my-global-icon iconName="undo" aria-hidden="true"></my-global-icon>
32
33 <div class="message" i18n>
34 Your video <a (click)="markAsRead(notification)" [routerLink]="notification.videoUrl">{{ notification.video.name }}</a> has been unblocked
35 </div>
36 </ng-container>
37
38 <ng-container *ngSwitchCase="4"> <!-- UserNotificationType.BLACKLIST_ON_MY_VIDEO -->
39 <my-global-icon iconName="no" aria-hidden="true"></my-global-icon>
40
41 <div class="message" i18n>
42 Your video <a (click)="markAsRead(notification)" [routerLink]="notification.videoUrl">{{ notification.videoBlacklist.video.name }}</a> has been blocked
43 </div>
44 </ng-container>
45
46 <ng-container *ngSwitchCase="3"> <!-- UserNotificationType.NEW_ABUSE_FOR_MODERATORS -->
47 <my-global-icon iconName="flag" aria-hidden="true"></my-global-icon>
48
49 <div class="message" *ngIf="notification.videoUrl" i18n>
50 <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>
51 </div>
52
53 <div class="message" *ngIf="notification.commentUrl" i18n>
54 <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>
55 </div>
56
57 <div class="message" *ngIf="notification.accountUrl" i18n>
58 <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>
59 </div>
60
61 <!-- Deleted entity associated to the abuse -->
62 <div class="message" *ngIf="!notification.videoUrl && !notification.commentUrl && !notification.accountUrl" i18n>
63 <a (click)="markAsRead(notification)" [routerLink]="notification.abuseUrl" [queryParams]="notification.abuseQueryParams">A new abuse</a> has been created
64 </div>
65 </ng-container>
66
67 <ng-container *ngSwitchCase="15"> <!-- UserNotificationType.ABUSE_STATE_CHANGE -->
68 <my-global-icon iconName="flag" aria-hidden="true"></my-global-icon>
69
70 <div class="message" i18n>
71 <a (click)="markAsRead(notification)" [routerLink]="notification.abuseUrl" [queryParams]="notification.abuseQueryParams">Your abuse {{ notification.abuse.id }}</a> has been
72 <ng-container *ngIf="isAccepted(notification)">accepted</ng-container>
73 <ng-container *ngIf="!isAccepted(notification)">rejected</ng-container>
74 </div>
75 </ng-container>
76
77 <ng-container *ngSwitchCase="16"> <!-- UserNotificationType.ABUSE_NEW_MESSAGE -->
78 <my-global-icon iconName="flag" aria-hidden="true"></my-global-icon>
79
80 <div class="message" i18n>
81 <a (click)="markAsRead(notification)" [routerLink]="notification.abuseUrl" [queryParams]="notification.abuseQueryParams">Abuse {{ notification.abuse.id }}</a> has a new message
82 </div>
83 </ng-container>
84
85 <ng-container *ngSwitchCase="12"> <!-- UserNotificationType.VIDEO_AUTO_BLACKLIST_FOR_MODERATORS -->
86 <my-global-icon iconName="no" aria-hidden="true"></my-global-icon>
87
88 <div class="message" i18n>
89 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>
90 </div>
91 </ng-container>
92
93 <ng-container *ngSwitchCase="2">
94 <ng-container *ngIf="notification.comment">
95 <a (click)="markAsRead(notification)" [routerLink]="notification.accountUrl">
96 <img alt="" aria-labelledby="avatar" class="avatar" [src]="notification.comment.account.avatarUrl" />
97 </a>
98
99 <div class="message" i18n>
100 <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>
101 </div>
102 </ng-container>
103
104 <ng-container *ngIf="!notification.comment">
105 <my-global-icon iconName="alert" aria-hidden="true"></my-global-icon>
106
107 <div class="message" i18n>
108 The notification concerns a comment now unavailable
109 </div>
110 </ng-container>
111 </ng-container>
112
113 <ng-container *ngSwitchCase="6"> <!-- UserNotificationType.MY_VIDEO_PUBLISHED -->
114 <my-global-icon iconName="film" aria-hidden="true"></my-global-icon>
115
116 <div class="message" i18n>
117 Your video <a (click)="markAsRead(notification)" [routerLink]="notification.videoUrl">{{ notification.video.name }}</a> has been published
118 </div>
119 </ng-container>
120
121 <ng-container *ngSwitchCase="7"> <!-- UserNotificationType.MY_VIDEO_IMPORT_SUCCESS -->
122 <my-global-icon iconName="cloud-download" aria-hidden="true"></my-global-icon>
123
124 <div class="message" i18n>
125 <a (click)="markAsRead(notification)" [routerLink]="notification.videoUrl || notification.videoImportUrl">Your video import</a> {{ notification.videoImportIdentifier }} succeeded
126 </div>
127 </ng-container>
128
129 <ng-container *ngSwitchCase="8"> <!-- UserNotificationType.MY_VIDEO_IMPORT_ERROR -->
130 <my-global-icon iconName="cloud-error" aria-hidden="true"></my-global-icon>
131
132 <div class="message" i18n>
133 <a (click)="markAsRead(notification)" [routerLink]="notification.videoImportUrl">Your video import</a> {{ notification.videoImportIdentifier }} failed
134 </div>
135 </ng-container>
136
137 <ng-container *ngSwitchCase="9"> <!-- UserNotificationType.NEW_USER_REGISTRATION -->
138 <my-global-icon iconName="user-add" aria-hidden="true"></my-global-icon>
139
140 <div class="message" i18n>
141 User <a (click)="markAsRead(notification)" [routerLink]="notification.accountUrl">{{ notification.account.name }}</a> registered on your instance
142 </div>
143 </ng-container>
144
145 <ng-container *ngSwitchCase="10"> <!-- UserNotificationType.NEW_FOLLOW -->
146 <a (click)="markAsRead(notification)" [routerLink]="notification.accountUrl">
147 <img alt="" aria-labelledby="avatar" class="avatar" [src]="notification.actorFollow.follower.avatarUrl" />
148 </a>
149
150 <div class="message" i18n>
151 <a (click)="markAsRead(notification)" [routerLink]="notification.accountUrl">{{ notification.actorFollow.follower.displayName }}</a> is following
152
153 <ng-container *ngIf="notification.actorFollow.following.type === 'channel'">your channel {{ notification.actorFollow.following.displayName }}</ng-container>
154 <ng-container *ngIf="notification.actorFollow.following.type === 'account'">your account</ng-container>
155 </div>
156 </ng-container>
157
158 <ng-container *ngSwitchCase="11">
159 <ng-container *ngIf="notification.comment">
160 <a (click)="markAsRead(notification)" [routerLink]="notification.accountUrl">
161 <img alt="" aria-labelledby="avatar" class="avatar" [src]="notification.comment.account.avatarUrl" />
162 </a>
163
164 <div class="message" i18n>
165 <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>
166 </div>
167 </ng-container>
168
169 <ng-container *ngIf="!notification.comment">
170 <my-global-icon iconName="alert" aria-hidden="true"></my-global-icon>
171
172 <div class="message" i18n>
173 The notification concerns a comment now unavailable
174 </div>
175 </ng-container>
176 </ng-container>
177
178 <ng-container *ngSwitchCase="13"> <!-- UserNotificationType.NEW_INSTANCE_FOLLOWER -->
179 <my-global-icon iconName="users" aria-hidden="true"></my-global-icon>
180
181 <div class="message" i18n>
182 Your instance has <a (click)="markAsRead(notification)" [routerLink]="notification.instanceFollowUrl">a new follower</a> ({{ notification.actorFollow?.follower.host }})
183 <ng-container *ngIf="notification.actorFollow?.state === 'pending'"> awaiting your approval</ng-container>
184 </div>
185 </ng-container>
186
187 <ng-container *ngSwitchCase="14"> <!-- UserNotificationType.AUTO_INSTANCE_FOLLOWING -->
188 <my-global-icon iconName="users" aria-hidden="true"></my-global-icon>
189
190 <div class="message" i18n>
191 Your instance automatically followed <a (click)="markAsRead(notification)" [routerLink]="notification.instanceFollowUrl">{{ notification.actorFollow.following.host }}</a>
192 </div>
193 </ng-container>
194
195 <ng-container *ngSwitchCase="17"> <!-- UserNotificationType.NEW_PLUGIN_VERSION -->
196 <my-global-icon iconName="cog" aria-hidden="true"></my-global-icon>
197
198 <div class="message" i18n>
199 <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 }}
200 </div>
201 </ng-container>
202
203 <ng-container *ngSwitchCase="18"> <!-- UserNotificationType.NEW_PEERTUBE_VERSION -->
204 <my-global-icon iconName="cog" aria-hidden="true"></my-global-icon>
205
206 <div class="message" i18n>
207 <a (click)="markAsRead(notification)" [href]="notification.peertubeVersionLink" target="_blank" rel="noopener noreferrer">A new version of PeerTube</a> is available: {{ notification.peertube.latestVersion }}
208 </div>
209 </ng-container>
210
211 <ng-container *ngSwitchCase="19"> <!-- UserNotificationType.MY_VIDEO_STUDIO_EDITION_FINISHED -->
212 <my-global-icon iconName="film" aria-hidden="true"></my-global-icon>
213
214 <div class="message" i18n>
215 Your video <a (click)="markAsRead(notification)" [routerLink]="notification.videoUrl">{{ notification.video.name }}</a> edition has finished
216 </div>
217 </ng-container>
218
219 <ng-container *ngSwitchCase="20"> <!-- UserNotificationType.NEW_USER_REGISTRATION_REQUEST -->
220 <my-global-icon iconName="user-add" aria-hidden="true"></my-global-icon>
221
222 <div class="message" i18n>
223 User <a (click)="markAsRead(notification)" [routerLink]="notification.registrationsUrl">{{ notification.registration.username }}</a> wants to register on your instance
224 </div>
225 </ng-container>
226
227 <ng-container *ngSwitchDefault>
228 <my-global-icon iconName="alert" aria-hidden="true"></my-global-icon>
229
230 <div class="message" i18n>
231 The notification points to content now unavailable
232 </div>
233 </ng-container>
234 </ng-container>
235
236 <div [title]="notification.createdAt" class="from-date">{{ notification.createdAt | myFromNow }}</div>
237 </div>
238 </div>