<!-- BEGIN [% template.name %] -->
  [% META title = 'Worklist &raquo; DakoLink Labels' -%]

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

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

    <table class="indent">
     <tr class="borderless">
      [% count = 1 %]
    [% FOREACH data IN labels; # PROCESS dumper.tt dump = data.as_tree %]
      <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 [% template.name %] -->
