Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion assets/styles/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@ article {
margin-right: auto;
max-width: 65ch;

h1 {
h1, .btn {
text-align: center;
}

a {
text-align: center;
}
}
Expand All @@ -161,4 +165,8 @@ article {

h1 a {
text-decoration: none;
}

.aBlock {
display: block;
}
5 changes: 4 additions & 1 deletion src/Form/SectionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\CallbackTransformer;
use Symfony\Component\Form\Extension\Core\Type\TextType;

class SectionType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('titleJson')
->add('titleJson', TextType::class, [
'label_format' => 'Titre'
])
;

$builder->get('titleJson')
Expand Down
2 changes: 1 addition & 1 deletion templates/section/_form.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ form_start(form) }}
{{ form_start(form, {'attr': {'class': 'centerForm'}}) }}
{{ form_widget(form) }}
<button class="btn">{{ button_label|default('Ajouter') }}</button>
{{ form_end(form) }}
11 changes: 6 additions & 5 deletions templates/section/edit.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
{% block title %}Édition de section{% endblock %}

{% block main %}
<h1>Édition de la section {{section.titleJson.fr}}</h1>
<article>
<h1>Édition de la section {{section.titleJson.fr}}</h1>

{{ include('section/_form.html.twig', {'button_label': 'Modifier'}) }}
{{ include('section/_form.html.twig', {'button_label': 'Valider'}) }}

<a href="{{ path('app_section_index') }}">Retour à la liste</a>

{{ include('section/_delete_form.html.twig') }}
<a class="aBlock" href="{{ path('app_chapter_new')}}">Ajouter chapitre</a>
<a href="{{ path('app_section_show', {'id': section.id}) }}">Retour</a>
</article>
{% endblock %}