diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-07-23 21:30:04 +0200 |
---|---|---|
committer | Rigel Kent <par@rigelk.eu> | 2020-07-29 18:15:53 +0200 |
commit | 4f5d045960b042eb27e10bac1bdaf1c074c9fa2a (patch) | |
tree | 09e1e8cce0a2e64146ede51941cfa2f1bdcf3c2f /client/src/app/+my-account/my-account-ownership | |
parent | bc99dfe54e093e69ba8fd06d36b36fbbda3f45de (diff) | |
download | PeerTube-4f5d045960b042eb27e10bac1bdaf1c074c9fa2a.tar.gz PeerTube-4f5d045960b042eb27e10bac1bdaf1c074c9fa2a.tar.zst PeerTube-4f5d045960b042eb27e10bac1bdaf1c074c9fa2a.zip |
harmonize search for libraries
Diffstat (limited to 'client/src/app/+my-account/my-account-ownership')
3 files changed, 21 insertions, 2 deletions
diff --git a/client/src/app/+my-account/my-account-ownership/my-account-ownership.component.html b/client/src/app/+my-account/my-account-ownership/my-account-ownership.component.html index be5d41f3b..4475178c7 100644 --- a/client/src/app/+my-account/my-account-ownership/my-account-ownership.component.html +++ b/client/src/app/+my-account/my-account-ownership/my-account-ownership.component.html | |||
@@ -62,7 +62,11 @@ | |||
62 | </td> | 62 | </td> |
63 | 63 | ||
64 | <td>{{ videoChangeOwnership.createdAt | date: 'short' }}</td> | 64 | <td>{{ videoChangeOwnership.createdAt | date: 'short' }}</td> |
65 | <td i18n>{{ videoChangeOwnership.status }}</td> | 65 | |
66 | <td> | ||
67 | <span class="badge" [ngClass]="getStatusClass(videoChangeOwnership.status)">{{ videoChangeOwnership.status }}</span> | ||
68 | </td> | ||
69 | |||
66 | <td class="action-cell"> | 70 | <td class="action-cell"> |
67 | <ng-container *ngIf="videoChangeOwnership.status === 'WAITING'"> | 71 | <ng-container *ngIf="videoChangeOwnership.status === 'WAITING'"> |
68 | <my-button i18n-label label="Accept" icon="tick" (click)="openAcceptModal(videoChangeOwnership)"></my-button> | 72 | <my-button i18n-label label="Accept" icon="tick" (click)="openAcceptModal(videoChangeOwnership)"></my-button> |
diff --git a/client/src/app/+my-account/my-account-ownership/my-account-ownership.component.scss b/client/src/app/+my-account/my-account-ownership/my-account-ownership.component.scss index c04e26374..7cac9c9f3 100644 --- a/client/src/app/+my-account/my-account-ownership/my-account-ownership.component.scss +++ b/client/src/app/+my-account/my-account-ownership/my-account-ownership.component.scss | |||
@@ -5,6 +5,10 @@ | |||
5 | @include chip; | 5 | @include chip; |
6 | } | 6 | } |
7 | 7 | ||
8 | .badge { | ||
9 | @include table-badge; | ||
10 | } | ||
11 | |||
8 | .video-table-video { | 12 | .video-table-video { |
9 | display: inline-flex; | 13 | display: inline-flex; |
10 | 14 | ||
diff --git a/client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts b/client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts index 98360dfb3..7473470aa 100644 --- a/client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts +++ b/client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts | |||
@@ -2,7 +2,7 @@ import { SortMeta } from 'primeng/api' | |||
2 | import { Component, OnInit, ViewChild } from '@angular/core' | 2 | import { Component, OnInit, ViewChild } from '@angular/core' |
3 | import { Notifier, RestPagination, RestTable } from '@app/core' | 3 | import { Notifier, RestPagination, RestTable } from '@app/core' |
4 | import { VideoOwnershipService, Actor, Video, Account } from '@app/shared/shared-main' | 4 | import { VideoOwnershipService, Actor, Video, Account } from '@app/shared/shared-main' |
5 | import { VideoChangeOwnership } from '@shared/models' | 5 | import { VideoChangeOwnership, VideoChangeOwnershipStatus } from '@shared/models' |
6 | import { MyAccountAcceptOwnershipComponent } from './my-account-accept-ownership/my-account-accept-ownership.component' | 6 | import { MyAccountAcceptOwnershipComponent } from './my-account-accept-ownership/my-account-accept-ownership.component' |
7 | import { getAbsoluteAPIUrl } from '@app/helpers' | 7 | import { getAbsoluteAPIUrl } from '@app/helpers' |
8 | 8 | ||
@@ -34,6 +34,17 @@ export class MyAccountOwnershipComponent extends RestTable implements OnInit { | |||
34 | return 'MyAccountOwnershipComponent' | 34 | return 'MyAccountOwnershipComponent' |
35 | } | 35 | } |
36 | 36 | ||
37 | getStatusClass (status: VideoChangeOwnershipStatus) { | ||
38 | switch (status) { | ||
39 | case VideoChangeOwnershipStatus.ACCEPTED: | ||
40 | return 'badge-green' | ||
41 | case VideoChangeOwnershipStatus.REFUSED: | ||
42 | return 'badge-red' | ||
43 | default: | ||
44 | return 'badge-yellow' | ||
45 | } | ||
46 | } | ||
47 | |||
37 | switchToDefaultAvatar ($event: Event) { | 48 | switchToDefaultAvatar ($event: Event) { |
38 | ($event.target as HTMLImageElement).src = Actor.GET_DEFAULT_AVATAR_URL() | 49 | ($event.target as HTMLImageElement).src = Actor.GET_DEFAULT_AVATAR_URL() |
39 | } | 50 | } |