<!-- BEGIN [% template.name %] -->
    [% BLOCK is_disabled; # followup menu replaced by edit link if option set:
        is_disabled = outreach.followup
        ? 1 : 0; # set flag for later
        site.html.disabled IF is_disabled;
        END;
    %]

  [% # PROCESS dumper.tt dump = outreach.menu_options.followup_options %]
  [%  followup_options = outreach.menu_options.followup_options;
      nsorted_opts = natural_sort(followup_options.keys); # PROCESS dumper.tt dump = nsorted_opts;
      followup = outreach.followup;
  %]

  <tr>
    <td class="label">Follow up:</td>
    <td>
      <select name="followup_option_id" [% PROCESS is_disabled %]>
        <option value="">--select one--</option>
        [% FOREACH opt_id IN nsorted_opts;
          label = followup_options.item(opt_id).label;
        %]
        <option value="[% opt_id %]" [% 'selected' IF
            followup.followup_option_id == opt_id %]>
          [% label %]
        </option>
      [% END %]
      </select>
      
      [% IF followup.appointment_date # display appointmemt date: %]
        <span class="title">appointment date</span>:
        <input value="[% followup.appointment_date.strftime('%d.%b.%Y') %]"
            type="text" readonly="readonly" size="10" />
      [% END %]

      [% IF followup.pack_sent # display sent & returns due dates: %]
        <span class="title">pack sent</span>:
        <input type="text" readonly="readonly" size="14"
          value="[% followup.pack_sent.strftime('%a %d.%b.%Y') %]" />
        <span class="title">return due</span>:
        <input type="text" readonly="readonly" size="14"
          value="[% followup.return_due.strftime('%a %d.%b.%Y') %]" />

      [% ELSIF followup.pack_due # display dispatch due date %]
        <span class="title">pack dispatch due</span>:
        <input type="text" readonly="readonly" size="10"
          value="[% followup.pack_due.strftime('%d.%b.%Y') %]" />
      [% END %]
      
      [% IF is_disabled # provide link to edit: %]
      <a href="[% app_url %]/outreach/edit_followup/[% request_data.id %]">[ edit ]</a>
      [% END %]
      <input type="hidden" name="is_outreach" value="1" />
    </td>
  </tr>
<!-- END [% template.name %] -->
