2022-07-21 16:15:47 +02:00
|
|
|
{% 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");
|
|
|
|
|
2023-02-16 17:03:53 +01:00
|
|
|
{% if idparent is defined %}
|
|
|
|
function dropzoneinit( elmt ) {
|
|
|
|
elmt.on("sending", function(file, xhr, formData) {
|
|
|
|
formData.append("folder", "{{ idparent }}");
|
|
|
|
});
|
|
|
|
}
|
|
|
|
{% endif %}
|
|
|
|
|
2022-07-21 16:15:47 +02:00
|
|
|
function dropzonesuccess( file, response ) {
|
2023-02-16 17:03:53 +01:00
|
|
|
{% if reportinput is defined %}
|
2022-10-02 14:50:48 +02:00
|
|
|
$(location).attr('href',"{{ path('app_all_crop02', {"type": type, "reportinput": reportinput }) }}?file="+response["file"]);
|
2023-02-16 17:03:53 +01:00
|
|
|
{% else %}
|
|
|
|
$(location).attr('href',"{{ path('app_cropentity02', {"type": type, "idparent": idparent }) }}?file={{idparent}}/"+response["file"]);
|
|
|
|
{% endif %}
|
2022-07-21 16:15:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function closeModal() {
|
|
|
|
window.parent.$("#mymodallarge").modal('hide');
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
{% endblock %}
|