{% extends 'base.html.twig' %} {% block localstyle %} .webzinepages { text-align:center } .webzinepages div { padding:5px ; margin:5px;} .webzinepages img { width: 100px; } {% endblock %} {% block body %} {{ form_start(form) }}

{% if mode=="update" %} Modification WEBZINE {% elseif mode=="submit" %} Création WEBZINE {% endif %}

{{ form_widget(form.submit) }} {% if by=="admin" %} Annuler {% elseif by=="update" %} Annuler {% elseif by=="profil" %} Annuler {% elseif by=="illustration" %} Annuler {% else %} Annuler {% endif %} {% if mode=="update" %} Supprimer {% endif %}

{% if app.session.flashbag.has('error') %}
Erreur
{% for flashMessage in app.session.flashbag.get('error') %} {{ flashMessage }}
{% endfor %}
{% endif %} {% if app.session.flashbag.has('notice') %}
Information
{% for flashMessage in app.session.flashbag.get('notice') %} {{ flashMessage }}
{% endfor %}
{% endif %}
Informations
{{ form_row(form.user) }} {{ form_row(form.name) }} {{ form_row(form.set) }} {{ form_row(form.order) }} {{ form_row(form.mode) }} {{ form_row(form.description) }}
Planches
Télécharger les Planches du Webzine
{% for page in webzine.webzinepages %}

{% endfor %}
{{ form_end(form) }} {% endblock %} {% block localjavascript %} $(document).ready(function() { $("#webzine_name").focus(); var linkpages=""; {% for page in webzine.webzinepages %} if(linkpages=="") linkpages+="{{ page.illustration }}"; else linkpages+=",{{ page.illustration }}"; {% endfor %} $("#webzine_linkpages").val(linkpages); $(".webzinepages").sortable({ tolerance: 'pointer', revert: '100', opacity: 0.6, forceHelperSize: true, delay: 50, itemSelector: 'img', axis: "y", cursor: "move", update: function( event, ui ) { var order = []; $('.webzinepages img').each( function(e) { order.push($(this).attr('id')); }); var positions = order.join(','); $("#webzine_linkpages").val(positions); }, }); }); function removeLinkPage(id) { // On supprime la ligne $("#div_"+id.replace(".","")).remove(); console.log($("#div_"+id.replace(".","")).attr("id")); // On supprime l'id de la liste $("#webzine_linkpages").val($("#webzine_linkpages").val().replace(id+",","")); $("#webzine_linkpages").val($("#webzine_linkpages").val().replace(","+id,"")); $("#webzine_linkpages").val($("#webzine_linkpages").val().replace(id,"")); } {% endblock %}