<html>
	<meta charset="UTF-8">
	<head>
		<title>3DPrinterOS Client</title>
		<link rel="stylesheet" type="text/css" href="/static/styles/style.css">
    	<style type="text/css">
			!!!STYLE!!!
	   	</style>
	</head>
	<body bgcolor=#003333>
		<div id='host_version' align='right' style='align: right; color: #006666'>!!!URL!!! !!!VERSION!!!</div>
		<div class="block1">
			<div class="block2">
				3DPrinterOS Client
			</div>
			<center>
        <p><h3>Upload G-code to local file storage</h3></p>
				<div class="block3">
					<form action="/upload_to_storage" method="post" enctype="multipart/form-data" id="upload_form">
            <label for="file">Please select a G-code file</label>
						<p><input type="file" name="file"></p>
						<input type="button" onClick=javascript:history.back() value="Back" class="big_button">
						<!-- <input type="button" onClick="location.href='/'" value="Back" class="big_button"> -->
                        <input type="submit" value="Upload" style="display: inline; background: #ff9900; margin-bottom: 0px;" class="big_button submit_button" id="upload_button">
                        <!--<input type="submit" value="Upload" onClick="location.href='/upload_to_storage_page' + printer_id_args" style="display: inline; background: #ff9900; margin-bottom: 0px;" class="big_button submit_button" id="upload_button">-->
					</form>
				</div>
			</center>
		</div>
    <script src="/static/scripts/jquery.js"></script>
    <script src="/static/scripts/animate_submit_button.js"></script>
    <script> 
            var print_start_args = "";
            $(document).ready(function(){
                console.log("Search:" + window.location.search)
                if (window.location.search) {
                    $("#upload_button").attr("value", "Upload&Print");
                    printer_id_args = window.location.search;
                    $("#upload_form").attr("action", "/upload_to_storage" + printer_id_args + "&start_print=1");
                };
            });
    </script>
	</body>
</html>
