nineskeletor/templates/Config/image.html.twig

36 lines
909 B
Twig
Raw Permalink Normal View History

2023-02-16 17:03:53 +01:00
{% extends "base.html.twig" %}
2023-01-10 11:13:28 +01:00
{% block encoretags %}
{{ encore_entry_link_tags('dropzone') }}
{% endblock %}
{% block body %}
<a class="btn btn-secondary" onClick="closeModal();">Annuler</a>
<form
2023-02-16 17:03:53 +01:00
action="{{ oneup_uploader_endpoint('image') }}"
2023-01-10 11:13:28 +01:00
class="dropzone"
id="mydropzone"
data-acceptedMimeTypes="image/*"
data-maxFiles=1
style="margin-top:10px">
</form>
{% endblock %}
{% block localscript %}
{{ encore_entry_script_tags('dropzone') }}
<script>
function dropzonesuccess( file, response ) {
2023-02-16 17:03:53 +01:00
parent.$("#config_value").val("image/"+response["file"]);
parent.$("#config_value_img").attr("src","{{ path("app_minio_image",{file:"image/"}) }}"+response["file"]);
2023-01-10 11:13:28 +01:00
closeModal();
}
function closeModal() {
window.parent.$("#mymodallarge").modal('hide');
}
</script>
{% endblock %}