Chocobozzz/PeerTube

View on GitHub
client/src/app/+my-library/my-videos/my-videos.component.html

Summary

Maintainability
Test Coverage
<div class="sub-title-container">
  <div class="sub-title">
    <my-global-icon iconName="videos" aria-hidden="true"></my-global-icon>
    <h1 i18n>My videos</h1>
    <span *ngIf="pagination.totalItems" [title]="getTotalTitle()" class="pt-badge badge-secondary"> {{ pagination.totalItems }}</span>
  </div>

  <div>
    <a routerLink="/my-library/video-imports" class="peertube-button-link grey-button peertube-button-icon me-2">
      <my-global-icon iconName="cloud-download" aria-hidden="true"></my-global-icon>
      <ng-container i18n>My imports</ng-container>
    </a>

    <a routerLink="/my-library/ownership" class="peertube-button-link grey-button peertube-button-icon">
      <my-global-icon iconName="users" aria-hidden="true"></my-global-icon>
      <ng-container i18n>Ownership changes</ng-container>
    </a>
  </div>
</div>

<div class="videos-header d-flex justify-content-between gap-2">
  <my-advanced-input-filter [emitOnInit]="false" [filters]="inputFilters" (search)="onSearch($event)"></my-advanced-input-filter>

  <div class="peertube-select-container peertube-select-button">
    <select [(ngModel)]="sort" (ngModelChange)="onChangeSortColumn()" class="form-control" i18n-ariaLabel aria-label="Sort by">
      <option value="-publishedAt" i18n>Last published first</option>
      <option value="-createdAt" i18n>Last created first</option>
      <option value="-views" i18n>Most viewed first</option>
      <option value="-likes" i18n>Most liked first</option>
      <option value="-duration" i18n>Longest first</option>
    </select>
  </div>
</div>

<my-videos-selection
  [videosContainedInPlaylists]="videosContainedInPlaylists"
  [pagination]="pagination"
  [(selection)]="selection"
  [(videosModel)]="videos"
  [miniatureDisplayOptions]="miniatureDisplayOptions"
  [titlePage]="titlePage"
  [getVideosObservableFunction]="getVideosObservableFunction"
  [user]="user"
  [disabled]="disabled"
  #videosSelection
>
  <ng-template ptTemplate="globalButtons">
    <button class="action-button action-button-delete-selection" (click)="deleteSelectedVideos()">
      <my-global-icon iconName="delete" aria-hidden="true"></my-global-icon>
      <ng-container i18n>Delete</ng-container>
    </button>
  </ng-template>

  <ng-template ptTemplate="rowButtons" let-video>
    <div class="action-button">
      <my-edit-button label [ptRouterLink]="[ '/videos', 'update', video.shortUUID ]"></my-edit-button>

      <my-video-actions-dropdown
        [video]="video" [displayOptions]="videoDropdownDisplayOptions" [moreActions]="moreVideoActions"
        buttonStyled="true" buttonDirection="horizontal" (videoRemoved)="onVideoRemoved(video)"
      ></my-video-actions-dropdown>
    </div>
  </ng-template>
</my-videos-selection>

<my-video-change-ownership #videoChangeOwnershipModal></my-video-change-ownership>