{{define "download_password"}}{{template "header" .}}
 
 {{ if .EndToEndEncryption }}
<script>
		parseHashValue({{.Id}});
</script>
{{ end }}
 
      <div class="row">
        <div class="col">
		<div class="card" style="width: 18rem;">
		  <div class="card-body">
		    <h4 class="card-title">Password required</h4>
			<form method="post" action="./d?id={{.Id}}" id="form" name="form" onSubmit="submitForm()">
			  <div class="form-group">
			    <br><input type="password" minlength="1" class="form-control" id="passwordFile" placeholder="Enter password" required>
				<input type="hidden" id="pw_hidden" name="password">
			  </div>
{{ if .IsFailedLogin }}
				<span style="color:red"> Incorrect password!</span><br>
{{ end }}
			  <br><button type="submit" class="btn btn-outline-light">Continue</button>
			</form>
		  </div>
		</div>
	    </div>
    </div>

<script>
function submitForm(){
	document.getElementById("passwordFile").disabled = true;
	document.getElementById("pw_hidden").value = document.getElementById("passwordFile").value;
	document.getElementById("submitbutton").disabled = true;
	return true;
}
</script>
{{ template "pagename" "PublicDownloadPw"}}
{{ template "customjs" .}}
{{template "footer"}}    
{{end}}
