aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-thumbnail
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-07-20 11:37:06 +0200
committerChocobozzz <me@florianbigard.com>2020-07-20 11:37:06 +0200
commit0bdad52fbbad81e7654adc495088da56a00437df (patch)
tree206f4693cc7fa62531fdf6830d6bf9fbbdc07cc1 /client/src/app/shared/shared-thumbnail
parent69a019968e225f1eac4a3df3041f141d0047d7f0 (diff)
downloadPeerTube-0bdad52fbbad81e7654adc495088da56a00437df.tar.gz
PeerTube-0bdad52fbbad81e7654adc495088da56a00437df.tar.zst
PeerTube-0bdad52fbbad81e7654adc495088da56a00437df.zip
Fix issues with external links in search page
Diffstat (limited to 'client/src/app/shared/shared-thumbnail')
-rw-r--r--client/src/app/shared/shared-thumbnail/video-thumbnail.component.html15
-rw-r--r--client/src/app/shared/shared-thumbnail/video-thumbnail.component.ts7
2 files changed, 15 insertions, 7 deletions
diff --git a/client/src/app/shared/shared-thumbnail/video-thumbnail.component.html b/client/src/app/shared/shared-thumbnail/video-thumbnail.component.html
index fe5510c56..0cb0f321b 100644
--- a/client/src/app/shared/shared-thumbnail/video-thumbnail.component.html
+++ b/client/src/app/shared/shared-thumbnail/video-thumbnail.component.html
@@ -1,7 +1,12 @@
1<a 1<a *ngIf="!videoHref" [routerLink]="getVideoRouterLink()" [queryParams]="queryParams" class="video-thumbnail">
2 [routerLink]="getVideoRouterLink()" [queryParams]="queryParams" 2 <ng-container *ngTemplateOutlet="aContent"></ng-container>
3 class="video-thumbnail" 3</a>
4> 4
5<a *ngIf="videoHref" [href]="videoHref" [target]="videoTarget" class="video-thumbnail">
6 <ng-container *ngTemplateOutlet="aContent"></ng-container>
7</a>
8
9<ng-template #aContent>
5 <img alt="" [attr.aria-label]="video.name" [attr.src]="getImageUrl()" [ngClass]="{ 'blur-filter': nsfw }" /> 10 <img alt="" [attr.aria-label]="video.name" [attr.src]="getImageUrl()" [ngClass]="{ 'blur-filter': nsfw }" />
6 11
7 <div *ngIf="displayWatchLaterPlaylist" class="video-thumbnail-actions-overlay"> 12 <div *ngIf="displayWatchLaterPlaylist" class="video-thumbnail-actions-overlay">
@@ -30,4 +35,4 @@
30 <div class="progress-bar" *ngIf="video.userHistory?.currentTime"> 35 <div class="progress-bar" *ngIf="video.userHistory?.currentTime">
31 <div [ngStyle]="{ 'width.%': getProgressPercent() }"></div> 36 <div [ngStyle]="{ 'width.%': getProgressPercent() }"></div>
32 </div> 37 </div>
33</a> 38</ng-template>
diff --git a/client/src/app/shared/shared-thumbnail/video-thumbnail.component.ts b/client/src/app/shared/shared-thumbnail/video-thumbnail.component.ts
index 3ff45d9b7..812c7a508 100644
--- a/client/src/app/shared/shared-thumbnail/video-thumbnail.component.ts
+++ b/client/src/app/shared/shared-thumbnail/video-thumbnail.component.ts
@@ -11,8 +11,11 @@ import { Video } from '../shared-main'
11export class VideoThumbnailComponent { 11export class VideoThumbnailComponent {
12 @Input() video: Video 12 @Input() video: Video
13 @Input() nsfw = false 13 @Input() nsfw = false
14 @Input() routerLink: any[] 14
15 @Input() videoRouterLink: any[]
15 @Input() queryParams: { [ p: string ]: any } 16 @Input() queryParams: { [ p: string ]: any }
17 @Input() videoHref: string
18 @Input() videoTarget: string
16 19
17 @Input() displayWatchLaterPlaylist: boolean 20 @Input() displayWatchLaterPlaylist: boolean
18 @Input() inWatchLaterPlaylist: boolean 21 @Input() inWatchLaterPlaylist: boolean
@@ -49,7 +52,7 @@ export class VideoThumbnailComponent {
49 } 52 }
50 53
51 getVideoRouterLink () { 54 getVideoRouterLink () {
52 if (this.routerLink) return this.routerLink 55 if (this.videoRouterLink) return this.videoRouterLink
53 56
54 return [ '/videos/watch', this.video.uuid ] 57 return [ '/videos/watch', this.video.uuid ]
55 } 58 }