submit illustration en masse
This commit is contained in:
@ -416,6 +416,10 @@
|
||||
Ajouter une Illustration
|
||||
</a>
|
||||
|
||||
<a href={{ path("app_illustration_submits01",{"by":"user","userid":app.user.id}) }} class="btn btn-link" style="font-size:30px;" title="Créer une Illustration">
|
||||
Ajouter des Illustrations en masse
|
||||
</a>
|
||||
|
||||
<a href={{ path("app_webzine_submit",{"by":"user","userid":app.user.id}) }} class="btn btn-link" style="font-size:30px;" title="Créer un Webzine">
|
||||
Ajouter un Webzine
|
||||
</a>
|
||||
|
@ -416,6 +416,11 @@
|
||||
Ajouter une Illustration
|
||||
</a>
|
||||
|
||||
|
||||
<a href={{ path("app_illustration_submits01",{"by":"user","userid":app.user.id}) }} class="btn btn-link" style="font-size:30px;" title="Créer une Illustration">
|
||||
Ajouter des Illustrations en masse
|
||||
</a>
|
||||
|
||||
<a href={{ path("app_webzine_submit",{"by":"user","userid":app.user.id}) }} class="btn btn-link" style="font-size:30px;" title="Créer un Webzine">
|
||||
Ajouter un Webzine
|
||||
</a>
|
||||
|
64
templates/Illustration/submits01.html.twig
Executable file
64
templates/Illustration/submits01.html.twig
Executable file
@ -0,0 +1,64 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
{{ form_start(form) }}
|
||||
<h1 class="page-header">
|
||||
Création ILLUSTRATIONS EN MASSE
|
||||
</h1>
|
||||
|
||||
{{ form_widget(form.submit) }}
|
||||
{% if by=="admin" %}
|
||||
<a class="btn btn-secondary" href={{ path('app_admin_illustration',{'by':by,'userid':-1}) }}>Annuler</a>
|
||||
{% elseif by=="update" %}
|
||||
<a class="btn btn-secondary" href={{ path('app_user_update',{id:userid}) }}>Annuler</a>
|
||||
{% elseif by=="profil" %}
|
||||
<a class="btn btn-secondary" href={{ path('app_user_profil') }}>Annuler</a>
|
||||
{% elseif by=="illustration" %}
|
||||
<a class="btn btn-secondary" href={{ path('app_illustration_view',{'by':"user","idcat":illustration.category.id,"id":illustration.id}) }}>Annuler</a>
|
||||
{% else %}
|
||||
<a class="btn btn-secondary" href={{ path('app_home_user',{'userpseudo':app.user.pseudo}) }}>Annuler</a>
|
||||
{% endif %}
|
||||
|
||||
<br><br>
|
||||
|
||||
{% if app.session.flashbag.has('error') %}
|
||||
<div class='alert alert-danger' style='margin: 5px 0px'>
|
||||
<strong>Erreur</strong><br>
|
||||
{% for flashMessage in app.session.flashbag.get('error') %}
|
||||
{{ flashMessage }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if app.session.flashbag.has('notice') %}
|
||||
<div class='alert alert-info' style='margin: 5px 0px'>
|
||||
<strong>Information</strong><br>
|
||||
{% for flashMessage in app.session.flashbag.get('notice') %}
|
||||
{{ flashMessage }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6 m-auto">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<i class="fa fa-pencil-alt fa-fw"></i> Informations
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
{{ form_row(form.category) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ form_end(form) }}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block localjavascript %}
|
||||
$(document).ready(function() {
|
||||
$("#illustration_category").focus();
|
||||
});
|
||||
{% endblock %}
|
73
templates/Illustration/submits02.html.twig
Normal file
73
templates/Illustration/submits02.html.twig
Normal file
@ -0,0 +1,73 @@
|
||||
{% 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 %}
|
||||
|
Reference in New Issue
Block a user