<!-- BEGIN result/panels.tt -->
    <div class="[% div_class %]">
      [% IF this_section.auto_expand.match('yes') %]
        <p class="indent info">panel(s) will auto-expand to individual tests;
			existing tests will NOT be re-requested (use 'single tests' to re-request)
        </p>
      [% END %]
      <table class="results">
        <tr>
          [% count = 1;
              # INCLUDE dumper.tt dump = panel_lab_tests;
              # INCLUDE dumper.tt dump = section;

            FOREACH entry IN this_section.panel; # PROCESS dumper.tt dump = entry;
              NEXT IF entry.value.has_results.match('yes'); # processed in individual tests
              NEXT UNLESS entry.value.is_active.match('yes');
              # get td background 'color' (expects 'test_data'):
              PROCESS result/colour.tt test_data = entry.value;
              # override clr if configured to expand panels to lab-tests:
              IF this_section.auto_expand.match('yes'); clr = '#c0c0c0'; END;
         %]
          <td align="right" width="170" >
            <span style="color: [% clr %]; background: [% bgclr %]; padding: 2px">
            [% IF entry.value.status; user = entry.value.user; %]
              <span class="acronym"
                 title="[% user.first_name _ ' ' _ user.last_name %]">
               [% entry.key %]
              </span>
            [% ELSE %]
              [% entry.key %]
            [% END %]
            </span>
          </td>

          <td style="width: 35px">[% # count %]
            [% IF is_locked %]
                <img src="/images/checkbox.png" title="locked" />
            [% ELSE %]
                <input type="checkbox" name="test_id" value="[% entry.value.id %]" />
                [% IF c.user_can('modify_results') AND entry.value.status
					AND NOT entry.value.status.match('complete');
                  USE url(
                    app_url _ '/worklist/display/' _ this_section.id,
                    lab_test_id = entry.value.id,
                    request_id = data.id,
                    display_format='Data Entry');
                %]
                  <a href="[% url %]" title="data entry worklist">
                    <i style="vertical-align: text-top" class="fa fa-plus-square"></i>
                  </a>
                [% END %]
            [% END %]
          </td>

        [% UNLESS loop.last OR # don't start new table unless multiple of 4:
          ( this_section.panel.size > 4 AND count % 4 ) %]
          </tr>
        </table>
        <table class="results">
          <tr>
        [% END %]

        [% count = count + 1 %]
      [% END %]

        </tr>
      </table>
    </div>
<!-- END result/panels.tt -->
