_form.html.twig 1.5 KB

12345678910111213141516171819202122232425262728
  1. <p>
  2. Etat de l'article : <span class="badge badge-{{ article.state }}">{{ article.state | trans }}</span>
  3. </p>
  4. <div data-controller="slugger" >
  5. {{ form_start(form) }}
  6. {{ form_row(form.title) }}
  7. {% set cacherFormulaire = article.slug and not article.slug is same as '' and form.children.slug.vars.errors|length == 0 %}
  8. <div data-slugger-target="ligneSlug" class="ligne-slug {{ cacherFormulaire ? '' : 'hidden' }}">
  9. <div><span>Permalien</span> {% if article.slug %}{{ url('app_view', {slug: article.slug}) }}{% endif %}</div>
  10. <button type="button" class="bouton-slug" data-slugger-target="bouton-show" data-action="click->slugger#show">Modifier</button>
  11. </div>
  12. <div id="formulaire-slug" data-slugger-target="formulaire" class="{{ cacherFormulaire ? 'hidden' : ''}}">
  13. {{ form_label(form.slug) }}
  14. {{ form_errors(form.slug) }}
  15. {{ form_widget(form.slug) }}
  16. <div class="div-bouton-slug"><button type="button" class="bouton-slug" data-slugger-target="bouton" data-action="click->slugger#open">Générer un slug</butt></div>
  17. {{ form_help(form.slug) }}
  18. </div>
  19. {{ form_row(form.tags ) }}
  20. {{ form_row(form.content) }}
  21. {{ form_row(form.publicationDate) }}
  22. {{ form_row(form.author) }}
  23. {{ form_row(form.publicationChoice) }}
  24. {{ form_rest(form)}}
  25. <button class="btn btn-green">{{ button_label|default('Sauvegarder') }}</button>
  26. {{ form_end(form) }}
  27. </div>