<!-- BEGIN worklist/local/labels/histology_staining.tt -->
  [% META title = 'Worklist &raquo; Histology Tinctorial Staining Labels' -%]

    [% # PROCESS dumper.tt dump = data %]
    [% # PROCESS dumper.tt dump = done %]
    
  <h3 class="header">Histology tinctorial staining labels</h3>

  [% IF labels.size %]
  <form name="labels" action="[% app_url%]/local_labels/print_histology_staining_labels"
          method="post">
    <p class="indent bold">Have [% labels.size - ( done.size || 0 ) %]
      sets of labels to print:</p>

    <table class="indent">
     <tr class="borderless">
      [% count = 1 %]
    [% FOREACH entry IN labels; # PROCESS dumper.tt dump = entry.as_tree;
         data = entry.request %]
      <td width="110" align="right">
        [% INCLUDE site/lab_number.tt want_url = 1 %] [% # data.id %]
      </td>
      <td>
        [% IF done.item(data.id) %]
          <img src="/images/tick.gif" />
        [% ELSE %]
          <input type="checkbox" name="request_id" value="[% data.id %]" />
        [% END %]
      </td>
      
      [% UNLESS loop.last OR # don't start new table unless multiple of 5:
          labels.size > 5 AND count % 5 %]
        </tr>
        </table>
        <table class="indent">
        <tr class="borderless">
      [% END %]
             
      [% count = count + 1 %]      
     [% END %]
     </tr>
    </table>    
    
    <input type="hidden" name="label_type" value="[% c.query.param('label_type') %]" />
    
    <p class="indent">
      <input type="button" name="CheckAll" value="Select all"
        onClick="checkAll(document.labels.request_id)">
      <input type="button" name="UnCheckAll" value="Clear all"
        onClick="uncheckAll(document.labels.request_id)">
      [% site.html.submit %]
    </p>
    </form>
  [% ELSE %]
    <p class="info indent">No labels to print</p>
  [% END %]
<!-- END worklist/local/labels/histology_staining.tt -->
