74 lines
2.4 KiB
Twig
74 lines
2.4 KiB
Twig
|
{% extends "base.html.twig" %}
|
||
|
|
||
|
{% block encorelinktags %}
|
||
|
{{ encore_entry_link_tags('dropzone') }}
|
||
|
{% endblock encorelinktags %}
|
||
|
|
||
|
{% block body %}
|
||
|
<h1 class="page-header">
|
||
|
Téléchargez vos Illustrations
|
||
|
</h3>
|
||
|
<a class="btn btn-secondary"href="{{path('app_home')}}">Annuler</a>
|
||
|
|
||
|
<div class="row">
|
||
|
<div class="col-md-6 m-auto">
|
||
|
<form
|
||
|
action="{{ oneup_uploader_endpoint('illustration') }}"
|
||
|
class="dropzone"
|
||
|
id="mydropzone"
|
||
|
data-acceptedMimeTypes="image/*"
|
||
|
data-resizeWidth:2500,
|
||
|
style="margin-top:10px">
|
||
|
</form>
|
||
|
</div>
|
||
|
</div>
|
||
|
{% 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"]);
|
||
|
|
||
|
console.log('here');
|
||
|
console.log(response["file"]);
|
||
|
|
||
|
$.ajax({
|
||
|
method: "POST",
|
||
|
url: "{{ path('app_illustration_submits03',{"by":by,"userid":userid,"categoryid":categoryid}) }}",
|
||
|
data: {
|
||
|
illustration:response["file"],
|
||
|
width:response["width"],
|
||
|
height:response["height"],
|
||
|
name:response["originalname"]
|
||
|
}
|
||
|
});
|
||
|
|
||
|
}
|
||
|
function dropzonequeuecomplete(file) {
|
||
|
{% if by=="admin" %}
|
||
|
url='{{ path('app_admin_illustration',{'by':by,'userid':-1}) }}';
|
||
|
{% elseif by=="update" %}
|
||
|
url='{{ path('app_user_update',{id:userid}) }}';
|
||
|
{% elseif by=="profil" %}
|
||
|
url='{{ path('app_user_profil') }}';
|
||
|
{% elseif by=="illustration" %}
|
||
|
url='{{ path('app_illustration_view',{'by':"user","idcat":illustration.category.id,"id":illustration.id}) }}';
|
||
|
{% else %}
|
||
|
url='{{ path('app_home_user',{'userpseudo':app.user.slug}) }}';
|
||
|
{% endif %}
|
||
|
|
||
|
window.location.href=url;
|
||
|
}
|
||
|
{% endblock %}
|
||
|
|