diff options
Diffstat (limited to 'client/src/app/shared/shared-main')
5 files changed, 82 insertions, 1 deletions
diff --git a/client/src/app/shared/shared-main/misc/channels-setup-message.component.html b/client/src/app/shared/shared-main/misc/channels-setup-message.component.html new file mode 100644 index 000000000..3f94fa04c --- /dev/null +++ b/client/src/app/shared/shared-main/misc/channels-setup-message.component.html | |||
@@ -0,0 +1,8 @@ | |||
1 | <div *ngIf="hasChannelNotConfigured" class="channels-setup-message alert alert-info"> | ||
2 | <my-global-icon iconName="tip"></my-global-icon> | ||
3 | |||
4 | <div> | ||
5 | <div i18n>Some of your channels are not fully set up. Make them welcoming and explicit about what you publish by adding a <strong>banner</strong>, an <strong>avatar</strong> and a <strong>description</strong>.</div> | ||
6 | <a *ngIf="!hideLink" class="channels-settings-link" routerLink="/my-library/video-channels" i18n>Set up my channels</a> | ||
7 | </div> | ||
8 | </div> | ||
diff --git a/client/src/app/shared/shared-main/misc/channels-setup-message.component.scss b/client/src/app/shared/shared-main/misc/channels-setup-message.component.scss new file mode 100644 index 000000000..7dcba2ca5 --- /dev/null +++ b/client/src/app/shared/shared-main/misc/channels-setup-message.component.scss | |||
@@ -0,0 +1,32 @@ | |||
1 | @use '_variables' as *; | ||
2 | @use '_mixins' as *; | ||
3 | |||
4 | .channels-setup-message { | ||
5 | display: flex; | ||
6 | align-items: center; | ||
7 | justify-content: center; | ||
8 | |||
9 | my-global-icon { | ||
10 | width: 32px; | ||
11 | align-self: flex-start; | ||
12 | |||
13 | ::ng-deep { | ||
14 | svg { | ||
15 | fill: #0c5460; | ||
16 | } | ||
17 | } | ||
18 | |||
19 | + div { | ||
20 | margin-left: 10px; | ||
21 | text-align: center; | ||
22 | |||
23 | a.channels-settings-link { | ||
24 | @include peertube-button-link; | ||
25 | @include grey-button; | ||
26 | |||
27 | height: fit-content; | ||
28 | margin-top: 10px; | ||
29 | } | ||
30 | } | ||
31 | } | ||
32 | } | ||
diff --git a/client/src/app/shared/shared-main/misc/channels-setup-message.component.ts b/client/src/app/shared/shared-main/misc/channels-setup-message.component.ts new file mode 100644 index 000000000..50b98841a --- /dev/null +++ b/client/src/app/shared/shared-main/misc/channels-setup-message.component.ts | |||
@@ -0,0 +1,32 @@ | |||
1 | import { Component, Input, OnInit } from '@angular/core' | ||
2 | import { AuthService, User } from '@app/core' | ||
3 | import { VideoChannel } from '@app/shared/shared-main' | ||
4 | |||
5 | @Component({ | ||
6 | selector: 'my-channels-setup-message', | ||
7 | templateUrl: './channels-setup-message.component.html', | ||
8 | styleUrls: [ './channels-setup-message.component.scss' ] | ||
9 | }) | ||
10 | export class ChannelsSetupMessageComponent implements OnInit { | ||
11 | @Input() hideLink = false | ||
12 | |||
13 | user: User = null | ||
14 | |||
15 | constructor ( | ||
16 | private authService: AuthService | ||
17 | ) {} | ||
18 | |||
19 | get userInformationLoaded () { | ||
20 | return this.authService.userInformationLoaded | ||
21 | } | ||
22 | |||
23 | get hasChannelNotConfigured () { | ||
24 | return this.user.videoChannels | ||
25 | .filter((channel: VideoChannel) => (!channel.avatar || !channel.description)) | ||
26 | .length > 0 | ||
27 | } | ||
28 | |||
29 | ngOnInit () { | ||
30 | this.user = this.authService.getUser() | ||
31 | } | ||
32 | } | ||
diff --git a/client/src/app/shared/shared-main/misc/index.ts b/client/src/app/shared/shared-main/misc/index.ts index dc8ef9754..24134d7cd 100644 --- a/client/src/app/shared/shared-main/misc/index.ts +++ b/client/src/app/shared/shared-main/misc/index.ts | |||
@@ -1,3 +1,4 @@ | |||
1 | export * from './channels-setup-message.component' | ||
1 | export * from './help.component' | 2 | export * from './help.component' |
2 | export * from './list-overflow.component' | 3 | export * from './list-overflow.component' |
3 | export * from './top-menu-dropdown.component' | 4 | export * from './top-menu-dropdown.component' |
diff --git a/client/src/app/shared/shared-main/shared-main.module.ts b/client/src/app/shared/shared-main/shared-main.module.ts index e5dfc59b2..80d0a84f3 100644 --- a/client/src/app/shared/shared-main/shared-main.module.ts +++ b/client/src/app/shared/shared-main/shared-main.module.ts | |||
@@ -34,7 +34,13 @@ import { CustomPageService } from './custom-page' | |||
34 | import { DateToggleComponent } from './date' | 34 | import { DateToggleComponent } from './date' |
35 | import { FeedComponent } from './feeds' | 35 | import { FeedComponent } from './feeds' |
36 | import { LoaderComponent, SmallLoaderComponent } from './loaders' | 36 | import { LoaderComponent, SmallLoaderComponent } from './loaders' |
37 | import { HelpComponent, ListOverflowComponent, SimpleSearchInputComponent, TopMenuDropdownComponent } from './misc' | 37 | import { |
38 | ChannelsSetupMessageComponent, | ||
39 | HelpComponent, | ||
40 | ListOverflowComponent, | ||
41 | SimpleSearchInputComponent, | ||
42 | TopMenuDropdownComponent | ||
43 | } from './misc' | ||
38 | import { PluginPlaceholderComponent } from './plugins' | 44 | import { PluginPlaceholderComponent } from './plugins' |
39 | import { ActorRedirectGuard } from './router' | 45 | import { ActorRedirectGuard } from './router' |
40 | import { UserHistoryService, UserNotificationsComponent, UserNotificationService, UserQuotaComponent } from './users' | 46 | import { UserHistoryService, UserNotificationsComponent, UserNotificationService, UserQuotaComponent } from './users' |
@@ -91,6 +97,7 @@ import { VideoChannelService } from './video-channel' | |||
91 | LoaderComponent, | 97 | LoaderComponent, |
92 | SmallLoaderComponent, | 98 | SmallLoaderComponent, |
93 | 99 | ||
100 | ChannelsSetupMessageComponent, | ||
94 | HelpComponent, | 101 | HelpComponent, |
95 | ListOverflowComponent, | 102 | ListOverflowComponent, |
96 | TopMenuDropdownComponent, | 103 | TopMenuDropdownComponent, |
@@ -146,6 +153,7 @@ import { VideoChannelService } from './video-channel' | |||
146 | LoaderComponent, | 153 | LoaderComponent, |
147 | SmallLoaderComponent, | 154 | SmallLoaderComponent, |
148 | 155 | ||
156 | ChannelsSetupMessageComponent, | ||
149 | HelpComponent, | 157 | HelpComponent, |
150 | ListOverflowComponent, | 158 | ListOverflowComponent, |
151 | TopMenuDropdownComponent, | 159 | TopMenuDropdownComponent, |