hummingbird-me/kitsu-web

View on GitHub
app/templates/components/users/library/library-list.hbs

Summary

Maintainability
Test Coverage
{{! Library Bulk Edit }}
{{#if hasSelectedMedia}}
  {{users/library/library-list/bulk-edit
    media=media
    status=status
    selectedCount=selectedLibraryEntries.length
    selectAll=(action "selectAll")
    resetSelection=(action "resetSelection")
    removeEntriesBulk=(action "removeEntriesBulk" selectedLibraryEntries)
    updateStatusBulk=(action "updateStatusBulk" selectedLibraryEntries)
  }}
{{/if}}

<table class="table table-responsive library-list">
  <thead>
    <tr>
      <th class="status"></th>
      {{#if (can "edit library-entry" libraryEntries.firstObject)}}
        <th></th>
      {{/if}}
      <th class="media-cell">{{t "users.library.list.table-header.title" type=media}}</th>
      <th class="rating-cell">{{t "users.library.list.table-header.rating"}}</th>
      <th class="progress-cell">{{t "users.library.list.table-header.progress"}}</th>
      {{#if (eq media "manga")}}
        <th class="progress-cell">{{t "users.library.list.table-header.volumes"}}</th>
      {{/if}}
      <th class="edit-entry"></th>
    </tr>
  </thead>
  <tbody>
    {{#if isLoading}}
      {{users/library/library-list/loader}}
    {{else}}
      {{#each libraryEntries as |libraryEntry|}}
        {{#occludable-area rootMargin=(hash bottom=1000) bufferClass="library-occlusion-buffer-list"}}
          {{users/library/library-list/library-entry
            libraryEntry=libraryEntry
            isChecked=(contains libraryEntry selectedLibraryEntries)
            saveEntry=saveEntry
            removeEntry=removeEntry
            checkedEntry=(action "selectEntry")
          }}
        {{/occludable-area}}
      {{else}}
        {{users/library/library-empty media=media user=user isSearching=isSearching}}
      {{/each}}
    {{/if}}
  </tbody>
</table>