diff options
Diffstat (limited to 'client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts')
-rw-r--r-- | client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts | 13 |
1 files changed, 12 insertions, 1 deletions
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 | } |