]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/search/search.component.html
add theming via css custom properties
[github/Chocobozzz/PeerTube.git] / client / src / app / search / search.component.html
index 83d014987321392495796220f0d4533aaa732793..a258d4edd279b31ee2c9956514b10e204a745980 100644 (file)
     </div>
   </div>
 
-  <div i18n *ngIf="pagination.totalItems === 0 && videoChannels.length === 0" class="no-result">
+  <div i18n *ngIf="pagination.totalItems === 0 && results.length === 0" class="no-results">
     No results found
   </div>
 
-  <div *ngFor="let videoChannel of videoChannels" class="entry video-channel">
-    <a [routerLink]="[ '/video-channels', videoChannel.name ]">
-      <img [src]="videoChannel.avatarUrl" alt="Avatar" />
-    </a>
-
-    <div class="video-channel-info">
-      <a [routerLink]="[ '/video-channels', videoChannel.name ]" class="video-channel-names">
-        <div class="video-channel-display-name">{{ videoChannel.displayName }}</div>
-        <div class="video-channel-name">{{ videoChannel.name }}</div>
+  <ng-container *ngFor="let result of results">
+    <div *ngIf="isVideoChannel(result)" class="entry video-channel">
+      <a [routerLink]="[ '/video-channels', result.nameWithHost ]">
+        <img [src]="result.avatarUrl" alt="Avatar" />
       </a>
 
-      <div i18n class="video-channel-followers">{{ videoChannel.followersCount }} subscribers</div>
-    </div>
+      <div class="video-channel-info">
+        <a [routerLink]="[ '/video-channels', result.nameWithHost ]" class="video-channel-names">
+          <div class="video-channel-display-name">{{ result.displayName }}</div>
+          <div class="video-channel-name">{{ result.nameWithHost }}</div>
+        </a>
 
-    <my-subscribe-button [videoChannel]="videoChannel"></my-subscribe-button>
-  </div>
+        <div i18n class="video-channel-followers">{{ result.followersCount }} subscribers</div>
+      </div>
 
-  <div *ngFor="let video of videos" class="entry video">
-    <my-video-thumbnail [video]="video"></my-video-thumbnail>
+      <my-subscribe-button *ngIf="isUserLoggedIn()" [videoChannel]="result"></my-subscribe-button>
+    </div>
 
-    <div class="video-info">
-      <a class="video-info-name" [routerLink]="['/videos/watch', video.uuid]" [attr.title]="video.name">{{ video.name }}</a>
-      <span i18n class="video-info-date-views">{{ video.publishedAt | myFromNow }} - {{ video.views | myNumberFormatter }} views</span>
-      <a class="video-info-account" [routerLink]="[ '/accounts', video.by ]">{{ video.by }}</a>
+    <div *ngIf="isVideo(result)" class="entry video">
+      <my-video-thumbnail [video]="result"></my-video-thumbnail>
+
+      <div class="video-info">
+        <a class="video-info-name" [routerLink]="['/videos/watch', result.uuid]" [attr.title]="result.name">{{ result.name }}</a>
+        <span i18n class="video-info-date-views">{{ result.publishedAt | myFromNow }} - {{ result.views | myNumberFormatter }} views</span>
+        <a class="video-info-account" [routerLink]="[ '/accounts', result.byAccount ]">{{ result.byAccount }}</a>
+      </div>
     </div>
-  </div>
+  </ng-container>
+
 </div>