]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/search/search.component.html
Speedup video watch layout build
[github/Chocobozzz/PeerTube.git] / client / src / app / search / search.component.html
index 83d014987321392495796220f0d4533aaa732793..0a9f78cb26c55ed7fa4e913d7ff05bf9e8455192 100644 (file)
@@ -9,11 +9,14 @@
       </div>
 
       <div
-        class="results-filter-button" (click)="isSearchFilterCollapsed = !isSearchFilterCollapsed" role="button"
+        class="results-filter-button ml-auto" (click)="isSearchFilterCollapsed = !isSearchFilterCollapsed" role="button"
         [attr.aria-expanded]="!isSearchFilterCollapsed" aria-controls="collapseBasic"
       >
         <span class="icon icon-filter"></span>
-        <ng-container i18n>Filters</ng-container>
+        <ng-container i18n>
+          Filters
+          <span *ngIf="numberOfFilters() > 0" class="badge badge-secondary">{{ numberOfFilters() }}</span>
+        </ng-container>
       </div>
     </div>
 
     </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 [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-miniature
+        [video]="result" [user]="user" [displayAsRow]="true"
+        (videoBlacklisted)="removeVideoFromArray(result)" (videoRemoved)="removeVideoFromArray(result)"
+      ></my-video-miniature>
     </div>
-  </div>
+  </ng-container>
+
 </div>