47 lines
1.3 KiB
Twig
Executable File
47 lines
1.3 KiB
Twig
Executable File
{% extends 'base.html.twig' %}
|
|
|
|
{% block encoretags %}
|
|
{{ encore_entry_link_tags('dropzone') }}
|
|
{% endblock %}
|
|
|
|
{% block body %}
|
|
<a class="btn btn-secondary" onClick="closeModal();">Annuler</a>
|
|
<form
|
|
action="{{ oneup_uploader_endpoint(type) }}"
|
|
class="dropzone"
|
|
id="mydropzone"
|
|
data-acceptedMimeTypes="image/*"
|
|
data-maxFiles=1
|
|
|
|
style="margin-top:10px">
|
|
</form>
|
|
{% endblock %}
|
|
|
|
{% block localscript %}
|
|
{{ encore_entry_script_tags('dropzone') }}
|
|
|
|
<script>
|
|
window.parent.$(".modal-title").html("ETAPE 1 - Téléchargez votre image");
|
|
|
|
{% if idparent is defined %}
|
|
function dropzoneinit( elmt ) {
|
|
elmt.on("sending", function(file, xhr, formData) {
|
|
formData.append("folder", "{{ idparent }}");
|
|
});
|
|
}
|
|
{% endif %}
|
|
|
|
function dropzonesuccess( file, response ) {
|
|
{% if reportinput is defined %}
|
|
$(location).attr('href',"{{ path('app_all_crop02', {"type": type, "reportinput": reportinput }) }}?file="+response["file"]);
|
|
{% else %}
|
|
$(location).attr('href',"{{ path('app_cropentity02', {"type": type, "idparent": idparent }) }}?file={{idparent}}/"+response["file"]);
|
|
{% endif %}
|
|
}
|
|
|
|
function closeModal() {
|
|
window.parent.$("#mymodallarge").modal('hide');
|
|
}
|
|
</script>
|
|
{% endblock %}
|