diff options
Diffstat (limited to 'client/src/app/shared/shared-video-miniature')
-rw-r--r-- | client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts | 23 | ||||
-rw-r--r-- | client/src/app/shared/shared-video-miniature/video-miniature.component.ts | 4 |
2 files changed, 23 insertions, 4 deletions
diff --git a/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts index c2a318285..abbfc63f8 100644 --- a/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts +++ b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts | |||
@@ -1,8 +1,8 @@ | |||
1 | import { Component, EventEmitter, Input, OnChanges, Output, ViewChild } from '@angular/core' | 1 | import { Component, EventEmitter, Input, OnChanges, Output, ViewChild } from '@angular/core' |
2 | import { AuthService, ConfirmService, Notifier, ScreenService } from '@app/core' | 2 | import { AuthService, ConfirmService, Notifier, ScreenService, ServerService } from '@app/core' |
3 | import { BlocklistService, VideoBlockComponent, VideoBlockService, VideoReportComponent } from '@app/shared/shared-moderation' | 3 | import { BlocklistService, VideoBlockComponent, VideoBlockService, VideoReportComponent } from '@app/shared/shared-moderation' |
4 | import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap' | 4 | import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap' |
5 | import { VideoCaption } from '@shared/models' | 5 | import { VideoCaption, VideoState } from '@shared/models' |
6 | import { | 6 | import { |
7 | Actor, | 7 | Actor, |
8 | DropdownAction, | 8 | DropdownAction, |
@@ -29,6 +29,7 @@ export type VideoActionsDisplayType = { | |||
29 | liveInfo?: boolean | 29 | liveInfo?: boolean |
30 | removeFiles?: boolean | 30 | removeFiles?: boolean |
31 | transcoding?: boolean | 31 | transcoding?: boolean |
32 | editor?: boolean | ||
32 | } | 33 | } |
33 | 34 | ||
34 | @Component({ | 35 | @Component({ |
@@ -59,7 +60,8 @@ export class VideoActionsDropdownComponent implements OnChanges { | |||
59 | mute: true, | 60 | mute: true, |
60 | liveInfo: false, | 61 | liveInfo: false, |
61 | removeFiles: false, | 62 | removeFiles: false, |
62 | transcoding: false | 63 | transcoding: false, |
64 | editor: true | ||
63 | } | 65 | } |
64 | @Input() placement = 'left' | 66 | @Input() placement = 'left' |
65 | 67 | ||
@@ -89,7 +91,8 @@ export class VideoActionsDropdownComponent implements OnChanges { | |||
89 | private videoBlocklistService: VideoBlockService, | 91 | private videoBlocklistService: VideoBlockService, |
90 | private screenService: ScreenService, | 92 | private screenService: ScreenService, |
91 | private videoService: VideoService, | 93 | private videoService: VideoService, |
92 | private redundancyService: RedundancyService | 94 | private redundancyService: RedundancyService, |
95 | private serverService: ServerService | ||
93 | ) { } | 96 | ) { } |
94 | 97 | ||
95 | get user () { | 98 | get user () { |
@@ -149,6 +152,12 @@ export class VideoActionsDropdownComponent implements OnChanges { | |||
149 | return this.video.isUpdatableBy(this.user) | 152 | return this.video.isUpdatableBy(this.user) |
150 | } | 153 | } |
151 | 154 | ||
155 | isVideoEditable () { | ||
156 | return this.serverService.getHTMLConfig().videoEditor.enabled && | ||
157 | this.video.state?.id === VideoState.PUBLISHED && | ||
158 | this.video.isUpdatableBy(this.user) | ||
159 | } | ||
160 | |||
152 | isVideoRemovable () { | 161 | isVideoRemovable () { |
153 | return this.video.isRemovableBy(this.user) | 162 | return this.video.isRemovableBy(this.user) |
154 | } | 163 | } |
@@ -330,6 +339,12 @@ export class VideoActionsDropdownComponent implements OnChanges { | |||
330 | isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.update && this.isVideoUpdatable() | 339 | isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.update && this.isVideoUpdatable() |
331 | }, | 340 | }, |
332 | { | 341 | { |
342 | label: $localize`Editor`, | ||
343 | linkBuilder: ({ video }) => [ '/video-editor/edit', video.uuid ], | ||
344 | iconName: 'film', | ||
345 | isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.editor && this.isVideoEditable() | ||
346 | }, | ||
347 | { | ||
333 | label: $localize`Block`, | 348 | label: $localize`Block`, |
334 | handler: () => this.showBlockModal(), | 349 | handler: () => this.showBlockModal(), |
335 | iconName: 'no', | 350 | iconName: 'no', |
diff --git a/client/src/app/shared/shared-video-miniature/video-miniature.component.ts b/client/src/app/shared/shared-video-miniature/video-miniature.component.ts index 847e401ed..7de9fc8e2 100644 --- a/client/src/app/shared/shared-video-miniature/video-miniature.component.ts +++ b/client/src/app/shared/shared-video-miniature/video-miniature.component.ts | |||
@@ -195,6 +195,10 @@ export class VideoMiniatureComponent implements OnInit { | |||
195 | return $localize`To import` | 195 | return $localize`To import` |
196 | } | 196 | } |
197 | 197 | ||
198 | if (video.state.id === VideoState.TO_EDIT) { | ||
199 | return $localize`To edit` | ||
200 | } | ||
201 | |||
198 | return '' | 202 | return '' |
199 | } | 203 | } |
200 | 204 | ||