<div
  class="session-publicationcheck"
  data-test-session-publicationcheck
>
  <SessionOverview
    @session={{@session}}
    @hideCheckLink={{true}}
    @sessionTypes={{this.sessionTypes}}
  />
  <div class="back-to-session">
    <LinkTo
      @route="session.index"
      @models={{array this.course @session}}
      data-test-back-to-session
    >
      <FaIcon @icon="arrow-rotate-left" />
      {{t "general.backToTitle" title=@session.title}}
    </LinkTo>
  </div>
  <div class="results" {{scroll-into-view}}>
    <div class="title" data-test-title>
      {{t "general.missingItems"}} ({{@session.allPublicationIssuesLength}})
    </div>
    <div class="session-publicationcheck-content">
      <table>
        <thead>
          <tr>
            <th>
              {{t "general.sessionTitle"}}
            </th>
            <th>
              {{t "general.offerings"}}
            </th>
            <th>
              {{t "general.terms"}}
            </th>
            <th>
              {{t "general.objectives"}}
            </th>
            <th>
              {{t "general.meshTerms"}}
            </th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td data-test-session-title>
              {{@session.title}}
            </td>
            {{#if @session.offerings.length}}
              <td class="yes" data-test-offerings>
                {{t "general.yes"}} ({{@session.offerings.length}})
              </td>
            {{else}}
              <td class="no" data-test-offerings>
                {{t "general.no"}}
              </td>
            {{/if}}
            {{#if @session.terms.length}}
              <td class="yes" data-test-terms>
                {{t "general.yes"}} ({{@session.terms.length}})
              </td>
            {{else}}
              <td class="no" data-test-terms>
                {{t "general.no"}}
              </td>
            {{/if}}
            {{#if (has-many-length @session "sessionObjectives")}}
              <td class="yes" data-test-objectives>
                {{t "general.yes"}} ({{has-many-length @session "sessionObjectives"}})
                {{#if this.showUnlinkIcon}}
                  <button
                    class="link-button"
                    type="button"
                    {{on "click" this.transitionToSession}}
                    data-test-unlink
                  >
                    <FaIcon
                      @icon="link-slash"
                    />
                  </button>
                {{/if}}
              </td>
            {{else}}
              <td class="no" data-test-objectives>
                {{t "general.no"}}
              </td>
            {{/if}}
            {{#if @session.meshDescriptors.length}}
              <td class="yes" data-test-mesh>
                {{t "general.yes"}} ({{@session.meshDescriptors.length}})
              </td>
            {{else}}
              <td class="no" data-test-mesh>
                {{t "general.no"}}
              </td>
            {{/if}}
          </tr>
        </tbody>
      </table>
    </div>
  </div>
</div>
