ninegitea/src/ninegitea-1.0/templates/Config/logo.html.twig

43 lines
1.3 KiB
Twig
Raw Normal View History

2021-07-20 13:04:47 +02:00
{% extends "base.html.twig" %}
{% block encorelinktags %}
{{ encore_entry_link_tags('dropzone') }}
{% endblock encorelinktags %}
{% block body %}
<h3 class="page-header">Téléchargez votre Logo</h3>
<a class="btn btn-default" onClick="closeModal();">Annuler</a>
<form action="{{ oneup_uploader_endpoint('logo') }}" class="dropzone" id="MyDropZone" style="margin-top:10px">
</form>
{% endblock %}
{% block encorescripttags %}
{{ encore_entry_script_tags('dropzone') }}
{% endblock %}
{% block localjavascript %}
Dropzone.options.MyDropZone = {
acceptedMimeTypes: 'image/*',
maxFiles: 1,
resizeWidth:500,
success: function( file, response ){
parent.$("#config_value").val(response["file"]);
parent.$("#config_value_img").attr("src","/{{ appAlias }}/uploads/logo/"+response["file"]);
closeModal();
}
}
function closeModal() {
window.parent.$("#mymodallarge").modal('hide');
}
$(window).load(function () {
// On vérifie que l'execution se fait bien dans le cadre d'une modal
if(!window.parent.$("#mymodallarge #framemodal").length) {
$(location).attr('href',"{{ path('app_home') }}");
}
});
{% endblock %}