<!DOCTYPE html>
{% autoescape true %}
<html lang="en">
    <head>
        {% include 'header_top.html' %}   
    </head>
    <body>

        <!-- If start = 0 -->
        {% if start==0 %}
        <div class="row text-center">
            <form name="start" action="/upload" method="post">
                <input type="submit" name="start" value="START UPLOAD" ></input>
                <input type="hidden" name="lastChunk" value="NA"></input>
                <input type="hidden" name="chunkList" value="{{ chunkList|join('$') }}"></input>
            </form>
        </div>
        {% endif %}

        <!-- If start = 1 -->
        {% if start==1 %} 
        <form name="chunkForm" id="chunkForm" action="/upload" method="post">
            <input type="hidden" name="lastChunk" value="{{ lastChunk }}"></input>
            <input type="hidden" name="chunkList" value="{{ chunkList|join('$') }}"></input>
        </form>
       
        <script type="text/javascript">
            window.onload=function(){
            document.getElementById('chunkForm').submit()
            }

        </script>
        {% endif %}
<!--        
        <form name="chunk" id="chunk" action="/upload" method="post">
            
            <div class="row text-center">
                <p> {{ uploadedChunk }} </p> 
            </div> 

            {% for chunk in chunkList %} 
            <div class="row text-center">
                            <input name="searchTerm" type="text" class="form-control input" placeholder="Search..." id="autocomplete_terms"></input>
                <button  class="btn btn-default" type="submit" value="{{ chunk }} - {{ chunkList|join('$') }}" name="chunkData"> {{ chunk }}</button>
            </div>
        {% endfor %}
        </form>
        -->
    </body>



</html>

{% endautoescape %}
