diff options
author | Chocobozzz <me@florianbigard.com> | 2019-04-09 10:42:07 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-04-09 10:42:07 +0200 |
commit | 8ce1ba6e3efe0a688d6a0b57e8201cde33ad7aac (patch) | |
tree | 10fb184225bea38057979019c0427f893b03f77c /client/src/app/shared | |
parent | 846751c98b8704c09234688be6e7e23b837a3739 (diff) | |
download | PeerTube-8ce1ba6e3efe0a688d6a0b57e8201cde33ad7aac.tar.gz PeerTube-8ce1ba6e3efe0a688d6a0b57e8201cde33ad7aac.tar.zst PeerTube-8ce1ba6e3efe0a688d6a0b57e8201cde33ad7aac.zip |
Add new instance follower notification in client
Diffstat (limited to 'client/src/app/shared')
3 files changed, 16 insertions, 1 deletions
diff --git a/client/src/app/shared/images/global-icon.component.ts b/client/src/app/shared/images/global-icon.component.ts index d85f269ea..bd5b11bb0 100644 --- a/client/src/app/shared/images/global-icon.component.ts +++ b/client/src/app/shared/images/global-icon.component.ts | |||
@@ -43,7 +43,8 @@ const icons = { | |||
43 | 'videos': require('../../../assets/images/global/videos.html'), | 43 | 'videos': require('../../../assets/images/global/videos.html'), |
44 | 'folder': require('../../../assets/images/global/folder.html'), | 44 | 'folder': require('../../../assets/images/global/folder.html'), |
45 | 'administration': require('../../../assets/images/menu/administration.html'), | 45 | 'administration': require('../../../assets/images/menu/administration.html'), |
46 | 'subscriptions': require('../../../assets/images/menu/subscriptions.html') | 46 | 'subscriptions': require('../../../assets/images/menu/subscriptions.html'), |
47 | 'users': require('../../../assets/images/global/users.html') | ||
47 | } | 48 | } |
48 | 49 | ||
49 | export type GlobalIconName = keyof typeof icons | 50 | export type GlobalIconName = keyof typeof icons |
diff --git a/client/src/app/shared/users/user-notification.model.ts b/client/src/app/shared/users/user-notification.model.ts index 76b983152..72fc3e7b4 100644 --- a/client/src/app/shared/users/user-notification.model.ts +++ b/client/src/app/shared/users/user-notification.model.ts | |||
@@ -59,6 +59,7 @@ export class UserNotification implements UserNotificationServer { | |||
59 | accountUrl?: string | 59 | accountUrl?: string |
60 | videoImportIdentifier?: string | 60 | videoImportIdentifier?: string |
61 | videoImportUrl?: string | 61 | videoImportUrl?: string |
62 | instanceFollowUrl?: string | ||
62 | 63 | ||
63 | constructor (hash: UserNotificationServer) { | 64 | constructor (hash: UserNotificationServer) { |
64 | this.id = hash.id | 65 | this.id = hash.id |
@@ -141,6 +142,10 @@ export class UserNotification implements UserNotificationServer { | |||
141 | case UserNotificationType.NEW_FOLLOW: | 142 | case UserNotificationType.NEW_FOLLOW: |
142 | this.accountUrl = this.buildAccountUrl(this.actorFollow.follower) | 143 | this.accountUrl = this.buildAccountUrl(this.actorFollow.follower) |
143 | break | 144 | break |
145 | |||
146 | case UserNotificationType.NEW_INSTANCE_FOLLOWER: | ||
147 | this.instanceFollowUrl = '/admin/follows/followers-list' | ||
148 | break | ||
144 | } | 149 | } |
145 | } catch (err) { | 150 | } catch (err) { |
146 | console.error(err) | 151 | console.error(err) |
diff --git a/client/src/app/shared/users/user-notifications.component.html b/client/src/app/shared/users/user-notifications.component.html index 6d2f2750e..d27f60158 100644 --- a/client/src/app/shared/users/user-notifications.component.html +++ b/client/src/app/shared/users/user-notifications.component.html | |||
@@ -102,6 +102,15 @@ | |||
102 | <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> | 102 | <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> |
103 | </div> | 103 | </div> |
104 | </ng-container> | 104 | </ng-container> |
105 | |||
106 | <ng-container i18n *ngSwitchCase="UserNotificationType.NEW_INSTANCE_FOLLOWER"> | ||
107 | <my-global-icon iconName="users"></my-global-icon> | ||
108 | |||
109 | <div class="message"> | ||
110 | Your instance has <a (click)="markAsRead(notification)" [routerLink]="notification.instanceFollowUrl">a new follower</a> | ||
111 | <ng-container *ngIf="notification.actorFollow.state === 'pending'"> awaiting your approval</ng-container> | ||
112 | </div> | ||
113 | </ng-container> | ||
105 | </ng-container> | 114 | </ng-container> |
106 | 115 | ||
107 | <div class="from-date">{{ notification.createdAt | myFromNow }}</div> | 116 | <div class="from-date">{{ notification.createdAt | myFromNow }}</div> |