[%- IF results.size -%]
  [% WRAPPER 'components/with-pager.tt' search=1 %]
  <table class="tbl">
    <thead>
      <tr>
        <th>[% l('Score') %]</th>
        <th class="video c"></th>
        <th>[% l('Name') %]</th>
        <th class="treleases">[% l('Length') %]</th>
        <th>[% l('Artist') %]</th>
        <th>[% l('ISRCs') %]</th>
        <th>[% l('Release') %]</th>
        [%- IF c.try_get_session('tport') -%]
          <th>[% l('Tagger') %]</th>
        [%- END %]
        <th class="t pos">[% l('Track') %]</th>
        <th>[% l('Medium') %]</th>
        <th>[% l('Type') %]</th>
      </tr>
    </thead>
    <tbody>
      [%- linenum = 0 -%]
      [%- FOR result=results -%]
        [% IF result.extra.size %]
          [%- FOR release=result.extra -%]
            <tr[% ' class="even"' IF linenum % 2 == 0 %]>
              [%- IF loop.count == 1 -%]
                <td>[% result.score %]</td>
                <td class="video c[%- IF result.entity.video %] is-video[%- END -%]"[% IF result.entity.video %] title="[% l("This recording is a video") %]"[% END %]></td>
                <td>[% link_entity(result.entity) %]</td>
                <td>[% result.entity.length | format_length %]</td>
                <td>[% artist_credit(result.entity.artist_credit) %]</td>
                <td>
                  [% FOR isrc=result.entity.isrcs %]
                    [% link_isrc(isrc) %]<br />
                  [% END %]
                </td>
              [%- ELSE -%]
                <td colspan="6">&#xa0;</td>
              [%- END -%]
              <td>[%- link_entity(release) -%]</td>
              [%- IF c.try_get_session('tport') -%]
                <td>[% tagger_icon(release) %]</td>
              [%- END -%]
              <td>[%- release.find_track_for_recording(result.entity).position -%]/[%- release.combined_track_count -%]</td>
              <td>[%- release.find_medium_for_recording(result.entity).position -%]</td>
              <td>[%- release.release_group.l_type_name -%]</td>
              [%- linenum = linenum + 1 -%]
            </tr>
          [%- END -%]
        [% ELSE %]
          <tr[% ' class="even"' IF linenum % 2 == 0 %]>
            <td>[% result.score %]</td>
            <td class="video c[%- IF result.entity.video %] is-video[%- END -%]"[% IF result.entity.video %] title="[% l("This recording is a video") %]"[% END %]></td>
            <td>[% link_entity(result.entity) %]</td>
            <td>[% result.entity.length | format_length %]</td>
            <td>[% artist_credit(result.entity.artist_credit) %]</td>
            <td>
              [% FOR isrc=result.entity.isrcs %]
                [% link_isrc(isrc) %]<br />
              [% END %]
            </td>
            <td>[% l('(standalone recording)') %]</td>
            [%- IF c.try_get_session('tport') -%]
              <td>[% tagger_icon(result.entity) %]</td>
            [%- END -%]
            <td colspan="5">&#xa0;</td>
            [%- linenum = linenum + 1 -%]
          </tr>
        [% END %]
      [%- END -%]
    </tbody>
  </table>
  [% END %]
[%- ELSE -%]
  <p>[% l('No results found. Try refining your search query.') %]</p>
[%- END -%]
