<!-- BEGIN [% component.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;
    %]

  [%
    followup_options = outreach.menu_options.followup_options;
    # INCLUDE dumper.tt dump = followup_options;
    followup_option_id = outreach.followup.followup_option_id;
    followup = outreach.followup;
  %]

  <tr>
    <td class="label">Follow up:</td>
    <td>
      <select name="followup_option_id" [% PROCESS is_disabled %]>
        <option value="">--select one--</option>
        [% PROCESS outreach/option_list.tt; # creates 'option_list', an array of
            # followup_options sorted by 'position' column:
            FOREACH o IN option_list; # INCLUDE dumper.tt dump = o %]
        <option value="[% o.id %]" [% 'selected' IF followup_option_id == o.id %]>
          [% o.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" id="pack_sent"
          value="[% followup.pack_sent.strftime('%a %d.%b.%Y') %]" />
        <span class="title">return due</span>:
        <input type="text" readonly="readonly" size="14" id="return_due"
          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" id="pack_due"
          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 [% component.name %] -->
