<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{{ page_title }}</title>

    <link rel="stylesheet" type="text/css" href="{{ style.skin_css }}">
    <link rel="stylesheet" type="text/css" href="/static/legacy/style.css">
    <script src="/static/legacy/action_buttons.js"></script>    
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.13.3/css/selectize.css" />
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.13.3/js/standalone/selectize.min.js"></script>

</head>
<body>
    {% include 'legacy/bloom_header.html' %}
    
    <h1>Bulk File Creation</h1>
    <p>
        Use this form to upload a TSV file for bulk file creation. Your TSV file should contain the following columns:
    </p>
    <ul>
        <li><strong>name</strong>: The name of the file.</li>
        <li><strong>comments</strong>: Any comments or description about the file.</li>
        <li><strong>lab_code</strong>: The laboratory code associated with the file.</li>
        <li><strong>urls</strong>: Comma-separated list of URLs pointing to the file locations.</li>
        <li><strong>s3_uris</strong>: Comma-separated list of S3 URIs pointing to the file locations.</li>
        <li><strong>study_id</strong>: The ID of the study the file belongs to.</li>
        <li><strong>clinician_id</strong>: The ID of the clinician associated with the file.</li>
        <li><strong>record_datetime</strong>: The start datetime of the record (format: YYYY-MM-DDThh:mm:ss).</li>
        <li><strong>record_datetime_end</strong>: The end datetime of the record (format: YYYY-MM-DDThh:mm:ss).</li>
        <li><strong>patient_id</strong>: The ID of the patient associated with the file.</li>
        <li><strong>purpose</strong>: The purpose of the file (e.g., Research).</li>
        <li><strong>category</strong>: The category of the file (e.g., Genomics).</li>
        <li><strong>sub_category</strong>: The sub-category of the file (e.g., DNA).</li>
        <li><strong>sub_category_2</strong>: Additional sub-category information (e.g., WGS).</li>
        <li><strong>variable</strong>: The primary variable associated with the file (e.g., Age).</li>
        <li><strong>sub_variable</strong>: Secondary variable information (e.g., Gender).</li>
        <li><strong>file_tags</strong>: Comma-separated tags associated with the file.</li>
        <li style="display:none;"><strong>further_metadata</strong>: A JSON string with additional metadata as key-value pairs.</li>
    </ul>
    <p>
        You can download a template TSV file here:
        <a href="/static/template_bulk_create_files.tsv" download>template_bulk_create_files.tsv</a>
    </p>
    <hr>
    <form id="bulkCreateForm" action="/bulk_create_files_from_tsv" method="post" enctype="multipart/form-data">
        <label for="tsv_file">Upload TSV File:</label>
        <input type="file" id="tsv_file" name="file" accept=".tsv" required>
        <br><br>
        <button type="submit">Submit</button>
    </form>
    
</body>
</html>