rename blacklist to block/blocklist, merge block and auto-block views
[oweals/peertube.git] / client / src / app / shared / 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 [autoInit]="true" (nearOfBottom)="onNearOfBottom()" [dataObservable]="onDataSubject.asObservable()">
4   <div *ngFor="let notification of notifications" class="notification" [ngClass]="{ unread: !notification.read }" (click)="markAsRead(notification)">
5
6     <ng-container [ngSwitch]="notification.type">
7       <ng-container *ngSwitchCase="UserNotificationType.NEW_VIDEO_FROM_SUBSCRIPTION">
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>
21           <my-global-icon iconName="alert"></my-global-icon>
22   
23           <div class="message" i18n>
24             The notification concerns a video now unavailable
25           </div>
26         </ng-template>
27       </ng-container>
28
29       <ng-container *ngSwitchCase="UserNotificationType.UNBLOCK_ON_MY_VIDEO">
30         <my-global-icon iconName="undo"></my-global-icon>
31
32         <div class="message" i18n>
33           Your video <a (click)="markAsRead(notification)" [routerLink]="notification.videoUrl">{{ notification.video.name }}</a> has been unblocked
34         </div>
35       </ng-container>
36
37       <ng-container *ngSwitchCase="UserNotificationType.BLOCK_ON_MY_VIDEO">
38         <my-global-icon iconName="no"></my-global-icon>
39
40         <div class="message" i18n>
41           Your video <a (click)="markAsRead(notification)" [routerLink]="notification.videoUrl">{{ notification.videoBlacklist.video.name }}</a> has been blocked
42         </div>
43       </ng-container>
44
45       <ng-container *ngSwitchCase="UserNotificationType.NEW_VIDEO_ABUSE_FOR_MODERATORS">
46         <my-global-icon iconName="alert"></my-global-icon>
47
48         <div class="message" i18n>
49           <a (click)="markAsRead(notification)" [routerLink]="notification.videoAbuseUrl">A new video abuse</a> has been created on video <a (click)="markAsRead(notification)" [routerLink]="notification.videoUrl">{{ notification.videoAbuse.video.name }}</a>
50         </div>
51       </ng-container>
52
53       <ng-container *ngSwitchCase="UserNotificationType.VIDEO_AUTO_BLOCK_FOR_MODERATORS">
54         <my-global-icon iconName="no"></my-global-icon>
55
56         <div class="message" i18n>
57           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">auto-blocked</a>
58         </div>
59       </ng-container>
60
61       <ng-container *ngSwitchCase="UserNotificationType.NEW_COMMENT_ON_MY_VIDEO">
62         <ng-container *ngIf="notification.comment; then hasComment; else noComment"></ng-container>
63
64         <ng-template #hasComment>
65           <a (click)="markAsRead(notification)" [routerLink]="notification.accountUrl">
66             <img alt="" aria-labelledby="avatar" class="avatar" [src]="notification.comment.account.avatarUrl" />
67           </a>
68   
69           <div class="message" i18n>
70             <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>
71           </div>
72         </ng-template>
73
74         <ng-template #noComment>
75           <my-global-icon iconName="alert"></my-global-icon>
76   
77           <div class="message" i18n>
78             The notification concerns a comment now unavailable
79           </div>
80         </ng-template>
81       </ng-container>
82
83       <ng-container *ngSwitchCase="UserNotificationType.MY_VIDEO_PUBLISHED">
84         <my-global-icon iconName="sparkle" aria-hidden="true"></my-global-icon>
85
86         <div class="message" i18n>
87           Your video <a (click)="markAsRead(notification)" [routerLink]="notification.videoUrl">{{ notification.video.name }}</a> has been published
88         </div>
89       </ng-container>
90
91       <ng-container *ngSwitchCase="UserNotificationType.MY_VIDEO_IMPORT_SUCCESS">
92         <my-global-icon iconName="cloud-download" aria-hidden="true"></my-global-icon>
93
94         <div class="message" i18n>
95           <a (click)="markAsRead(notification)" [routerLink]="notification.videoUrl || notification.videoImportUrl">Your video import</a> {{ notification.videoImportIdentifier }} succeeded
96         </div>
97       </ng-container>
98
99       <ng-container *ngSwitchCase="UserNotificationType.MY_VIDEO_IMPORT_ERROR">
100         <my-global-icon iconName="cloud-error" aria-hidden="true"></my-global-icon>
101
102         <div class="message" i18n>
103           <a (click)="markAsRead(notification)" [routerLink]="notification.videoImportUrl">Your video import</a> {{ notification.videoImportIdentifier }} failed
104         </div>
105       </ng-container>
106
107       <ng-container *ngSwitchCase="UserNotificationType.NEW_USER_REGISTRATION">
108         <my-global-icon iconName="user-add"></my-global-icon>
109
110         <div class="message" i18n>
111           User <a (click)="markAsRead(notification)" [routerLink]="notification.accountUrl">{{ notification.account.name }}</a> registered on your instance
112         </div>
113       </ng-container>
114
115       <ng-container *ngSwitchCase="UserNotificationType.NEW_FOLLOW">
116         <a (click)="markAsRead(notification)" [routerLink]="notification.accountUrl">
117           <img alt="" aria-labelledby="avatar" class="avatar" [src]="notification.actorFollow.follower.avatarUrl" />
118         </a>
119
120         <div class="message" i18n>
121           <a (click)="markAsRead(notification)" [routerLink]="notification.accountUrl">{{ notification.actorFollow.follower.displayName }}</a> is following
122
123           <ng-container *ngIf="notification.actorFollow.following.type === 'channel'">your channel {{ notification.actorFollow.following.displayName }}</ng-container>
124           <ng-container *ngIf="notification.actorFollow.following.type === 'account'">your account</ng-container>
125         </div>
126       </ng-container>
127
128       <ng-container *ngSwitchCase="UserNotificationType.COMMENT_MENTION">
129         <a (click)="markAsRead(notification)" [routerLink]="notification.accountUrl">
130           <img alt="" aria-labelledby="avatar" class="avatar" [src]="notification.comment.account.avatarUrl" />
131         </a>
132
133         <div class="message" i18n>
134           <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>
135         </div>
136       </ng-container>
137
138       <ng-container *ngSwitchCase="UserNotificationType.NEW_INSTANCE_FOLLOWER">
139         <my-global-icon iconName="users"></my-global-icon>
140
141         <div class="message" i18n>
142           Your instance has <a (click)="markAsRead(notification)" [routerLink]="notification.instanceFollowUrl">a new follower</a> ({{ notification.actorFollow?.follower.host }})
143           <ng-container *ngIf="notification.actorFollow?.state === 'pending'"> awaiting your approval</ng-container>
144         </div>
145       </ng-container>
146
147       <ng-container *ngSwitchCase="UserNotificationType.AUTO_INSTANCE_FOLLOWING">
148         <my-global-icon iconName="users"></my-global-icon>
149
150         <div class="message" i18n>
151           Your instance automatically followed <a (click)="markAsRead(notification)" [routerLink]="notification.instanceFollowUrl">{{ notification.actorFollow.following.host }}</a>
152         </div>
153       </ng-container>
154
155       <ng-container *ngSwitchDefault>
156         <my-global-icon iconName="alert"></my-global-icon>
157
158         <div class="message" i18n>
159           The notification points to a content now unavailable
160         </div>
161       </ng-container>
162     </ng-container>
163
164     <div [title]="notification.createdAt" class="from-date">{{ notification.createdAt | myFromNow }}</div>
165   </div>
166 </div>