diff options
author | Chocobozzz <me@florianbigard.com> | 2021-01-15 10:19:12 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-01-15 10:23:40 +0100 |
commit | 7af5ded409c50f4f19a220cea36a8bbd16b0be24 (patch) | |
tree | a46771b710a642a8be3c15d2293a501929124fbf /client/src | |
parent | dd9c7929e605be0b7341b19ab5f4aa3eb0cc4524 (diff) | |
download | PeerTube-7af5ded409c50f4f19a220cea36a8bbd16b0be24.tar.gz PeerTube-7af5ded409c50f4f19a220cea36a8bbd16b0be24.tar.zst PeerTube-7af5ded409c50f4f19a220cea36a8bbd16b0be24.zip |
Put feed url as link
Diffstat (limited to 'client/src')
3 files changed, 18 insertions, 17 deletions
diff --git a/client/src/app/+videos/video-list/video-user-subscriptions.component.ts b/client/src/app/+videos/video-list/video-user-subscriptions.component.ts index 6d19707df..62d862ec9 100644 --- a/client/src/app/+videos/video-list/video-user-subscriptions.component.ts +++ b/client/src/app/+videos/video-list/video-user-subscriptions.component.ts | |||
@@ -60,22 +60,24 @@ export class VideoUserSubscriptionsComponent extends AbstractVideoList implement | |||
60 | tokens => { | 60 | tokens => { |
61 | const feeds = this.videoService.getVideoSubscriptionFeedUrls(user.account.id, tokens.feedToken) | 61 | const feeds = this.videoService.getVideoSubscriptionFeedUrls(user.account.id, tokens.feedToken) |
62 | feedUrl = feedUrl + feeds.find(f => f.format === FeedFormat.RSS).url | 62 | feedUrl = feedUrl + feeds.find(f => f.format === FeedFormat.RSS).url |
63 | |||
64 | this.actions.unshift({ | ||
65 | label: $localize`Copy feed URL`, | ||
66 | iconName: 'syndication', | ||
67 | justIcon: true, | ||
68 | href: feedUrl, | ||
69 | click: e => { | ||
70 | e.preventDefault() | ||
71 | copyToClipboard(feedUrl) | ||
72 | this.activateCopiedMessage() | ||
73 | } | ||
74 | }) | ||
63 | }, | 75 | }, |
64 | 76 | ||
65 | err => { | 77 | err => { |
66 | this.notifier.error(err.message) | 78 | this.notifier.error(err.message) |
67 | } | 79 | } |
68 | ) | 80 | ) |
69 | |||
70 | this.actions.unshift({ | ||
71 | label: $localize`Feed`, | ||
72 | iconName: 'syndication', | ||
73 | justIcon: true, | ||
74 | click: () => { | ||
75 | copyToClipboard(feedUrl) | ||
76 | this.activateCopiedMessage() | ||
77 | } | ||
78 | }) | ||
79 | } | 81 | } |
80 | 82 | ||
81 | ngOnDestroy () { | 83 | ngOnDestroy () { |
diff --git a/client/src/app/shared/shared-video-miniature/abstract-video-list.html b/client/src/app/shared/shared-video-miniature/abstract-video-list.html index 18294513f..368a7d70e 100644 --- a/client/src/app/shared/shared-video-miniature/abstract-video-list.html +++ b/client/src/app/shared/shared-video-miniature/abstract-video-list.html | |||
@@ -12,13 +12,12 @@ | |||
12 | <a *ngIf="action.routerLink" class="ml-2" [routerLink]="action.routerLink" routerLinkActive="active"> | 12 | <a *ngIf="action.routerLink" class="ml-2" [routerLink]="action.routerLink" routerLinkActive="active"> |
13 | <ng-container *ngTemplateOutlet="actionContent; context:{ $implicit: action }"></ng-container> | 13 | <ng-container *ngTemplateOutlet="actionContent; context:{ $implicit: action }"></ng-container> |
14 | </a> | 14 | </a> |
15 | <a *ngIf="!action.routerLink && action.click && !action.clipboard" class="ml-2" (click)="action.click()" (key.enter)="action.click()"> | 15 | |
16 | <ng-container *ngTemplateOutlet="actionContent; context:{ $implicit: action }"></ng-container> | 16 | <a *ngIf="!action.routerLink && !action.href && action.click" class="ml-2" (click)="action.click($event)" (key.enter)="action.click($event)"> |
17 | </a> | ||
18 | <a *ngIf="!action.routerLink && !action.click && action.clipboard" class="ml-2" [cdkCopyToClipboard]="action.clipboard"> | ||
19 | <ng-container *ngTemplateOutlet="actionContent; context:{ $implicit: action }"></ng-container> | 17 | <ng-container *ngTemplateOutlet="actionContent; context:{ $implicit: action }"></ng-container> |
20 | </a> | 18 | </a> |
21 | <a *ngIf="!action.routerLink && action.click && action.clipboard" class="ml-2" (click)="action.click()" (key.enter)="action.click()" [cdkCopyToClipboard]="action.clipboard"> | 19 | |
20 | <a *ngIf="!action.routerLink && action.href && action.click" class="ml-2" (click)="action.click($event)" (key.enter)="action.click($event)" [href]="action.href"> | ||
22 | <ng-container *ngTemplateOutlet="actionContent; context:{ $implicit: action }"></ng-container> | 21 | <ng-container *ngTemplateOutlet="actionContent; context:{ $implicit: action }"></ng-container> |
23 | </a> | 22 | </a> |
24 | 23 | ||
diff --git a/client/src/app/shared/shared-video-miniature/abstract-video-list.ts b/client/src/app/shared/shared-video-miniature/abstract-video-list.ts index c55e85afe..a5f22585d 100644 --- a/client/src/app/shared/shared-video-miniature/abstract-video-list.ts +++ b/client/src/app/shared/shared-video-miniature/abstract-video-list.ts | |||
@@ -74,8 +74,8 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy, DisableFor | |||
74 | label: string | 74 | label: string |
75 | justIcon?: boolean | 75 | justIcon?: boolean |
76 | routerLink?: string | 76 | routerLink?: string |
77 | click?: Function | 77 | href?: string |
78 | clipboard?: string | 78 | click?: (e: Event) => void |
79 | }[] = [] | 79 | }[] = [] |
80 | 80 | ||
81 | onDataSubject = new Subject<any[]>() | 81 | onDataSubject = new Subject<any[]>() |