]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/+my-account/my-account.component.ts
Add/update/delete/list my playlists
[github/Chocobozzz/PeerTube.git] / client / src / app / +my-account / my-account.component.ts
CommitLineData
ddb83e49 1import { Component } from '@angular/core'
5d08a6a7 2import { ServerService } from '@app/core'
4c8e4e04 3import { I18n } from '@ngx-translate/i18n-polyfill'
ddb83e49 4import { TopMenuDropdownParam } from '@app/shared/menu/top-menu-dropdown.component'
4bb6886d
C
5
6@Component({
0626e7af 7 selector: 'my-my-account',
4c8e4e04
C
8 templateUrl: './my-account.component.html',
9 styleUrls: [ './my-account.component.scss' ]
4bb6886d 10})
ddb83e49
C
11export class MyAccountComponent {
12 menuEntries: TopMenuDropdownParam[] = []
d7639f66 13
5d08a6a7 14 constructor (
4c8e4e04 15 private serverService: ServerService,
4c8e4e04 16 private i18n: I18n
ddb83e49
C
17 ) {
18
19 const libraryEntries: TopMenuDropdownParam = {
20 label: this.i18n('My library'),
21 children: [
22 {
23 label: this.i18n('My channels'),
80bfd33c 24 routerLink: '/my-account/video-channels'
ddb83e49
C
25 },
26 {
27 label: this.i18n('My videos'),
28 routerLink: '/my-account/videos'
29 },
830b4faf
C
30 {
31 label: this.i18n('My playlists'),
32 routerLink: '/my-account/video-playlists'
33 },
ddb83e49
C
34 {
35 label: this.i18n('My subscriptions'),
36 routerLink: '/my-account/subscriptions'
80bfd33c
C
37 },
38 {
39 label: this.i18n('My history'),
40 routerLink: '/my-account/history/videos'
ddb83e49
C
41 }
42 ]
43 }
5d08a6a7 44
ddb83e49
C
45 if (this.isVideoImportEnabled()) {
46 libraryEntries.children.push({
47 label: 'My imports',
48 routerLink: '/my-account/video-imports'
49 })
50 }
4c8e4e04 51
ddb83e49
C
52 const miscEntries: TopMenuDropdownParam = {
53 label: this.i18n('Misc'),
54 children: [
55 {
56 label: this.i18n('Muted accounts'),
57 routerLink: '/my-account/blocklist/accounts'
58 },
59 {
60 label: this.i18n('Muted instances'),
61 routerLink: '/my-account/blocklist/servers'
62 },
63 {
64 label: this.i18n('Ownership changes'),
65 routerLink: '/my-account/ownership'
66 }
67 ]
68 }
4c8e4e04 69
ddb83e49
C
70 this.menuEntries = [
71 {
72 label: this.i18n('My settings'),
73 routerLink: '/my-account/settings'
74 },
2f1548fd
C
75 {
76 label: this.i18n('My notifications'),
77 routerLink: '/my-account/notifications'
78 },
ddb83e49
C
79 libraryEntries,
80 miscEntries
81 ]
d7639f66
C
82 }
83
5d08a6a7 84 isVideoImportEnabled () {
b0ee41df
C
85 const importConfig = this.serverService.getConfig().import.videos
86
87 return importConfig.http.enabled || importConfig.torrent.enabled
5d08a6a7 88 }
4c8e4e04 89
5d08a6a7 90}