<div class="videos items past-broadcasts">
  {{#manager/video-manager channelName=model.channel.channelName videos=model.videos as |videoManager|}}
    {{#infinite-scroll loadMore=(route-action 'loadMorePastBroadcasts')
      isLoading=model.isLoading
      contentLength=videoManager.allVideos.length
      classNames="tower tower--bleed tower--240 tower--gutter-sm"}}
      {{#each videoManager.allVideos as |video|}}

        {{#if manager.model.can_create_offline_playlist}}
          {{#playlist-draggable-item content=video.id}}
            {{videoManager.videoCard
              video=video
              isPastBroadcasts=true
              highlightButton=true
              downloadButton=true
              editAction=(action videoManager.startEditingVideo video)
              moreDelete=true
              moreExport=true
              moreRebroadcast=manager.model.can_rebroadcast
              managerProperties=manager.model
            }}
          {{/playlist-draggable-item}}
        {{else}}
          {{videoManager.videoCard
            video=video
            isPastBroadcasts=true
            highlightButton=true
            downloadButton=true
            editAction=(action videoManager.startEditingVideo video)
            moreDelete=true
            moreExport=true
            moreRebroadcast=manager.model.can_rebroadcast
            managerProperties=manager.model
          }}
        {{/if}}

      {{/each}}
      {{tower-placeholder}}
    {{/infinite-scroll}}

    {{#common/modal-dialog
      showModal=(or
        (isPresent videoManager.currentEditorVideo)
        (isPresent videoManager.videoStagedForDeletion)
      )
      size='container-md'}}
      <div>
        {{#if videoManager.currentEditorVideo}}
          {{#modal-dialog action=videoManager.stopEditingVideo size="containerMd" as |modal|}}
            {{manager/video-uploads/form
              video=videoManager.currentEditorVideo
              onComplete=modal.close}}
          {{/modal-dialog}}
        {{/if}}

        {{#if videoManager.videoStagedForDeletion}}
          {{manager/confirm-delete-video
            video=videoManager.videoStagedForDeletion
            onConfirm=videoManager.deleteVideo
            onDismiss=videoManager.clearVideoStagedForDeletion}}
        {{/if}}
      </div>
    {{/common/modal-dialog}}
  {{/manager/video-manager}}
</div>

{{#if model.isLoading}}
  {{loading-more-spinner}}
{{else if (not model.content.length)}}
  <p class='empty-grid'>
    {{i18n "No Videos Found"}}
  </p>
{{/if}}
