]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+search/search.component.html
Fix issues with external links in search page
[github/Chocobozzz/PeerTube.git] / client / src / app / +search / search.component.html
index 9bff024ad872963199c1b38f3b8949ac317e5818..84be4fb1405676ed2e9ef1e8b1c28a2afa27df39 100644 (file)
 
   <ng-container *ngFor="let result of results">
     <div *ngIf="isVideoChannel(result)" class="entry video-channel">
-      <a [routerLink]="getChannelUrl(result)">
+      <a *ngIf="!isExternalChannelUrl()" [routerLink]="getChannelUrl(result)">
+        <img [src]="result.avatarUrl" alt="Avatar" />
+      </a>
+
+      <a *ngIf="isExternalChannelUrl()" [href]="getChannelUrl(result)" target="_blank">
         <img [src]="result.avatarUrl" alt="Avatar" />
       </a>
 
       <div class="video-channel-info">
-        <a [routerLink]="getChannelUrl(result)" class="video-channel-names">
+        <a *ngIf="!isExternalChannelUrl()" [routerLink]="getChannelUrl(result)" class="video-channel-names">
+          <ng-container *ngTemplateOutlet="aContent"></ng-container>
+        </a>
+
+        <a *ngIf="isExternalChannelUrl()" [href]="getChannelUrl(result)" target="_blank" class="video-channel-names">
+          <ng-container *ngTemplateOutlet="aContent"></ng-container>
+        </a>
+
+        <ng-template #aContent>
           <div class="video-channel-display-name">{{ result.displayName }}</div>
           <div class="video-channel-name">{{ result.nameWithHost }}</div>
-        </a>
+        </ng-template>
 
         <div i18n class="video-channel-followers">{{ result.followersCount }} subscribers</div>
       </div>
@@ -54,7 +66,7 @@
     <div *ngIf="isVideo(result)" class="entry video">
       <my-video-miniature
         [video]="result" [user]="userMiniature" [displayAsRow]="true" [displayVideoActions]="!hideActions()"
-        [displayOptions]="videoDisplayOptions" [useLazyLoadUrl]="advancedSearch.searchTarget === 'search-index'"
+        [displayOptions]="videoDisplayOptions" [videoLinkType]="getVideoLinkType()"
         (videoBlocked)="removeVideoFromArray(result)" (videoRemoved)="removeVideoFromArray(result)"
       ></my-video-miniature>
     </div>