Merge branch 'address_refactoring' into add-location-period

This commit is contained in:
Mathieu Jaumotte 2021-08-06 21:50:04 +02:00
commit 6d58bf152b
11 changed files with 306 additions and 129 deletions

View File

@ -94,8 +94,8 @@ section.chill-entity {
} }
span.address-valid { span.address-valid {
&.address-since {} &.date-since {}
&.address-until {} &.date-until {}
} }
} }

View File

@ -1,10 +1,28 @@
<template> <template>
<div v-for="error in displayErrors" class="alert alert-danger my-2">
{{ error }}
</div>
<div v-if="addAddress.options.displayResult && addAddress.result !== null"
class="chill-entity entity-address">
<div class="address multiline">
<p class="street">{{ addAddress.result.street }}
<span class="streetnumber">{{ addAddress.result.streetNumber }}</span>
</p>
<p class="postcode">
<span class="code">{{ addAddress.result.postcode.code }}</span>
<span class="name">{{ addAddress.result.postcode.name }}</span>
</p>
<p class="country">{{ addAddress.result.country.name.fr }}</p>
</div>
</div>
<add-address <add-address
v-bind:key="addAddress.type"
v-bind:context="context" v-bind:context="context"
v-bind:key="addAddress.key"
v-bind:options="addAddress.options" v-bind:options="addAddress.options"
@submitAddress="submitAddress" v-bind:result="addAddress.result"
ref="addAddress"> ref="addAddress">
</add-address> </add-address>
</template> </template>
@ -23,35 +41,45 @@ export default {
edit: window.mode === 'edit', edit: window.mode === 'edit',
personId: window.personId, personId: window.personId,
addressId: window.addressId, addressId: window.addressId,
backUrl: `/fr/person/${window.personId}/address/list`, //TODO better way to pass this backUrl: window.backUrl,
validFrom: new Date().toISOString().split('T')[0]
}, },
addAddress: { addAddress: {
key: 'person',
options: { options: {
/// Options override default
/// First button text if create or edit address (trans chain, see i18n)
//textButton: { create: 'bim', edit: 'bam' },
/// Options override default.
/// null value take default component value
button: {
text: {
/// if create or edit address
create: window.buttonText || null,
edit: window.buttonText || null
},
type: window.button.type || null,
size: window.button.size || null,
display: window.button.display
},
/// Modal title text if create or edit address (trans chain, see i18n) /// Modal title text if create or edit address (trans chain, see i18n)
//title: { create: 'boum', edit: 'pan' }, title: {
create: window.modalTitle || null,
edit: window.modalTitle || null
},
/// Display each step in page or Modal /// Display each step in page or Modal
//bindModal: { step1: false, step2: false } //TODO true-false must not be possible bindModal: {
} step1: window.binModalStep1,
step2: window.binModalStep2
},
// Options only for root parent component
displayResult: true,
redirectToBackUrl: true
},
type: 'person',
result: null // <== returned from addAddress component
} }
} }
}, },
methods: { methods: {
submitAddress({ submited, flag }) { displayErrors() {
console.log('@@@ CLICK button submitAddress'); return this.$refs.addAddress.errorMsg;
console.log('address to post:', submited);
console.log('datas by refs: ', this.$refs.addAddress.entity.address.text);
this.$refs.addAddress.initForm(); // to cast child method
flag.showPane = false;
} }
} }
} }

View File

@ -2,17 +2,19 @@
<button v-if="step1WithModal" <button v-if="step1WithModal"
@click="openShowPane" @click="openShowPane"
class="btn btn-create mt-4" type="button" name="button"> class="btn" :class="getClassButton"
{{ $t(getTextButton) }} type="button" name="button" :title="$t(getTextButton)">
<span v-if="displayTextButton">{{ $t(getTextButton) }}</span>
</button> </button>
<!-- step 1 -->
<teleport to="body" v-if="step1WithModal"> <teleport to="body" v-if="step1WithModal">
<modal v-if="flag.showPane" <modal v-if="flag.showPane"
modalDialogClass="modal-dialog-scrollable modal-xl" modalDialogClass="modal-dialog-scrollable modal-xl"
@close="flag.showPane = false"> @close="flag.showPane = false">
<template v-slot:header> <template v-slot:header>
<h2 class="modal-title">{{ $t(getTextTitle) }} <h2 class="modal-title">{{ getTextTitle }}
<span v-if="flag.loading" class="loading"> <span v-if="flag.loading" class="loading">
<i class="fa fa-circle-o-notch fa-spin fa-fw"></i> <i class="fa fa-circle-o-notch fa-spin fa-fw"></i>
<span class="sr-only">Loading...</span> <span class="sr-only">Loading...</span>
@ -26,7 +28,8 @@
v-bind:options="this.options" v-bind:options="this.options"
v-bind:default="this.default" v-bind:default="this.default"
v-bind:entity="this.entity" v-bind:entity="this.entity"
v-bind:flag="this.flag"> v-bind:flag="this.flag"
ref="showAddress">
</show-address> </show-address>
</template> </template>
@ -36,7 +39,7 @@
{{ $t('action.edit')}} {{ $t('action.edit')}}
</button> </button>
<button class="btn btn-save" <button class="btn btn-save"
@click.prevent="$emit('submitAddress', { getSubmited , flag })"> @click="submitAddress">
{{ $t('action.save')}} {{ $t('action.save')}}
</button> </button>
</template> </template>
@ -51,18 +54,20 @@
v-bind:default="this.default" v-bind:default="this.default"
v-bind:entity="this.entity" v-bind:entity="this.entity"
v-bind:flag="this.flag" v-bind:flag="this.flag"
ref="showAddress"
v-bind:insideModal="false" @openEditPane="openEditPane" v-bind:insideModal="false" @openEditPane="openEditPane"
@submitAddress="$emit('submitAddress', { getSubmited , flag })"> @submitAddress="submitAddress">
</show-address> </show-address>
</div> </div>
<!-- step 2 -->
<teleport to="body" v-if="step2WithModal"> <teleport to="body" v-if="step2WithModal">
<modal v-if="flag.editPane" <modal v-if="flag.editPane"
modalDialogClass="modal-dialog-scrollable modal-xl" modalDialogClass="modal-dialog-scrollable modal-xl"
@close="flag.editPane = false"> @close="flag.editPane = false">
<template v-slot:header> <template v-slot:header>
<h2 class="modal-title">{{ $t(getTextTitle) }} <h2 class="modal-title">{{ getTextTitle }}
<span v-if="flag.loading" class="loading"> <span v-if="flag.loading" class="loading">
<i class="fa fa-circle-o-notch fa-spin fa-fw"></i> <i class="fa fa-circle-o-notch fa-spin fa-fw"></i>
<span class="sr-only">Loading...</span> <span class="sr-only">Loading...</span>
@ -122,8 +127,7 @@ import {
export default { export default {
name: "AddAddress", name: "AddAddress",
props: ['context', 'options'], props: ['context', 'options', 'result'],
emits: ['submitAddress'],
components: { components: {
Modal, Modal,
ShowAddress, ShowAddress,
@ -138,7 +142,11 @@ export default {
success: false success: false
}, },
default: { default: {
textButton: { create: 'add_an_address_title', edit: 'edit_address' }, button: {
text: { create: 'add_an_address_title', edit: 'edit_address' },
type: 'btn-create',
display: true
},
title: { create: 'add_an_address_title', edit: 'edit_address' }, title: { create: 'add_an_address_title', edit: 'edit_address' },
bindModal: { bindModal: {
step1: true, step1: true,
@ -173,34 +181,48 @@ export default {
zoom: 12 zoom: 12
}, },
}, },
valid: {
from: null,
to: null
},
errorMsg: [] errorMsg: []
} }
}, },
computed: { computed: {
// TODO improve: props options must override data default
step1WithModal() { step1WithModal() {
return (this.options.bindModal) ? this.options.bindModal.step1 : this.default.bindModal.step1; return (this.options.bindModal !== null && typeof this.options.bindModal.step1 !== 'undefined') ?
this.options.bindModal.step1 : this.default.bindModal.step1;
}, },
step2WithModal() { step2WithModal() {
return (this.options.bindModal) ? this.options.bindModal.step2 : this.default.bindModal.step2; let step2 = (this.options.bindModal !== null && typeof this.options.bindModal.step2 !== 'undefined') ?
}, this.options.bindModal.step2 : this.default.bindModal.step2;
getTextButton() { if (step2 === false && this.step1WithModal === true) {
if (this.options.textButton) { console.log("step2 must open in a Modal");
return (this.context.edit) ? this.options.textButton.edit : this.options.textButton.create; return true;
} }
return (this.context.edit) ? this.default.textButton.edit : this.default.textButton.create; return step2;
}, },
getTextTitle() { getTextTitle() {
if (this.options.title) { if (this.options.title && (this.options.title.edit !== null || this.options.title.create !== null)) {
return (this.context.edit) ? this.options.title.edit : this.options.title.create; return (this.context.edit) ? this.options.title.edit : this.options.title.create;
} }
return (this.context.edit) ? this.default.title.edit : this.default.title.create; return (this.context.edit) ? this.$t(this.default.title.edit) : this.$t(this.default.title.create);
}, },
getTextButton() {
getSubmited() { if (this.options.button && this.options.button.text && (this.options.button.text.edit !== null || this.options.button.text.create !== null)) {
return this.entity.address; return (this.context.edit) ? this.options.button.text.edit : this.options.button.text.create;
}
return (this.context.edit) ? this.default.button.text.edit : this.default.button.text.create;
},
getClassButton() {
let size = (this.options.button && this.options.button.size !== null) ? this.options.button.size : '';
let type = (this.options.button && this.options.button.type !== null) ? this.options.button.type : this.default.button.type;
return size ? size + ' ' + type : type;
},
displayTextButton() {
return (this.options.button !== null && typeof this.options.button.display !== 'undefined') ?
this.options.button.display : this.default.button.display;
} }
}, },
mounted() { mounted() {
@ -219,13 +241,24 @@ export default {
if (this.context.addressId) { if (this.context.addressId) {
this.getInitialAddress(this.context.addressId); this.getInitialAddress(this.context.addressId);
} }
this.flag.showPane = true; // when create new address, start first with editPane
if ( this.context.edit === false
&& this.flag.editPane === false
) {
this.openEditPane();
this.flag.editPane = true;
} else {
this.flag.showPane = true;
}
}, },
openEditPane() { openEditPane() {
console.log('open the Edit panel'); console.log('open the Edit panel');
this.initForm(); this.initForm();
this.getCountries(); this.getCountries();
}, },
closeEditPane() { closeEditPane() {
console.log('close the Edit Panel (with validation)'); console.log('close the Edit Panel (with validation)');
this.applyChanges(); this.applyChanges();
@ -373,7 +406,6 @@ export default {
* then update existing address with backend datas when promise is resolved * then update existing address with backend datas when promise is resolved
*/ */
updateAddress(payload) { updateAddress(payload) {
console.log('updateAddress payload', payload);
// TODO change the condition because it writes new postal code in edit mode now: !writeNewPostalCode // TODO change the condition because it writes new postal code in edit mode now: !writeNewPostalCode
this.flag.loading = true; this.flag.loading = true;
@ -387,7 +419,6 @@ export default {
body.postcode = {'id': postalCode.id }, body.postcode = {'id': postalCode.id },
patchAddress(payload.addressId, body) patchAddress(payload.addressId, body)
.then(address => new Promise((resolve, reject) => { .then(address => new Promise((resolve, reject) => {
console.log('update address');
this.entity.address = address; this.entity.address = address;
this.flag.loading = false; this.flag.loading = false;
resolve(); resolve();
@ -401,7 +432,6 @@ export default {
} else { } else {
patchAddress(payload.addressId, payload.newAddress) patchAddress(payload.addressId, payload.newAddress)
.then(address => new Promise((resolve, reject) => { .then(address => new Promise((resolve, reject) => {
console.log('update address');
this.entity.address = address; this.entity.address = address;
this.flag.loading = false; this.flag.loading = false;
resolve(); resolve();
@ -418,7 +448,6 @@ export default {
* creating new address, and receive backend datas when promise is resolved * creating new address, and receive backend datas when promise is resolved
*/ */
addAddress(payload) { addAddress(payload) {
console.log('addAddress payload', payload);
this.flag.loading = true; this.flag.loading = true;
if('newPostcode' in payload){ if('newPostcode' in payload){
@ -431,7 +460,6 @@ export default {
body.postcode = {'id': postalCode.id}, body.postcode = {'id': postalCode.id},
postAddress(body) postAddress(body)
.then(address => new Promise((resolve, reject) => { .then(address => new Promise((resolve, reject) => {
console.log('add address');
this.entity.address = address; this.entity.address = address;
resolve(); resolve();
this.flag.loading = false; this.flag.loading = false;
@ -445,7 +473,6 @@ export default {
} else { } else {
postAddress(payload) postAddress(payload)
.then(address => new Promise((resolve, reject) => { .then(address => new Promise((resolve, reject) => {
console.log('add address');
this.entity.address = address; this.entity.address = address;
resolve(); resolve();
this.flag.loading = false; this.flag.loading = false;
@ -455,9 +482,55 @@ export default {
this.flag.loading = false; this.flag.loading = false;
}); });
} }
},
/*
* When submited
*/
submitAddress() {
console.log('@@@ CLICK button submitAddress');
this.addDateToAddressAndAddressToPerson({
personId: this.context.personId,
addressId: this.entity.address.address_id,
body: { validFrom: { datetime: `${this.$refs.showAddress.validFrom}T00:00:00+0100`}},
backUrl: this.context.backUrl
});
this.initForm();
this.flag.showPane = false;
},
addDateToAddressAndAddressToPerson(payload) {
console.log('addDateToAddressAndAddressToPerson payload', payload);
this.flag.loading = true;
patchAddress(payload.addressId, payload.body)
.then(address => new Promise((resolve, reject) => {
this.valid.from = address.validFrom;
resolve();
}).then(
postAddressToPerson(payload.personId, payload.addressId)
.then(person => new Promise((resolve, reject) => {
console.log('commit addAddressToPerson !!!', person);
this.$props.result = person;
this.flag.loading = false;
this.flag.success = true;
if (this.options.redirectToBackUrl) {
window.location.assign(payload.backUrl);
}
resolve();
}))
.catch((error) => {
this.errorMsg.push(error);
this.flag.loading = false;
})
))
.catch((error) => {
this.errorMsg.push(error);
this.flag.loading = false;
});
} }
} }
} }
</script> </script>

View File

@ -20,41 +20,63 @@
{{ address.country.name.fr }} {{ address.country.name.fr }}
</p> </p>
</div> </div>
<div>
<div v-if="address.floor">
<span class="floor">
<b>{{ $t('floor') }}</b>: {{ address.floor }}
</span>
</div>
<div v-if="address.corridor">
<span class="corridor">
<b>{{ $t('corridor') }}</b>: {{ address.corridor }}
</span>
</div>
<div v-if="address.steps">
<span class="steps">
<b>{{ $t('steps') }}</b>: {{ address.steps }}
</span>
</div>
<div v-if="address.flat">
<span class="flat">
<b>{{ $t('flat') }}</b>: {{ address.flat }}
</span>
</div>
<div v-if="address.buildingName">
<span class="buildingName">
<b>{{ $t('buildingName') }}</b>: {{ address.buildingName }}
</span>
</div>
<div v-if="address.extra">
<span class="extra">
<b>{{ $t('extra') }}</b>: {{ address.extra }}
</span>
</div>
<div v-if="address.distribution">
<span class="distribution">
<b>{{ $t('distribution') }}</b>: {{ address.distribution }}
</span>
</div>
</div>
<div v-if="address.floor"> <div v-if="!context.edit" class='address-valid date-since'>
<span class="floor"> <h3>{{ $t('date') }}</h3>
<b>{{ $t('floor') }}</b>: {{ address.floor }} <div class="input-group mb-3">
</span> <span class="input-group-text" id="validFrom"><i class="fa fa-fw fa-calendar"></i></span>
</div> <input type="date" class="form-control form-control-lg" name="validFrom"
<div v-if="address.corridor"> v-bind:placeholder="$t('validFrom')"
<span class="corridor"> v-model="validFrom"
<b>{{ $t('corridor') }}</b>: {{ address.corridor }} aria-describedby="validFrom"
</span> />
</div> </div>
<div v-if="address.steps"> <!--div v-if="errorMsg.length > 0">
<span class="steps"> {{ errors }}
<b>{{ $t('steps') }}</b>: {{ address.steps }} </div-->
</span> <div v-if="flag.loading">
</div> {{ $t('loading') }}
<div v-if="address.flat"> </div>
<span class="flat"> <div v-if="flag.success">
<b>{{ $t('flat') }}</b>: {{ address.flat }} {{ $t('person_address_creation_success') }}
</span> </div>
</div>
<div v-if="address.buildingName">
<span class="buildingName">
<b>{{ $t('buildingName') }}</b>: {{ address.buildingName }}
</span>
</div>
<div v-if="address.extra">
<span class="extra">
<b>{{ $t('extra') }}</b>: {{ address.extra }}
</span>
</div>
<div v-if="address.distribution">
<span class="distribution">
<b>{{ $t('distribution') }}</b>: {{ address.distribution }}
</span>
</div> </div>
</div> </div>
@ -93,7 +115,7 @@ export default {
'errorMsg', 'errorMsg',
'insideModal' 'insideModal'
], ],
emits: ['openEditPane', 'submitAddress'], emits: ['openEditPane', 'submitAddress', 'validFrom'],
computed: { computed: {
address() { address() {
return this.entity.address; return this.entity.address;
@ -109,6 +131,9 @@ export default {
}, },
getSubmited() { getSubmited() {
return this.entity.address; return this.entity.address;
},
validFrom() {
return new Date().toISOString().split('T')[0];
} }
} }
}; };

View File

@ -71,12 +71,12 @@
{% macro validity(address, options) %} {% macro validity(address, options) %}
{%- if options['with_valid_from'] == true -%} {%- if options['with_valid_from'] == true -%}
<span class="address-valid address-since"> <span class="address-valid date-since">
{{ 'Since %date%'|trans( { '%date%' : address.validFrom|format_date('long') } ) }} {{ 'Since %date%'|trans( { '%date%' : address.validFrom|format_date('long') } ) }}
</span> </span>
{%- endif -%} {%- endif -%}
{%- if options['with_valid_to'] == true -%} {%- if options['with_valid_to'] == true -%}
<span class="address-valid address-until"> <span class="address-valid date-until">
{{ 'Until %date%'|trans( { '%date%' : address.validTo|format_date('long') } ) }} {{ 'Until %date%'|trans( { '%date%' : address.validTo|format_date('long') } ) }}
</span> </span>
{%- endif -%} {%- endif -%}

View File

@ -0,0 +1,39 @@
<div id="address"></div>{# <== vue_address component #}
<script type="text/javascript">
window.vueRootComponent = 'app';
window.mode = '{{ mode|e('js') }}';
window.personId = {{ person.id|e('js') }};
window.addressId = {{ address_id|e('js') }};
{% if backUrl is defined %}
window.backUrl = '{{ backUrl|e('js') }}';
{% else %}
window.backUrl = '{{ path('chill_person_address_list', { 'person_id': person.id })|e('js') }}';
{% endif %}
{% if modalTitle is defined %}
window.modalTitle = '{{ modalTitle|trans|e('js') }}';
{% endif %}
window.button = {};
{% if buttonText is defined %}
window.buttonText = '{{ buttonText|trans|e('js') }}';
{% endif %}
{% if buttonType is defined %}
window.button.type = '{{ buttonType|e('js') }}';
{% endif %}
{% if buttonSize is defined %}
window.button.size = '{{ buttonSize|e('js') }}';
{% endif %}
{% if buttonDisplay is defined and buttonDisplay == false %}
window.button.display = false;
{% endif %}
{% if binModalStep1 is defined and binModalStep1 == false %}
window.binModalStep1 = false;
{% endif %}
{% if binModalStep2 is defined and binModalStep2 == false %}
window.binModalStep2 = false;
{% endif %}
</script>
{{ encore_entry_script_tags('vue_address') }}
{{ encore_entry_link_tags('vue_address') }}

View File

@ -25,22 +25,15 @@
{% block content %} {% block content %}
<h1>{{ block('title') }}</h1> <h1>{{ block('title') }}</h1>
<div id="address"></div>
{% include '@ChillPerson/Address/_insert_vue_address.html.twig' with {
address_id: person.lastAddress.id,
mode: 'edit',
binModalStep1: false,
binModalStep2: false,
} %}
{% endblock %} {% endblock %}
</div> </div>
{% endblock %} {% endblock %}
{% block css %}
{{ encore_entry_link_tags('vue_address') }}
{% endblock %}
{% block js %}
<script type="text/javascript">
window.personId = {{ person.id|e('js') }};
window.addressId = {{ address.id|e('js') }};
window.mode = 'edit';
window.vueRootComponent = 'app';
</script>
{{ encore_entry_script_tags('vue_address') }}
{% endblock %}

View File

@ -27,10 +27,16 @@
<ul class="record_actions my-3"> <ul class="record_actions my-3">
<li style="margin: auto;"> <li style="margin: auto;">
<a class="btn btn-lg btn-create"
href="{{ path('chill_person_address_new', { 'person_id' : person.id } ) }}"> {# include vue_address component #}
{{ 'Add an address'|trans }} {% include '@ChillPerson/Address/_insert_vue_address.html.twig' with {
</a> address_id: person.lastAddress.id,
mode: 'new',
buttonSize: 'btn-lg',
buttonText: 'Add an address',
modalTitle: 'Add an address',
} %}
</li> </li>
</ul> </ul>
@ -58,10 +64,16 @@
{% set row = row + 1 %} {% set row = row + 1 %}
{% if address.validTo is not empty and address.validTo < previousRowFrom %} {% if address.validTo is not empty and address.validTo < previousRowFrom %}
<div class="{{ 'row' ~ row ~ ' ' }}col-a action"> <div class="{{ 'row' ~ row ~ ' ' }}col-a action">
{# include vue_address component #}
<a href="" class="btn btn-sm btn-create">{{ 'Insert an address'|trans }}</a></div> <a href="" class="btn btn-sm btn-create">{{ 'Insert an address'|trans }}</a></div>
<div class="{{ 'row' ~ row ~ ' ' }}col-b"></div> <div class="{{ 'row' ~ row ~ ' ' }}col-b"></div>
<div class="{{ 'row' ~ row ~ ' ' }}col-c action"> <div class="{{ 'row' ~ row ~ ' ' }}col-c action">
{# include vue_address component #}
<a href="" class="btn btn-sm btn-create">{{ 'Insert an address'|trans }}</a></div> <a href="" class="btn btn-sm btn-create">{{ 'Insert an address'|trans }}</a></div>
<div class="date"> <div class="date">
{% if address.validTo is not empty %} {% if address.validTo is not empty %}
{{ address.validTo|format_date('short') }} {{ address.validTo|format_date('short') }}
@ -81,7 +93,10 @@
'has_no_address': true 'has_no_address': true
}) }} }) }}
<ul class="record_actions"> <ul class="record_actions">
{# include vue_address component #}
<li><a href="{{ path('chill_person_address_edit', { 'person_id': person.id, 'address_id' : address.id } ) }}" class="btn btn-edit"></a></li> <li><a href="{{ path('chill_person_address_edit', { 'person_id': person.id, 'address_id' : address.id } ) }}" class="btn btn-edit"></a></li>
</ul> </ul>
</div> </div>
{# endif #} {# endif #}
@ -130,6 +145,7 @@
</a> </a>
</li> </li>
<li> <li>
{# include vue_address component #}
<a class="btn btn-create" <a class="btn btn-create"
href="{{ path('chill_person_address_new', { 'person_id' : person.id } ) }}"> href="{{ path('chill_person_address_new', { 'person_id' : person.id } ) }}">
{{ 'Add an address'|trans }} {{ 'Add an address'|trans }}

View File

@ -25,21 +25,16 @@
{% block content %} {% block content %}
<h1>{{ block('title') }}</h1> <h1>{{ block('title') }}</h1>
<div id="address"></div>
{% include '@ChillPerson/Address/_insert_vue_address.html.twig' with {
address_id: person.lastAddress.id,
mode: 'new',
binModalStep1: false,
binModalStep2: false,
} %}
{% endblock %} {% endblock %}
</div> </div>
{% endblock %} {% endblock %}
{% block css %}
{{ encore_entry_link_tags('vue_address') }}
{% endblock %}
{% block js %}
<script type="text/javascript">
window.personId = {{ person.id|e('js') }};
window.mode = 'new';
window.vueRootComponent = 'app';
</script>
{{ encore_entry_script_tags('vue_address') }}
{% endblock %}

View File

@ -200,10 +200,17 @@ This view should receive those arguments:
<ul class="list-inline text-right mt-2"> <ul class="list-inline text-right mt-2">
<li class="list-inline-item"> <li class="list-inline-item">
<a class="btn btn-warning btn-sm" title="{{ 'Edit'|trans }}" {# include vue_address component #}
href="{{ path('chill_person_address_edit', { 'person_id': person.id, 'address_id' : person.lastAddress.id } ) }}"> {% include '@ChillPerson/Address/_insert_vue_address.html.twig' with {
<i class="fa fa-pencil fa-fw"></i> address_id: person.lastAddress.id,
</a> backUrl: path('chill_person_view', { 'person_id': person.id }),
mode: 'edit',
modalTitle: 'Edit address',
buttonText: 'Edit address',
buttonType: 'btn-update',
buttonSize: 'btn-sm',
buttonDisplay: false
} %}
</li> </li>
<li class="list-inline-item"> <li class="list-inline-item">
<a class="btn btn-secondary btn-sm" title="{{ "Addresses history"|trans }}" <a class="btn btn-secondary btn-sm" title="{{ "Addresses history"|trans }}"

View File

@ -208,6 +208,7 @@ The address has been successfully updated: L'adresse a été mise à jour avec s
Update address for %name%: Mettre à jour une adresse pour %name% Update address for %name%: Mettre à jour une adresse pour %name%
Modify address for %name%: Modifier une adresse pour %name% Modify address for %name%: Modifier une adresse pour %name%
Edit an address: Modifier une adresse Edit an address: Modifier une adresse
Edit address: Modifier l'adresse
Addresses history for %name%: Historique des adresses de %name% Addresses history for %name%: Historique des adresses de %name%
Addresses history: Historique des adresses Addresses history: Historique des adresses
New address : Nouvelle adresse New address : Nouvelle adresse