mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
CourseLocation: replace in accourse vue component the old resume _warning_address.html.twig message
This commit is contained in:
parent
82db55cfec
commit
eb89fa2cd4
@ -14,6 +14,18 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div v-if="hasNoPersonLocation" class="alert alert-danger no-person-location">
|
||||||
|
<i class="fa fa-warning fa-2x"></i>
|
||||||
|
<div>
|
||||||
|
<p>
|
||||||
|
{{ $t('courselocation.associate_at_least_one_person_with_one_household_with_address') }}
|
||||||
|
<a href="#section-10">
|
||||||
|
<i class="fa fa-level-up fa-fw"></i>
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="flex-table" v-if="accompanyingCourse.location">
|
<div class="flex-table" v-if="accompanyingCourse.location">
|
||||||
<div class="item-bloc">
|
<div class="item-bloc">
|
||||||
<address-render-box
|
<address-render-box
|
||||||
@ -27,7 +39,10 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="isTemporaryAddress" class="alert alert-warning separator">
|
<div v-if="isTemporaryAddress" class="alert alert-warning separator">
|
||||||
<p>{{ $t('courselocation.temporary_address_must_be_changed') }}</p>
|
<p>
|
||||||
|
{{ $t('courselocation.temporary_address_must_be_changed') }}
|
||||||
|
<i class="fa fa-fw fa-map-marker"></i>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -116,11 +131,35 @@ export default {
|
|||||||
hasNoLocation() {
|
hasNoLocation() {
|
||||||
return this.accompanyingCourse.locationStatus === 'none';
|
return this.accompanyingCourse.locationStatus === 'none';
|
||||||
},
|
},
|
||||||
|
currentParticipations() {
|
||||||
|
return this.accompanyingCourse.participations.filter(p => p.enddate !== null);
|
||||||
|
},
|
||||||
|
hasNoPersonLocation() {
|
||||||
|
let addressInParticipations_ = []
|
||||||
|
this.currentParticipations.forEach(p => {
|
||||||
|
addressInParticipations_.push(this.checkHouseholdAddressForParticipation(p));
|
||||||
|
});
|
||||||
|
const booleanReducer = (previousValue, currentValue) => previousValue || currentValue;
|
||||||
|
let addressInParticipations = addressInParticipations_.reduce(booleanReducer);
|
||||||
|
//console.log(addressInParticipations_, addressInParticipations);
|
||||||
|
return (
|
||||||
|
this.accompanyingCourse.step !== 'DRAFT'
|
||||||
|
&& this.isTemporaryAddress
|
||||||
|
&& !addressInParticipations
|
||||||
|
)
|
||||||
|
;
|
||||||
|
},
|
||||||
isContextEdit() {
|
isContextEdit() {
|
||||||
return this.context.edit;
|
return this.context.edit;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
checkHouseholdAddressForParticipation(participation) {
|
||||||
|
if (participation.person.current_household_id === null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return participation.person.current_household_address !== null;
|
||||||
|
},
|
||||||
initAddressContext() {
|
initAddressContext() {
|
||||||
let context = {
|
let context = {
|
||||||
target: {
|
target: {
|
||||||
@ -166,12 +205,36 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
div.flex-table {
|
div#accompanying-course {
|
||||||
div.item-bloc {
|
div.vue-component {
|
||||||
div.alert {
|
& > div.alert.no-person-location {
|
||||||
margin: 0 -0.9em -1em;
|
margin: 0 0 -1em;
|
||||||
|
}
|
||||||
|
div.no-person-location {
|
||||||
|
padding-bottom: 1.5em;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
& > i {
|
||||||
|
flex-basis: 1.5em; flex-grow: 0; flex-shrink: 0;
|
||||||
|
padding-top: 0.2em;
|
||||||
|
opacity: 0.75;
|
||||||
|
}
|
||||||
|
& > div {
|
||||||
|
flex-basis: auto;
|
||||||
|
div.action {
|
||||||
|
button.btn-update {
|
||||||
|
margin-right: 2em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
div.flex-table {
|
||||||
|
div.item-bloc {
|
||||||
|
div.alert {
|
||||||
|
margin: 0 -0.9em -1em;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
:id="p.person.id"
|
:id="p.person.id"
|
||||||
:value="p.person.id"
|
:value="p.person.id"
|
||||||
/>
|
/>
|
||||||
<label class="form-check-label" for="hasNoHousehold">
|
<label class="form-check-label">
|
||||||
{{ p.person.text }}
|
{{ p.person.text }}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
@ -81,7 +81,8 @@ const appMessages = {
|
|||||||
edit_temporary_address: "Modifier l'adresse temporaire",
|
edit_temporary_address: "Modifier l'adresse temporaire",
|
||||||
assign_course_address: "Désigner comme l'adresse du parcours",
|
assign_course_address: "Désigner comme l'adresse du parcours",
|
||||||
remove_button: "Enlever l'adresse",
|
remove_button: "Enlever l'adresse",
|
||||||
temporary_address_must_be_changed: "Cette adresse est temporaire et devrait être remplacée par celle d'un usager de référence.",
|
temporary_address_must_be_changed: "Cette adresse est temporaire. Le parcours devrait être localisé auprès d'un usager concerné.",
|
||||||
|
associate_at_least_one_person_with_one_household_with_address: "Associez au moins un membre du parcours à un ménage, et indiquez une adresse à ce ménage.",
|
||||||
sure: "Êtes-vous sûr ?",
|
sure: "Êtes-vous sûr ?",
|
||||||
sure_description: "Voulez-vous faire de cette adresse l'adresse du parcours ?",
|
sure_description: "Voulez-vous faire de cette adresse l'adresse du parcours ?",
|
||||||
ok: "Désigner comme adresse du parcours",
|
ok: "Désigner comme adresse du parcours",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user