<!-- BEGIN [% template.name %] -->
  [% META title = 'Worklist &raquo; Outreach Pack Dispatches' -%]

    [% # PROCESS dumper.tt dump = packs %]
    
  [% # define some data structures:
    headers = [ 'LabNo' 'Name' 'NHS No.' 'Date' 'Location' 'Pack due' 'Enter' ];
  %]
  
  [% IF packs.size %]
  <h3 class="header">Outreach pack dispatches</h3>

  <form method="post" action="[% app_url %]/outreach/do_pack_dispatch">
    <table class="indent">
      <tr>
        <td>&nbsp;</td>
        [% FOREACH item IN headers %]
          <th scope="">[% item | html_line_break %]</th>
        [% END %]
      </tr>
  
      [% FOREACH data IN packs; # PROCESS dumper.tt dump = data.as_tree %]
      <tr>
        <td>[% loop.count %]
       <td>[% INCLUDE site/lab_number.tt want_url = 1 %]</td>
       <td>
           [% data.last_name  | upper %],
           [% data.first_name | ucfirst %]
       </td>
       <td>[% data.nhs_number %]</td>
       <td>[% data.created_at.strftime('%d.%b.%Y') %]</td>
       <td>[% data.location %]</td>
       <td>[% data.pack_due.strftime('%d.%b.%Y') %]</td>
       <td align="center">
          <input type="checkbox" name="request_id" value="[% data.id %]" />
       </td>
      </tr>
      [% END %]
      <tr class="borderless">
        <td colspan="7" align="center">
          [% site.html.submit %]
          [% site.html.reset %]
        </td>
      </tr>
    </table>
  </form>
  
  [% ELSE %]
    <p class="info indent">No Outreach pack dispatches due</p>
  [% END %]
<!-- END [% template.name %] -->
