|
@@ -4,12 +4,17 @@
|
|
<div data-controller="slugger" >
|
|
<div data-controller="slugger" >
|
|
{{ form_start(form) }}
|
|
{{ form_start(form) }}
|
|
{{ form_row(form.title) }}
|
|
{{ form_row(form.title) }}
|
|
-
|
|
|
|
- <div id="formulaire-slug">
|
|
|
|
|
|
+
|
|
|
|
+ {% set cacherFormulaire = article.slug and not article.slug is same as '' and form.children.slug.vars.errors|length == 0 %}
|
|
|
|
+ <div data-slugger-target="ligneSlug" class="ligne-slug {{ cacherFormulaire ? '' : 'hidden' }}">
|
|
|
|
+ <div><span>Permalien</span> {{ article.slug }}</div>
|
|
|
|
+ <button type="button" class="bouton-slug" data-slugger-target="bouton-show" data-action="click->slugger#show">Modifier</button>
|
|
|
|
+ </div>
|
|
|
|
+ <div id="formulaire-slug" data-slugger-target="formulaire" class="{{ cacherFormulaire ? 'hidden' : ''}}">
|
|
{{ form_label(form.slug) }}
|
|
{{ form_label(form.slug) }}
|
|
{{ form_errors(form.slug) }}
|
|
{{ form_errors(form.slug) }}
|
|
{{ form_widget(form.slug) }}
|
|
{{ form_widget(form.slug) }}
|
|
- <div class="div-bouton-slug"><button type="button" id="bouton-slug" data-slugger-target="bouton" data-action="click->slugger#open">Générer un slug</butt></div>
|
|
|
|
|
|
+ <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>
|
|
{{ form_help(form.slug) }}
|
|
{{ form_help(form.slug) }}
|
|
</div>
|
|
</div>
|
|
|
|
|