aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos/+video-watch/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-06-30 08:55:11 +0200
committerChocobozzz <me@florianbigard.com>2021-06-30 08:56:14 +0200
commit2453589a286e1f65843af582512387b2fa17b502 (patch)
tree57d41d8c432ca4e793a16d3b51f665b34aafec52 /client/src/app/+videos/+video-watch/shared
parentd4f0b2ecec221b6cdd75b5d87ba800c6301a15df (diff)
downloadPeerTube-2453589a286e1f65843af582512387b2fa17b502.tar.gz
PeerTube-2453589a286e1f65843af582512387b2fa17b502.tar.zst
PeerTube-2453589a286e1f65843af582512387b2fa17b502.zip
Move video alert in a dedicated component
Diffstat (limited to 'client/src/app/+videos/+video-watch/shared')
-rw-r--r--client/src/app/+videos/+video-watch/shared/information/index.ts1
-rw-r--r--client/src/app/+videos/+video-watch/shared/information/video-alert.component.html24
-rw-r--r--client/src/app/+videos/+video-watch/shared/information/video-alert.component.scss4
-rw-r--r--client/src/app/+videos/+video-watch/shared/information/video-alert.component.ts32
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 @@
1export * from './privacy-concerns.component' 1export * from './privacy-concerns.component'
2export * 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 @@
1import { Component, Input } from '@angular/core'
2import { VideoDetails } from '@app/shared/shared-main'
3import { 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})
10export 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}