diff options
author | Chocobozzz <me@florianbigard.com> | 2021-03-29 15:56:01 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-03-31 09:05:51 +0200 |
commit | 100d9ce23bb7c5186132607e4c444f9cba5002a4 (patch) | |
tree | 2028938d90321c6d2454c4aea2e6f24e53393a4a /client/src/app/+video-channels | |
parent | 900f7820814b95b07ef0bcac04036a95abfbe060 (diff) | |
download | PeerTube-100d9ce23bb7c5186132607e4c444f9cba5002a4.tar.gz PeerTube-100d9ce23bb7c5186132607e4c444f9cba5002a4.tar.zst PeerTube-100d9ce23bb7c5186132607e4c444f9cba5002a4.zip |
Add support button in channel page
Diffstat (limited to 'client/src/app/+video-channels')
4 files changed, 20 insertions, 1 deletions
diff --git a/client/src/app/+video-channels/video-channels.component.html b/client/src/app/+video-channels/video-channels.component.html index 9f9c1f2ca..b9ac13f09 100644 --- a/client/src/app/+video-channels/video-channels.component.html +++ b/client/src/app/+video-channels/video-channels.component.html | |||
@@ -7,6 +7,11 @@ | |||
7 | </a> | 7 | </a> |
8 | 8 | ||
9 | <my-subscribe-button *ngIf="!isManageable()" #subscribeButton [videoChannels]="[videoChannel]"></my-subscribe-button> | 9 | <my-subscribe-button *ngIf="!isManageable()" #subscribeButton [videoChannels]="[videoChannel]"></my-subscribe-button> |
10 | |||
11 | <button *ngIf="videoChannel.support" (click)="showSupportModal()" class="support-button peertube-button orange-button-inverted"> | ||
12 | <my-global-icon iconName="support" aria-hidden="true"></my-global-icon> | ||
13 | <span class="icon-text" i18n>Support</span> | ||
14 | </button> | ||
10 | </ng-template> | 15 | </ng-template> |
11 | 16 | ||
12 | <ng-template #ownerTemplate> | 17 | <ng-template #ownerTemplate> |
@@ -112,3 +117,5 @@ | |||
112 | 117 | ||
113 | <router-outlet></router-outlet> | 118 | <router-outlet></router-outlet> |
114 | </div> | 119 | </div> |
120 | |||
121 | <my-support-modal #supportModal [videoChannel]="videoChannel"></my-support-modal> | ||
diff --git a/client/src/app/+video-channels/video-channels.component.scss b/client/src/app/+video-channels/video-channels.component.scss index fb71844bd..ec8f67a7e 100644 --- a/client/src/app/+video-channels/video-channels.component.scss +++ b/client/src/app/+video-channels/video-channels.component.scss | |||
@@ -36,6 +36,10 @@ | |||
36 | @include avatar-row-responsive(var(--myChannelImgMargin), var(--myGreyChannelFontSize)); | 36 | @include avatar-row-responsive(var(--myChannelImgMargin), var(--myGreyChannelFontSize)); |
37 | } | 37 | } |
38 | 38 | ||
39 | .support-button { | ||
40 | @include button-with-icon(21px, 0, -1px); | ||
41 | } | ||
42 | |||
39 | .channel-description { | 43 | .channel-description { |
40 | grid-column: 1; | 44 | grid-column: 1; |
41 | } | 45 | } |
diff --git a/client/src/app/+video-channels/video-channels.component.ts b/client/src/app/+video-channels/video-channels.component.ts index 4fcc42103..a8ca3d6ff 100644 --- a/client/src/app/+video-channels/video-channels.component.ts +++ b/client/src/app/+video-channels/video-channels.component.ts | |||
@@ -5,6 +5,7 @@ import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core' | |||
5 | import { ActivatedRoute } from '@angular/router' | 5 | import { ActivatedRoute } from '@angular/router' |
6 | import { AuthService, MarkdownService, Notifier, RestExtractor, ScreenService } from '@app/core' | 6 | import { AuthService, MarkdownService, Notifier, RestExtractor, ScreenService } from '@app/core' |
7 | import { ListOverflowItem, VideoChannel, VideoChannelService, VideoService } from '@app/shared/shared-main' | 7 | import { ListOverflowItem, VideoChannel, VideoChannelService, VideoService } from '@app/shared/shared-main' |
8 | import { SupportModalComponent } from '@app/shared/shared-support-modal' | ||
8 | import { SubscribeButtonComponent } from '@app/shared/shared-user-subscription' | 9 | import { SubscribeButtonComponent } from '@app/shared/shared-user-subscription' |
9 | import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' | 10 | import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' |
10 | 11 | ||
@@ -14,6 +15,7 @@ import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' | |||
14 | }) | 15 | }) |
15 | export class VideoChannelsComponent implements OnInit, OnDestroy { | 16 | export class VideoChannelsComponent implements OnInit, OnDestroy { |
16 | @ViewChild('subscribeButton') subscribeButton: SubscribeButtonComponent | 17 | @ViewChild('subscribeButton') subscribeButton: SubscribeButtonComponent |
18 | @ViewChild('supportModal') supportModal: SupportModalComponent | ||
17 | 19 | ||
18 | videoChannel: VideoChannel | 20 | videoChannel: VideoChannel |
19 | hotkeys: Hotkey[] | 21 | hotkeys: Hotkey[] |
@@ -101,6 +103,10 @@ export class VideoChannelsComponent implements OnInit, OnDestroy { | |||
101 | this.notifier.success($localize`Username copied`) | 103 | this.notifier.success($localize`Username copied`) |
102 | } | 104 | } |
103 | 105 | ||
106 | showSupportModal () { | ||
107 | this.supportModal.show() | ||
108 | } | ||
109 | |||
104 | private loadChannelVideosCount () { | 110 | private loadChannelVideosCount () { |
105 | this.videoService.getVideoChannelVideos({ | 111 | this.videoService.getVideoChannelVideos({ |
106 | videoChannel: this.videoChannel, | 112 | videoChannel: this.videoChannel, |
diff --git a/client/src/app/+video-channels/video-channels.module.ts b/client/src/app/+video-channels/video-channels.module.ts index 1b58a1d92..408f86225 100644 --- a/client/src/app/+video-channels/video-channels.module.ts +++ b/client/src/app/+video-channels/video-channels.module.ts | |||
@@ -2,6 +2,7 @@ import { NgModule } from '@angular/core' | |||
2 | import { SharedFormModule } from '@app/shared/shared-forms' | 2 | import { SharedFormModule } from '@app/shared/shared-forms' |
3 | import { SharedGlobalIconModule } from '@app/shared/shared-icons' | 3 | import { SharedGlobalIconModule } from '@app/shared/shared-icons' |
4 | import { SharedMainModule } from '@app/shared/shared-main' | 4 | import { SharedMainModule } from '@app/shared/shared-main' |
5 | import { SharedSupportModal } from '@app/shared/shared-support-modal' | ||
5 | import { SharedUserSubscriptionModule } from '@app/shared/shared-user-subscription' | 6 | import { SharedUserSubscriptionModule } from '@app/shared/shared-user-subscription' |
6 | import { SharedVideoMiniatureModule } from '@app/shared/shared-video-miniature' | 7 | import { SharedVideoMiniatureModule } from '@app/shared/shared-video-miniature' |
7 | import { SharedVideoPlaylistModule } from '@app/shared/shared-video-playlist' | 8 | import { SharedVideoPlaylistModule } from '@app/shared/shared-video-playlist' |
@@ -19,7 +20,8 @@ import { VideoChannelsComponent } from './video-channels.component' | |||
19 | SharedVideoPlaylistModule, | 20 | SharedVideoPlaylistModule, |
20 | SharedVideoMiniatureModule, | 21 | SharedVideoMiniatureModule, |
21 | SharedUserSubscriptionModule, | 22 | SharedUserSubscriptionModule, |
22 | SharedGlobalIconModule | 23 | SharedGlobalIconModule, |
24 | SharedSupportModal | ||
23 | ], | 25 | ], |
24 | 26 | ||
25 | declarations: [ | 27 | declarations: [ |