diff options
Diffstat (limited to 'client/src/app/+videos/+video-watch/shared/information')
4 files changed, 61 insertions, 0 deletions
diff --git a/client/src/app/+videos/+video-watch/shared/information/index.ts b/client/src/app/+videos/+video-watch/shared/information/index.ts index 4c9920765..2569251cf 100644 --- a/client/src/app/+videos/+video-watch/shared/information/index.ts +++ b/client/src/app/+videos/+video-watch/shared/information/index.ts | |||
@@ -1 +1,2 @@ | |||
1 | export * from './privacy-concerns.component' | 1 | export * from './privacy-concerns.component' |
2 | export * from './video-alert.component' | ||
diff --git a/client/src/app/+videos/+video-watch/shared/information/video-alert.component.html b/client/src/app/+videos/+video-watch/shared/information/video-alert.component.html new file mode 100644 index 000000000..3480d3656 --- /dev/null +++ b/client/src/app/+videos/+video-watch/shared/information/video-alert.component.html | |||
@@ -0,0 +1,24 @@ | |||
1 | <div i18n class="alert alert-warning" *ngIf="isVideoToImport()"> | ||
2 | The video is being imported, it will be available when the import is finished. | ||
3 | </div> | ||
4 | |||
5 | <div i18n class="alert alert-warning" *ngIf="isVideoToTranscode()"> | ||
6 | The video is being transcoded, it may not work properly. | ||
7 | </div> | ||
8 | |||
9 | <div i18n class="alert alert-info" *ngIf="hasVideoScheduledPublication()"> | ||
10 | This video will be published on {{ video.scheduledUpdate.updateAt | date: 'full' }}. | ||
11 | </div> | ||
12 | |||
13 | <div i18n class="alert alert-info" *ngIf="isWaitingForLive()"> | ||
14 | This live has not started yet. | ||
15 | </div> | ||
16 | |||
17 | <div i18n class="alert alert-info" *ngIf="isLiveEnded()"> | ||
18 | This live has ended. | ||
19 | </div> | ||
20 | |||
21 | <div class="alert alert-danger" *ngIf="video?.blacklisted"> | ||
22 | <div class="blocked-label" i18n>This video is blocked.</div> | ||
23 | {{ video.blockedReason }} | ||
24 | </div> | ||
diff --git a/client/src/app/+videos/+video-watch/shared/information/video-alert.component.scss b/client/src/app/+videos/+video-watch/shared/information/video-alert.component.scss new file mode 100644 index 000000000..109c31c57 --- /dev/null +++ b/client/src/app/+videos/+video-watch/shared/information/video-alert.component.scss | |||
@@ -0,0 +1,4 @@ | |||
1 | .alert { | ||
2 | text-align: center; | ||
3 | border-radius: 0; | ||
4 | } | ||
diff --git a/client/src/app/+videos/+video-watch/shared/information/video-alert.component.ts b/client/src/app/+videos/+video-watch/shared/information/video-alert.component.ts new file mode 100644 index 000000000..8a46ba0d5 --- /dev/null +++ b/client/src/app/+videos/+video-watch/shared/information/video-alert.component.ts | |||
@@ -0,0 +1,32 @@ | |||
1 | import { Component, Input } from '@angular/core' | ||
2 | import { VideoDetails } from '@app/shared/shared-main' | ||
3 | import { VideoState } from '@shared/models' | ||
4 | |||
5 | @Component({ | ||
6 | selector: 'my-video-alert', | ||
7 | templateUrl: './video-alert.component.html', | ||
8 | styleUrls: [ './video-alert.component.scss' ] | ||
9 | }) | ||
10 | export class VideoAlertComponent { | ||
11 | @Input() video: VideoDetails | ||
12 | |||
13 | isVideoToTranscode () { | ||
14 | return this.video && this.video.state.id === VideoState.TO_TRANSCODE | ||
15 | } | ||
16 | |||
17 | isVideoToImport () { | ||
18 | return this.video && this.video.state.id === VideoState.TO_IMPORT | ||
19 | } | ||
20 | |||
21 | hasVideoScheduledPublication () { | ||
22 | return this.video && this.video.scheduledUpdate !== undefined | ||
23 | } | ||
24 | |||
25 | isWaitingForLive () { | ||
26 | return this.video?.state.id === VideoState.WAITING_FOR_LIVE | ||
27 | } | ||
28 | |||
29 | isLiveEnded () { | ||
30 | return this.video?.state.id === VideoState.LIVE_ENDED | ||
31 | } | ||
32 | } | ||