diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-07-15 11:15:50 +0200 |
---|---|---|
committer | Rigel Kent <par@rigelk.eu> | 2020-07-29 18:15:53 +0200 |
commit | 654a188f80fc1f089aa14837084664c908fe27d2 (patch) | |
tree | 63855915278c1a3aeb1509c09a7a2f5ee6977893 /client/src/app/+my-account | |
parent | 292c17b894e430d61f9197fb6fa245f5f9c6fa7c (diff) | |
download | PeerTube-654a188f80fc1f089aa14837084664c908fe27d2.tar.gz PeerTube-654a188f80fc1f089aa14837084664c908fe27d2.tar.zst PeerTube-654a188f80fc1f089aa14837084664c908fe27d2.zip |
allow sorting notifications
Diffstat (limited to 'client/src/app/+my-account')
3 files changed, 18 insertions, 2 deletions
diff --git a/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.html b/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.html index 8e4480ca6..0727f90e8 100644 --- a/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.html +++ b/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.html | |||
@@ -5,7 +5,15 @@ | |||
5 | Notification preferences | 5 | Notification preferences |
6 | </a> | 6 | </a> |
7 | 7 | ||
8 | <button class="btn" [disabled]="!hasUnreadNotifications()" (click)="markAllAsRead()"> | 8 | <div class="peertube-select-container peertube-select-button ml-2"> |
9 | <select [(ngModel)]="notificationSortType" (ngModelChange)="onNotificationSortTypeChanged()" class="form-control"> | ||
10 | <option value="undefined" disabled>Sort by</option> | ||
11 | <option value="created" i18n>Newest first</option> | ||
12 | <option value="unread-created" i18n>Unread first</option> | ||
13 | </select> | ||
14 | </div> | ||
15 | |||
16 | <button class="btn ml-auto" [disabled]="!hasUnreadNotifications()" (click)="markAllAsRead()"> | ||
9 | <ng-container *ngIf="hasUnreadNotifications()"> | 17 | <ng-container *ngIf="hasUnreadNotifications()"> |
10 | <my-global-icon iconName="inbox-full" aria-hidden="true"></my-global-icon> | 18 | <my-global-icon iconName="inbox-full" aria-hidden="true"></my-global-icon> |
11 | 19 | ||
diff --git a/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.scss b/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.scss index 73f7c7b24..d586eeb0d 100644 --- a/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.scss +++ b/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.scss | |||
@@ -3,7 +3,6 @@ | |||
3 | 3 | ||
4 | .header { | 4 | .header { |
5 | display: flex; | 5 | display: flex; |
6 | justify-content: space-between; | ||
7 | font-size: 15px; | 6 | font-size: 15px; |
8 | margin-bottom: 20px; | 7 | margin-bottom: 20px; |
9 | 8 | ||
@@ -18,8 +17,13 @@ | |||
18 | @include grey-button; | 17 | @include grey-button; |
19 | @include button-with-icon(20px, 3px, -1px); | 18 | @include button-with-icon(20px, 3px, -1px); |
20 | } | 19 | } |
20 | |||
21 | .peertube-select-container { | ||
22 | @include peertube-select-container(auto); | ||
23 | } | ||
21 | } | 24 | } |
22 | 25 | ||
26 | |||
23 | my-user-notifications { | 27 | my-user-notifications { |
24 | font-size: 15px; | 28 | font-size: 15px; |
25 | } | 29 | } |
diff --git a/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.ts b/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.ts index 0c1427d96..03b91e050 100644 --- a/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.ts +++ b/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.ts | |||
@@ -8,6 +8,8 @@ import { UserNotificationsComponent } from '@app/shared/shared-main' | |||
8 | export class MyAccountNotificationsComponent { | 8 | export class MyAccountNotificationsComponent { |
9 | @ViewChild('userNotification', { static: true }) userNotification: UserNotificationsComponent | 9 | @ViewChild('userNotification', { static: true }) userNotification: UserNotificationsComponent |
10 | 10 | ||
11 | notificationSortType = 'created' | ||
12 | |||
11 | markAllAsRead () { | 13 | markAllAsRead () { |
12 | this.userNotification.markAllAsRead() | 14 | this.userNotification.markAllAsRead() |
13 | } | 15 | } |
@@ -15,4 +17,6 @@ export class MyAccountNotificationsComponent { | |||
15 | hasUnreadNotifications () { | 17 | hasUnreadNotifications () { |
16 | return this.userNotification.notifications.filter(n => n.read === false).length !== 0 | 18 | return this.userNotification.notifications.filter(n => n.read === false).length !== 0 |
17 | } | 19 | } |
20 | |||
21 | onNotificationSortTypeChanged () {} | ||
18 | } | 22 | } |