create new person: add an action and put action buttons in a dropdown

This commit is contained in:
Mathieu Jaumotte 2021-08-27 09:30:15 +02:00
parent 34df295801
commit 52a0c0e95b
3 changed files with 26 additions and 7 deletions

View File

@ -244,7 +244,9 @@ final class PersonController extends AbstractController
'label' => 'Add the person'
])->add('createPeriod', SubmitType::class, [
'label' => 'Add the person and create an accompanying period'
]);
])->add('createHousehold', SubmitType::class, [
'label' => 'Add the person and create an household'
]); // TODO createHousehold form action
$form->handleRequest($request);

View File

@ -76,12 +76,28 @@
{{ form_row(form.gender, { 'label' : 'Gender'|trans }) }}
<div style="display: none">
{# TODO remove this field (vendee) #}
{{ form_row(form.center, { 'label' : 'Center'|trans }) }}
</div>
<ul class="record_actions sticky-form-buttons">
<li>
{{ form_widget(form.editPerson, { 'attr': { 'class': 'btn btn-create' }}) }}
</li>
<li>
{{ form_widget(form.createPeriod, { 'attr': { 'class': 'btn btn-create' }}) }}
<li class="dropdown">
<a class="btn btn-create dropdown-toggle"
href="#" role="button" id="newPersonMore" data-bs-toggle="dropdown" aria-expanded="false">
{{ 'Add the person'|trans }}
</a>
<ul class="dropdown-menu" aria-labelledby="newPersonMore">
<li>
{{ form_widget(form.editPerson, { 'attr': { 'class': 'dropdown-item' }}) }}
</li>
<li>
{{ form_widget(form.createPeriod, { 'attr': { 'class': 'dropdown-item' }}) }}
</li>
<li>
{{ form_widget(form.createHousehold, { 'attr': { 'class': 'dropdown-item' }}) }}
</li>
</ul>
</li>
</ul>

View File

@ -119,7 +119,8 @@ address_country_code: Code pays
'Alreay existing person': 'Dossiers déjà encodés'
'Add the person': 'Ajouter la personne'
'Add the person and create an accompanying period': "Ajouter la personne et créer une période d'accompagnement"
'Add the person and create an accompanying period': "Créer la personne ET créer une période d'accompagnement"
'Add the person and create an household': "Créer la personne ET créer un ménage"
Show person: Voir le dossier de la personne
'Confirm the creation': 'Confirmer la création'
'You will create this person': 'Vous allez créer le dossier suivant'