{{#if model.forbidden}}
  <p class='empty-grid'>
    {{i18n "You are not an editor of this channel"}}
  </p>
{{else}}
  {{#if login.isLoggedIn}}
    {{#if model.isLoaded}}
      <div id='directory-list'>
        <div class='manager' id='video-manager' data-playlistscroll="0">
          <div class='directory_header'>
            <div class="flex flex--verticalCenter">
              <h2 class='title flex__item'>{{i18n 'Video Manager'}}</h2>
              {{#if activeUploadsTab}}
                <div class="flex__item" style="margin-left: auto">
                  {{#link-to 'dashboards.video-stats' class="float-left mg-r-1 button button--text"}}
                    {{t 'general.Twitch.videoStats'}}
                  {{/link-to}}

                  <a href='https://help.twitch.tv/customer/en/portal/articles/2577667-video-upload-guide' class="float-left mg-r-1 button button--text" target="_blank" rel="noopener noreferrer">
                    {{t 'general.forms.help'}}
                  </a>

                  {{manager/video-upload-button
                    channelName=model.id
                    isEmailVerified=model.emailVerified
                    onFileChange=(route-action 'showSchedulingModal')
                    class='float-left'}}
                </div>
              {{/if}}
            </div>
            {{#common/tab-container class="js-nav"}}
              {{#common/tab-item}}
                {{#link-to "manager.past-broadcasts.all"}}
                  {{i18n 'Past Broadcasts'}}
                  {{#if model.save_vods_forever}}
                    <span class="pill pill--green">{{i18n "Saved Forever"}}</span>
                  {{/if}}
                {{/link-to}}
              {{/common/tab-item}}
              {{#common/tab-item}}
                {{#link-to "manager.highlights"}}
                  {{i18n 'Highlights'}}
                {{/link-to}}
              {{/common/tab-item}}
              {{#common/tab-item}}
                {{#link-to "manager.uploads"}}
                  {{i18n 'Uploads'}}
                  <span class="pill"> {{i18n "Beta"}} </span>
                {{/link-to}}
                {{#if activeUploadsTab}}
                  {{video/upload-tab}}
                {{/if}}
              {{/common/tab-item}}
              {{#if (or (in-experiment-group 'PERPETUA' 'early') (in-experiment-group 'PERPETUA' 'mid'))}}
                {{#common/tab-item}}
                  {{#link-to 'manager.collections' data-test-selector="manager-playlists-tab"}}
                    {{i18n 'Collections'}}
                  {{/link-to}}
                {{/common/tab-item}}
              {{/if}}

            {{/common/tab-container}}
          </div>

          <div class='videos-grid items-grid'>
            {{outlet}}
          </div>
        </div>
      </div>

      {{!-- rebroadcast panel --}}
      <div class="{{unless showRebroadcastPanel "hidden"}}" id='rebroadcast-panel'>
        <div class="rebroadcast-control">
          <a {{action "startRebroadcast" }} class="rebroadcast-control__button button">
            {{i18n "Start Rebroadcast"}}
          </a>
          <div {{action "hideRebroadcastPanel"}} class="close">
            {{partial 'svg/close'}}
          </div>
        </div>

        <div class="rebroadcast-list">
          <div class="list-header">
            <div class="video-name sub-text">{{i18n 'Video'}}</div>
            <div class="file-type sub-text">{{i18n 'File Type'}}</div>
            <div class="list-action"></div>
          </div>

          <ul class="list">
            {{#each rebroadcastList as |video|}}
              <li>
                <div class="video-name">
                  <span class="title">{{video.title}}</span>
                  <span class="sub-text">{{length-as-clock video.length}}</span>
                </div>
                <div class="file-type sub-text">{{i18n 'HLS'}}</div>
                <div {{action "removeFromRebroadcastList" video}} class="list-action click_to_remove">
                  {{partial 'svg/trash'}}
                </div>
              </li>
            {{/each}}
          </ul>
        </div>
      </div>
      {{!-- /rebroadcast panel --}}
    {{/if}}
  {{else}}
    <p class='empty-grid' data-test-manager-login-msg>
      {{i18n "You must be logged in to use the video manager."}}
    </p>
  {{/if}}
{{/if}}

{{#if canCreateOfflinePlaylist}}
  {{to-elsewhere named='right-column' send=(component 'offline-playlist-manager' model=model._id)}}
{{/if}}

{{#if transitionPendingConfirmation}}
  {{manager/confirm-leave-with-uploads
    cancel=(action 'cancelTransition')
    confirm=(action 'confirmPendingTransition')}}
{{/if}}

{{#if fileToUpload}}
  {{#modal-dialog action=(action 'cancelUpload')}}
    {{manager/create-video-form
      file=fileToUpload
      onSubmit=(action 'startUpload')
      onCancel=(action 'cancelUpload')
      channelName=model.id}}
  {{/modal-dialog}}
{{/if}}
