S3 Upload working
This commit is contained in:
@@ -39,14 +39,15 @@
|
||||
</div>
|
||||
</nav>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
|
||||
{% block content %}
|
||||
<h1>No content!</h1>
|
||||
{% endblock %}
|
||||
|
||||
<!-- Optional JavaScript -->
|
||||
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
|
||||
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
|
||||
</body>
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
{% extends "interface/project.html" %}
|
||||
|
||||
{% block page %}
|
||||
<p>
|
||||
Some instructions about how to submit the file
|
||||
{{ url }}
|
||||
</p>
|
||||
<div class="card">
|
||||
<div class="card-header">Make a submission</div>
|
||||
<div class="card-body">
|
||||
<p>
|
||||
Some instructions about how to submit the file
|
||||
{{ url }}
|
||||
</p>
|
||||
|
||||
<div class="col-md-6 offset-md-3">
|
||||
{% include "interface/bootstrap-form.html" %}
|
||||
<div class="">
|
||||
{% include "interface/bootstrap-form.html" %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -1,19 +1,47 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
|
||||
<div class="container">
|
||||
<div class="col-md-4 offset-md-4">
|
||||
<form method="POST" action="{{ upload.url }}" enctype="multipart/form-data">
|
||||
{% for field, value in upload.fields.items %}
|
||||
<input type="hidden" name="{{ field }}" value="{{ value }}" />
|
||||
{% endfor %}
|
||||
File:
|
||||
<input name="file" type="file" accept="video/*"/>
|
||||
<div class="text-right">
|
||||
<a class="btn btn-secondary" href="{% url 'cancel_submission' project_id=project.pk submission_id=submission.pk %}">Cancel</a>
|
||||
<button class="btn btn-primary">Upload</button>
|
||||
<div class="card" id="legacy-upload">
|
||||
<div class="card-header">Ready to upload file</div>
|
||||
<div class="card-body">
|
||||
<form method="POST" action="{{ upload.url }}" enctype="multipart/form-data" id="video-upload">
|
||||
{% for field, value in upload.fields.items %}
|
||||
<input type="hidden" name="{{ field }}" value="{{ value }}" />
|
||||
{% endfor %}
|
||||
|
||||
<input name="file" type="file" accept="video/*"/>
|
||||
|
||||
<div class="form-actions text-right">
|
||||
<a class="btn btn-secondary" href="{% url 'cancel_submission' project_id=project.pk submission_id=submission.pk %}">Cancel</a>
|
||||
<button class="btn btn-primary">Upload</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="{% static 'dropzone/dropzone.js' %}"></script>
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
//document.getElementById('fallback-file').remove();
|
||||
|
||||
Dropzone.options.videoUpload = {
|
||||
paramName: "file", // The name that will be used to transfer the file
|
||||
maxFilesize: 500, // MB
|
||||
accept: function(file, done) {
|
||||
if (file.name == "justinbieber.jpg") {
|
||||
done("Naha, you don't.");
|
||||
} else { done(); }
|
||||
}
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user