Move video alert in a dedicated component
This commit is contained in:
parent
d4f0b2ecec
commit
2453589a28
|
@ -1 +1,2 @@
|
||||||
export * from './privacy-concerns.component'
|
export * from './privacy-concerns.component'
|
||||||
|
export * from './video-alert.component'
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
<div i18n class="alert alert-warning" *ngIf="isVideoToImport()">
|
||||||
|
The video is being imported, it will be available when the import is finished.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div i18n class="alert alert-warning" *ngIf="isVideoToTranscode()">
|
||||||
|
The video is being transcoded, it may not work properly.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div i18n class="alert alert-info" *ngIf="hasVideoScheduledPublication()">
|
||||||
|
This video will be published on {{ video.scheduledUpdate.updateAt | date: 'full' }}.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div i18n class="alert alert-info" *ngIf="isWaitingForLive()">
|
||||||
|
This live has not started yet.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div i18n class="alert alert-info" *ngIf="isLiveEnded()">
|
||||||
|
This live has ended.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="alert alert-danger" *ngIf="video?.blacklisted">
|
||||||
|
<div class="blocked-label" i18n>This video is blocked.</div>
|
||||||
|
{{ video.blockedReason }}
|
||||||
|
</div>
|
|
@ -0,0 +1,4 @@
|
||||||
|
.alert {
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
import { Component, Input } from '@angular/core'
|
||||||
|
import { VideoDetails } from '@app/shared/shared-main'
|
||||||
|
import { VideoState } from '@shared/models'
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'my-video-alert',
|
||||||
|
templateUrl: './video-alert.component.html',
|
||||||
|
styleUrls: [ './video-alert.component.scss' ]
|
||||||
|
})
|
||||||
|
export class VideoAlertComponent {
|
||||||
|
@Input() video: VideoDetails
|
||||||
|
|
||||||
|
isVideoToTranscode () {
|
||||||
|
return this.video && this.video.state.id === VideoState.TO_TRANSCODE
|
||||||
|
}
|
||||||
|
|
||||||
|
isVideoToImport () {
|
||||||
|
return this.video && this.video.state.id === VideoState.TO_IMPORT
|
||||||
|
}
|
||||||
|
|
||||||
|
hasVideoScheduledPublication () {
|
||||||
|
return this.video && this.video.scheduledUpdate !== undefined
|
||||||
|
}
|
||||||
|
|
||||||
|
isWaitingForLive () {
|
||||||
|
return this.video?.state.id === VideoState.WAITING_FOR_LIVE
|
||||||
|
}
|
||||||
|
|
||||||
|
isLiveEnded () {
|
||||||
|
return this.video?.state.id === VideoState.LIVE_ENDED
|
||||||
|
}
|
||||||
|
}
|
|
@ -20,32 +20,7 @@
|
||||||
<my-plugin-placeholder pluginId="player-next"></my-plugin-placeholder>
|
<my-plugin-placeholder pluginId="player-next"></my-plugin-placeholder>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<my-video-alert [video]="video"></my-video-alert>
|
||||||
<div i18n class="col-md-12 alert alert-warning" *ngIf="isVideoToImport()">
|
|
||||||
The video is being imported, it will be available when the import is finished.
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div i18n class="col-md-12 alert alert-warning" *ngIf="isVideoToTranscode()">
|
|
||||||
The video is being transcoded, it may not work properly.
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div i18n class="col-md-12 alert alert-info" *ngIf="hasVideoScheduledPublication()">
|
|
||||||
This video will be published on {{ video.scheduledUpdate.updateAt | date: 'full' }}.
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div i18n class="col-md-12 alert alert-info" *ngIf="isWaitingForLive()">
|
|
||||||
This live has not started yet.
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div i18n class="col-md-12 alert alert-info" *ngIf="isLiveEnded()">
|
|
||||||
This live has ended.
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-md-12 alert alert-danger" *ngIf="video?.blacklisted">
|
|
||||||
<div class="blocked-label" i18n>This video is blocked.</div>
|
|
||||||
{{ video.blockedReason }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Video information -->
|
<!-- Video information -->
|
||||||
<div *ngIf="video" class="margin-content video-bottom">
|
<div *ngIf="video" class="margin-content video-bottom">
|
||||||
|
|
|
@ -30,11 +30,6 @@ $video-height: 66vh;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.alert {
|
|
||||||
text-align: center;
|
|
||||||
border-radius: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.flex-direction-column {
|
.flex-direction-column {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
|
@ -220,26 +220,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
isVideoToTranscode () {
|
|
||||||
return this.video && this.video.state.id === VideoState.TO_TRANSCODE
|
|
||||||
}
|
|
||||||
|
|
||||||
isVideoToImport () {
|
|
||||||
return this.video && this.video.state.id === VideoState.TO_IMPORT
|
|
||||||
}
|
|
||||||
|
|
||||||
hasVideoScheduledPublication () {
|
|
||||||
return this.video && this.video.scheduledUpdate !== undefined
|
|
||||||
}
|
|
||||||
|
|
||||||
isWaitingForLive () {
|
|
||||||
return this.video?.state.id === VideoState.WAITING_FOR_LIVE
|
|
||||||
}
|
|
||||||
|
|
||||||
isLiveEnded () {
|
|
||||||
return this.video?.state.id === VideoState.LIVE_ENDED
|
|
||||||
}
|
|
||||||
|
|
||||||
isVideoBlur (video: Video) {
|
isVideoBlur (video: Video) {
|
||||||
return video.isVideoNSFWForUser(this.user, this.serverConfig)
|
return video.isVideoNSFWForUser(this.user, this.serverConfig)
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,13 +14,14 @@ import { SharedActorImageModule } from '../../shared/shared-actor-image/shared-a
|
||||||
import { VideoCommentService } from '../../shared/shared-video-comment/video-comment.service'
|
import { VideoCommentService } from '../../shared/shared-video-comment/video-comment.service'
|
||||||
import { PlayerStylesComponent } from './player-styles.component'
|
import { PlayerStylesComponent } from './player-styles.component'
|
||||||
import {
|
import {
|
||||||
|
ActionButtonsComponent,
|
||||||
|
PrivacyConcernsComponent,
|
||||||
RecommendationsModule,
|
RecommendationsModule,
|
||||||
|
VideoAlertComponent,
|
||||||
VideoAvatarChannelComponent,
|
VideoAvatarChannelComponent,
|
||||||
VideoDescriptionComponent,
|
VideoDescriptionComponent,
|
||||||
VideoRateComponent,
|
VideoRateComponent,
|
||||||
VideoWatchPlaylistComponent,
|
VideoWatchPlaylistComponent
|
||||||
ActionButtonsComponent,
|
|
||||||
PrivacyConcernsComponent
|
|
||||||
} from './shared'
|
} from './shared'
|
||||||
import { VideoCommentAddComponent } from './shared/comment/video-comment-add.component'
|
import { VideoCommentAddComponent } from './shared/comment/video-comment-add.component'
|
||||||
import { VideoCommentComponent } from './shared/comment/video-comment.component'
|
import { VideoCommentComponent } from './shared/comment/video-comment.component'
|
||||||
|
@ -55,6 +56,7 @@ import { VideoWatchComponent } from './video-watch.component'
|
||||||
VideoDescriptionComponent,
|
VideoDescriptionComponent,
|
||||||
PrivacyConcernsComponent,
|
PrivacyConcernsComponent,
|
||||||
ActionButtonsComponent,
|
ActionButtonsComponent,
|
||||||
|
VideoAlertComponent,
|
||||||
|
|
||||||
VideoCommentsComponent,
|
VideoCommentsComponent,
|
||||||
VideoCommentAddComponent,
|
VideoCommentAddComponent,
|
||||||
|
|
Loading…
Reference in New Issue