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

    [% # INCLUDE dumper.tt dump = reports %]

	[% addcss = [ 'jquery.datetimepicker.css' ]  %]
	<script type="text/javascript" src="/js/jquery.datetimepicker.js"></script>
	<script type="text/javascript">
	  $( function(){ jQuery('.datepicker').datetimepicker(
		  { timepicker: false, format: 'd-m-Y' });
	  });
	</script>

    [% IF c.stash.error # flash/redirect doesn't work %]
        <p class="error">ERROR: [% c.stash.error %]</p>
    [% END %]

    <h3 class="header">
      Sample reports for
        [% type.remove('genomics_sample_report_').replace('_', ' ').upper %] samples
    </h3>

    <form action="[% app_url %]/local_worklist">
        <input type="hidden" name="function_name" value="[% c.query.param('function_name') %]" />
        <p class="info indent">Select dates
          from <input type="text" name="date_begin" placeholder="dd-mm-yyyy"
              value="[% c.query.param('date_begin') || dates.begin %]"
              class="datepicker" />
          to <input type="text" name="date_end" placeholder="dd-mm-yyyy"
              value="[% c.query.param('date_end') || dates.end %]"
              class="datepicker" />
          <input type="submit" value='Go' />
        </p>
    </form>

    [% IF reports.size;
        INCLUDE worklist/local/genomics/sample_report_cancer.tt IF type.match('cancer');
        INCLUDE worklist/local/genomics/sample_report_rare_disease.tt
            IF type.match('rare_disease');
    %]
    [% ELSIF c.query.param('date_begin') %]
        <p class="warning indent">No data for selected interval</p>
    [% END %]
<!-- END [% template.name %] -->
