person: Add checkobox for adding address in AddPerson

This commit is contained in:
nobohan 2022-04-19 11:39:08 +02:00
parent 355c5cf8fd
commit 584111b5f7
2 changed files with 20 additions and 2 deletions

View File

@ -138,7 +138,14 @@
aria-describedby="email" />
</div>
<div v-if="action === 'create'" class="form-floating mb-3">
<div class="input-group mb-3 form-check">
<input class="form-check-input"
type='checkbox'
v-model="showAddressForm"
name='showAddressForm'/>
<label class="form-check-label">{{ $t('person.address.show_address_form') }}</label>
</div>
<div v-if="action === 'create' && showAddressFormValue" class="form-floating mb-3">
<add-address
:context="addAddress.context"
:options="addAddress.options"
@ -181,6 +188,7 @@ export default {
altNames: [],
civilities: []
},
showAddressFormValue: false,
addAddress: {
options: {
button: {
@ -241,6 +249,10 @@ export default {
set(value) { this.person.email = value; },
get() { return this.person.email; }
},
showAddressForm: {
set(value) { this.showAddressFormValue = value; },
get() { return this.showAddressFormValue; }
},
genderClass() {
switch (this.person.gender) {
case 'woman':
@ -349,4 +361,9 @@ dl {
margin-left: 1em;
}
}
div.form-check {
label {
margin-left: 1rem;
}
}
</style>

View File

@ -44,7 +44,8 @@ const personMessages = {
placeholder: "Choisissez la civilité",
},
address: {
create_address: "Ajouter une adresse"
create_address: "Ajouter une adresse",
show_address_form: "Créer un ménage et ajouter une adresse"
}
},
error_only_one_person: "Une seule personne peut être sélectionnée !"