aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+my-account/my-account-video-playlists
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+my-account/my-account-video-playlists')
-rw-r--r--client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts14
-rw-r--r--client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component.ts18
-rw-r--r--client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-update.component.ts9
-rw-r--r--client/src/app/+my-account/my-account-video-playlists/my-account-video-playlists.component.ts17
4 files changed, 17 insertions, 41 deletions
diff --git a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts
index e72ae2366..5427dc3a0 100644
--- a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts
+++ b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts
@@ -1,13 +1,12 @@
1import { Component, OnInit } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { Router } from '@angular/router' 2import { Router } from '@angular/router'
3import { AuthService, Notifier, ServerService } from '@app/core' 3import { AuthService, Notifier, ServerService } from '@app/core'
4import { populateAsyncUserVideoChannels } from '@app/helpers'
4import { FormValidatorService, VideoPlaylistValidatorsService } from '@app/shared/shared-forms' 5import { FormValidatorService, VideoPlaylistValidatorsService } from '@app/shared/shared-forms'
5import { VideoPlaylistService } from '@app/shared/shared-video-playlist' 6import { VideoPlaylistService } from '@app/shared/shared-video-playlist'
6import { I18n } from '@ngx-translate/i18n-polyfill'
7import { VideoPlaylistCreate } from '@shared/models/videos/playlist/video-playlist-create.model' 7import { VideoPlaylistCreate } from '@shared/models/videos/playlist/video-playlist-create.model'
8import { VideoPlaylistPrivacy } from '@shared/models/videos/playlist/video-playlist-privacy.model' 8import { VideoPlaylistPrivacy } from '@shared/models/videos/playlist/video-playlist-privacy.model'
9import { MyAccountVideoPlaylistEdit } from './my-account-video-playlist-edit' 9import { MyAccountVideoPlaylistEdit } from './my-account-video-playlist-edit'
10import { populateAsyncUserVideoChannels } from '@app/helpers'
11 10
12@Component({ 11@Component({
13 selector: 'my-account-video-playlist-create', 12 selector: 'my-account-video-playlist-create',
@@ -24,9 +23,8 @@ export class MyAccountVideoPlaylistCreateComponent extends MyAccountVideoPlaylis
24 private notifier: Notifier, 23 private notifier: Notifier,
25 private router: Router, 24 private router: Router,
26 private videoPlaylistService: VideoPlaylistService, 25 private videoPlaylistService: VideoPlaylistService,
27 private serverService: ServerService, 26 private serverService: ServerService
28 private i18n: I18n 27 ) {
29 ) {
30 super() 28 super()
31 } 29 }
32 30
@@ -70,9 +68,7 @@ export class MyAccountVideoPlaylistCreateComponent extends MyAccountVideoPlaylis
70 68
71 this.videoPlaylistService.createVideoPlaylist(videoPlaylistCreate).subscribe( 69 this.videoPlaylistService.createVideoPlaylist(videoPlaylistCreate).subscribe(
72 () => { 70 () => {
73 this.notifier.success( 71 this.notifier.success($localize`Playlist ${videoPlaylistCreate.displayName} created.`)
74 this.i18n('Playlist {{playlistName}} created.', { playlistName: videoPlaylistCreate.displayName })
75 )
76 this.router.navigate([ '/my-account', 'video-playlists' ]) 72 this.router.navigate([ '/my-account', 'video-playlists' ])
77 }, 73 },
78 74
@@ -85,6 +81,6 @@ export class MyAccountVideoPlaylistCreateComponent extends MyAccountVideoPlaylis
85 } 81 }
86 82
87 getFormButtonTitle () { 83 getFormButtonTitle () {
88 return this.i18n('Create') 84 return $localize`Create`
89 } 85 }
90} 86}
diff --git a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component.ts b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component.ts
index e278d9ed2..f6cdf1067 100644
--- a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component.ts
+++ b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component.ts
@@ -6,7 +6,6 @@ import { ComponentPagination, ConfirmService, Notifier, ScreenService } from '@a
6import { DropdownAction } from '@app/shared/shared-main' 6import { DropdownAction } from '@app/shared/shared-main'
7import { VideoShareComponent } from '@app/shared/shared-share-modal' 7import { VideoShareComponent } from '@app/shared/shared-share-modal'
8import { VideoPlaylist, VideoPlaylistElement, VideoPlaylistService } from '@app/shared/shared-video-playlist' 8import { VideoPlaylist, VideoPlaylistElement, VideoPlaylistService } from '@app/shared/shared-video-playlist'
9import { I18n } from '@ngx-translate/i18n-polyfill'
10import { VideoPlaylistType } from '@shared/models' 9import { VideoPlaylistType } from '@shared/models'
11 10
12@Component({ 11@Component({
@@ -35,7 +34,6 @@ export class MyAccountVideoPlaylistElementsComponent implements OnInit, OnDestro
35 34
36 constructor ( 35 constructor (
37 private notifier: Notifier, 36 private notifier: Notifier,
38 private i18n: I18n,
39 private router: Router, 37 private router: Router,
40 private confirmService: ConfirmService, 38 private confirmService: ConfirmService,
41 private route: ActivatedRoute, 39 private route: ActivatedRoute,
@@ -47,12 +45,12 @@ export class MyAccountVideoPlaylistElementsComponent implements OnInit, OnDestro
47 this.playlistActions = [ 45 this.playlistActions = [
48 [ 46 [
49 { 47 {
50 label: this.i18n('Update playlist'), 48 label: $localize`Update playlist`,
51 iconName: 'edit', 49 iconName: 'edit',
52 linkBuilder: playlist => [ '/my-account', 'video-playlists', 'update', playlist.uuid ] 50 linkBuilder: playlist => [ '/my-account', 'video-playlists', 'update', playlist.uuid ]
53 }, 51 },
54 { 52 {
55 label: this.i18n('Delete playlist'), 53 label: $localize`Delete playlist`,
56 iconName: 'delete', 54 iconName: 'delete',
57 handler: playlist => this.deleteVideoPlaylist(playlist) 55 handler: playlist => this.deleteVideoPlaylist(playlist)
58 } 56 }
@@ -126,11 +124,8 @@ export class MyAccountVideoPlaylistElementsComponent implements OnInit, OnDestro
126 124
127 async deleteVideoPlaylist (videoPlaylist: VideoPlaylist) { 125 async deleteVideoPlaylist (videoPlaylist: VideoPlaylist) {
128 const res = await this.confirmService.confirm( 126 const res = await this.confirmService.confirm(
129 this.i18n( 127 $localize`Do you really want to delete ${videoPlaylist.displayName}?`,
130 'Do you really want to delete {{playlistDisplayName}}?', 128 $localize`Delete`
131 { playlistDisplayName: videoPlaylist.displayName }
132 ),
133 this.i18n('Delete')
134 ) 129 )
135 if (res === false) return 130 if (res === false) return
136 131
@@ -138,10 +133,7 @@ export class MyAccountVideoPlaylistElementsComponent implements OnInit, OnDestro
138 .subscribe( 133 .subscribe(
139 () => { 134 () => {
140 this.router.navigate([ '/my-account', 'video-playlists' ]) 135 this.router.navigate([ '/my-account', 'video-playlists' ])
141 136 this.notifier.success($localize`Playlist ${videoPlaylist.displayName} deleted.`)
142 this.notifier.success(
143 this.i18n('Playlist {{playlistDisplayName}} deleted.', { playlistDisplayName: videoPlaylist.displayName })
144 )
145 }, 137 },
146 138
147 error => this.notifier.error(error.message) 139 error => this.notifier.error(error.message)
diff --git a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-update.component.ts b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-update.component.ts
index 6787fb757..149d0d94f 100644
--- a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-update.component.ts
+++ b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-update.component.ts
@@ -6,7 +6,6 @@ import { AuthService, Notifier, ServerService } from '@app/core'
6import { populateAsyncUserVideoChannels } from '@app/helpers' 6import { populateAsyncUserVideoChannels } from '@app/helpers'
7import { FormValidatorService, VideoPlaylistValidatorsService } from '@app/shared/shared-forms' 7import { FormValidatorService, VideoPlaylistValidatorsService } from '@app/shared/shared-forms'
8import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist' 8import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist'
9import { I18n } from '@ngx-translate/i18n-polyfill'
10import { VideoPlaylistUpdate } from '@shared/models' 9import { VideoPlaylistUpdate } from '@shared/models'
11import { MyAccountVideoPlaylistEdit } from './my-account-video-playlist-edit' 10import { MyAccountVideoPlaylistEdit } from './my-account-video-playlist-edit'
12 11
@@ -29,7 +28,6 @@ export class MyAccountVideoPlaylistUpdateComponent extends MyAccountVideoPlaylis
29 private router: Router, 28 private router: Router,
30 private route: ActivatedRoute, 29 private route: ActivatedRoute,
31 private videoPlaylistService: VideoPlaylistService, 30 private videoPlaylistService: VideoPlaylistService,
32 private i18n: I18n,
33 private serverService: ServerService 31 private serverService: ServerService
34 ) { 32 ) {
35 super() 33 super()
@@ -91,10 +89,7 @@ export class MyAccountVideoPlaylistUpdateComponent extends MyAccountVideoPlaylis
91 89
92 this.videoPlaylistService.updateVideoPlaylist(this.videoPlaylistToUpdate, videoPlaylistUpdate).subscribe( 90 this.videoPlaylistService.updateVideoPlaylist(this.videoPlaylistToUpdate, videoPlaylistUpdate).subscribe(
93 () => { 91 () => {
94 this.notifier.success( 92 this.notifier.success($localize`Playlist ${videoPlaylistUpdate.displayName} updated.`)
95 this.i18n('Playlist {{videoPlaylistName}} updated.', { videoPlaylistName: videoPlaylistUpdate.displayName })
96 )
97
98 this.router.navigate([ '/my-account', 'video-playlists' ]) 93 this.router.navigate([ '/my-account', 'video-playlists' ])
99 }, 94 },
100 95
@@ -107,7 +102,7 @@ export class MyAccountVideoPlaylistUpdateComponent extends MyAccountVideoPlaylis
107 } 102 }
108 103
109 getFormButtonTitle () { 104 getFormButtonTitle () {
110 return this.i18n('Update') 105 return $localize`Update`
111 } 106 }
112 107
113 private hydrateFormFromPlaylist () { 108 private hydrateFormFromPlaylist () {
diff --git a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlists.component.ts b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlists.component.ts
index ba95b6c8b..1e569c0b6 100644
--- a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlists.component.ts
+++ b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlists.component.ts
@@ -3,7 +3,6 @@ import { debounceTime, mergeMap } from 'rxjs/operators'
3import { Component, OnInit } from '@angular/core' 3import { Component, OnInit } from '@angular/core'
4import { AuthService, ComponentPagination, ConfirmService, Notifier, User } from '@app/core' 4import { AuthService, ComponentPagination, ConfirmService, Notifier, User } from '@app/core'
5import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist' 5import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist'
6import { I18n } from '@ngx-translate/i18n-polyfill'
7import { VideoPlaylistType } from '@shared/models' 6import { VideoPlaylistType } from '@shared/models'
8 7
9@Component({ 8@Component({
@@ -30,9 +29,8 @@ export class MyAccountVideoPlaylistsComponent implements OnInit {
30 private authService: AuthService, 29 private authService: AuthService,
31 private notifier: Notifier, 30 private notifier: Notifier,
32 private confirmService: ConfirmService, 31 private confirmService: ConfirmService,
33 private videoPlaylistService: VideoPlaylistService, 32 private videoPlaylistService: VideoPlaylistService
34 private i18n: I18n 33 ) {}
35 ) {}
36 34
37 ngOnInit () { 35 ngOnInit () {
38 this.user = this.authService.getUser() 36 this.user = this.authService.getUser()
@@ -49,11 +47,8 @@ export class MyAccountVideoPlaylistsComponent implements OnInit {
49 47
50 async deleteVideoPlaylist (videoPlaylist: VideoPlaylist) { 48 async deleteVideoPlaylist (videoPlaylist: VideoPlaylist) {
51 const res = await this.confirmService.confirm( 49 const res = await this.confirmService.confirm(
52 this.i18n( 50 $localize`Do you really want to delete ${videoPlaylist.displayName}?`,
53 'Do you really want to delete {{playlistDisplayName}}?', 51 $localize`Delete`
54 { playlistDisplayName: videoPlaylist.displayName }
55 ),
56 this.i18n('Delete')
57 ) 52 )
58 if (res === false) return 53 if (res === false) return
59 54
@@ -63,9 +58,7 @@ export class MyAccountVideoPlaylistsComponent implements OnInit {
63 this.videoPlaylists = this.videoPlaylists 58 this.videoPlaylists = this.videoPlaylists
64 .filter(p => p.id !== videoPlaylist.id) 59 .filter(p => p.id !== videoPlaylist.id)
65 60
66 this.notifier.success( 61 this.notifier.success($localize`Playlist ${videoPlaylist.displayName}} deleted.`)
67 this.i18n('Playlist {{playlistDisplayName}} deleted.', { playlistDisplayName: videoPlaylist.displayName })
68 )
69 }, 62 },
70 63
71 error => this.notifier.error(error.message) 64 error => this.notifier.error(error.message)