ninefolio/templates/Illustration/upload.html.twig

45 lines
1.3 KiB
Twig

{% extends "base.html.twig" %}
{% block encorelinktags %}
{{ encore_entry_link_tags('dropzone') }}
{% endblock encorelinktags %}
{% block body %}
<h3 class="page-header">Téléchargez votre Illustration</h3>
<a class="btn btn-default" onClick="closeModal();">Annuler</a>
<form
action="{{ oneup_uploader_endpoint('illustration') }}"
class="dropzone"
id="mydropzone"
data-acceptedMimeTypes="image/*"
data-maxFiles=1
data-resizeWidth:2500,
style="margin-top:10px">
</form>
{% endblock %}
{% block encorescripttags %}
{{ encore_entry_script_tags('dropzone') }}
{% endblock %}
{% block localjavascript %}
function dropzoneinit( elt ) {
}
function dropzonesuccess( file, response ) {
parent.$("#illustration_illustration").val(response["file"]);
parent.$("#illustration_width").val(response["width"]);
parent.$("#illustration_height").val(response["height"]);
parent.$("#illustration_name").val(response["originalname"]);
parent.$("#illustration_illustration_img").attr("src","/{{ appAlias }}/uploads/illustration/"+response["file"]);
}
function dropzonequeuecomplete(file) {
closeModal();
}
function closeModal() {
window.parent.$("#extraLargeModal").modal('hide');
}
{% endblock %}