2017-09-23 19:46:58 +02:00
|
|
|
{{define "body"}}
|
|
|
|
<h1>MegaUploader - {{.Share.Name}}</h1>
|
|
|
|
|
|
|
|
<div>Carica un file su {{.Share.Name}}
|
|
|
|
{{if .ViewURL}}(<a href="{{.ViewURL}}">Guarda cosa c'è già</a>){{end}}
|
|
|
|
</div>
|
2017-09-23 20:02:18 +02:00
|
|
|
<div class="share-description">
|
|
|
|
{{.Share.Description}}
|
|
|
|
</div>
|
2017-09-23 19:46:58 +02:00
|
|
|
<div>Ricorda:
|
|
|
|
<ul>
|
|
|
|
<li>{{if ne .Share.SizeLimit 0}}
|
|
|
|
Max {{.Share.SizeLimit.HR}}
|
|
|
|
{{end}}
|
|
|
|
</li>
|
|
|
|
{{if ne (len .Share.Extensions) 0}}
|
|
|
|
<li>Solo file di tipo
|
|
|
|
{{range .Share.Extensions}}
|
|
|
|
<tt>{{.}}</tt>,
|
|
|
|
{{end}}
|
|
|
|
</li>
|
|
|
|
{{end}}
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<pre id="responses"></pre>
|
2017-12-08 19:28:47 +01:00
|
|
|
<form id="uploadForm" class="dropzone" method="POST" action="{{.Prefix}}/api/upload/{{.Share.Name}}">
|
2017-09-23 19:46:58 +02:00
|
|
|
<noscript>
|
|
|
|
<input type="file" name="file" />
|
|
|
|
</noscript>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<!-- TODO: area per trascinare file -->
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{define "scripts"}}
|
2017-12-08 19:28:47 +01:00
|
|
|
<script type="text/javascript" src="{{.Prefix}}/static/dropzone/dropzone.min.js"></script>
|
2017-09-23 19:46:58 +02:00
|
|
|
<script type="text/javascript">
|
|
|
|
Dropzone.options.uploadForm = {
|
|
|
|
init: function() {
|
|
|
|
this.on("success", function(file, response) {
|
|
|
|
document.getElementById("responses").textContent += response + "\n";
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
{{end}}
|
|
|
|
{{define "styles"}}
|
2017-12-08 19:28:47 +01:00
|
|
|
<link href="{{.Prefix}}/static/dropzone/dropzone.min.css" rel="stylesheet" />
|
2017-09-23 20:02:18 +02:00
|
|
|
<style>
|
|
|
|
.share-description { font-style: italic; }
|
|
|
|
</style>
|
2017-09-23 19:46:58 +02:00
|
|
|
{{end}}
|