<!-- BEGIN [% component.name %] -->
  <table class="tree">
    <tr>
      <td>
		[% div_name = 'uploads';
            INCLUDE site/snippets/toggleview.tt type = 'folder' %]
     </td>
      <td>
        <span class="title">File uploads</span>
      </td>
    </tr>
  </table>

    [%
	    base_addr = url_base.replace(':8000', '');
        MACRO fileuploader BLOCK; # http://www.template-toolkit.org/docs/manual/Directives.html#section_BLOCK
            "${base_addr}/fileuploader/${function}?c=${token.centre};"
                _ "u=${token.username};conflict_action=${action}";
        END;
        resource_map = {
            request_forms => {
                title   => 'Upload request forms',
                href    => fileuploader( function = 'request_forms' ),
                new_tab => 1,
            },
            flow_datafile => {
                title   => 'Upload flow cytometry datafile',
				href    => fileuploader( function = 'flow_data_files' ),
                new_tab => 1,
            },
            outreach_datafile => {
                new_tab => 1,
                title   => 'Upload outreach datafile',
                href    => fileuploader( function = 'outreach_flow_files' ),
            },
            bcr_abl_datafile => {
                title => 'Import BCR-ABL data file(s)',
                href  => app_url _ '/data-import/bcr_abl',
            },
            chimerism_datafile => {
                title => 'Import chimerism data file',
                href  => app_url _ '/data-import/chimerism',
            },
            cfh_datafile => {
                title => 'Upload new CfH data file',
                href  => app_url _ '/resources/data_file',
            },
			dna_concentration => {
				new_tab => 1,
				title   => 'Upload FluidX storage DNA concentration data file',
				href    => fileuploader( function = 'dna_concentration' ),
			},
            initial_request_forms => {
                new_tab => 1,
                title   => 'Upload initial request forms',
                href    => fileuploader( function = 'pre_registration' ),
            },
            genomics_fluidx_datafile => {
                new_tab => 1,
                title   => 'Upload Fluidx data-file',
                href    => fileuploader( function = 'fluidx_datafile' ),
            },
            generic_files => {
                title   => 'Upload generic files',
                href    => fileuploader( function = 'generic_files', action = 'rename' ),
                new_tab => 1,
            },
			ngis_requests => {
                new_tab => 1,
                title   => 'Upload NGIS requests data-file',
                href    => fileuploader( function = 'ngis_requests' ),
			},
			pnh_flow_files => {
                new_tab => 1,
                title   => 'Upload PNH flow data-files',
                href    => fileuploader( function = 'pnh_flow_files' action = 'rename' ),
 			},
            results_files => {
                new_tab => 1,
                title   => 'Upload results files',
                href    => fileuploader( function = 'results_files' ),
             },
            trial_edta_dna_results => {
				new_tab => 1,
				title   => 'Upload trial EDTA DNA concentrations data file',
				href    => fileuploader( function = 'trial_edta_dna_result' ),
            },
            trial_xna_extraction => {
				new_tab => 1,
				title   => 'Upload trial DNA/RNA concentrations data file',
				href    => fileuploader( function = 'trial_xna_extraction' ),
            },
        };
    %]

  <div class='itemhidden' id='[% div_name %]'>
    <table style="margin-left: 30px">
        [% BLOCK request_form;
            import( resource_map.${entry} ); %]
            <tr>
                <td><img alt="" src="/images/text.gif" class="text" /></td>
                <td>
                    <a class="nav" href="[% href %]"
                       [% IF new_tab %]target="_blank"[% END %]>[% title %]</a>
                </td>
            </tr>
        [% END %]
        [%
            lfu = [
              'resources/menu/local/file_uploads', c.cfg('settings').item('_centre')
            ];
            local_file_uploads = lfu.join('.');
            PROCESS $local_file_uploads;
        %]
    </table>
  </div>
<!-- END [% component.name %] -->
