accourse associated_persons: display alert warning if persons without household

This commit is contained in:
Mathieu Jaumotte 2021-09-06 19:41:09 +02:00
parent e99a371f3a
commit 3a6a0da1dd
2 changed files with 55 additions and 1 deletions

View File

@ -30,6 +30,29 @@
</add-persons>
</div>
<div v-if="participationWithoutHousehold.length > 0" class="alert alert-warning no-household">
<i class="fa fa-warning fa-2x"></i>
<div class="floatbutton bottom"><div class="box">
<div class="action">
<button class="btn btn-update">{{ $t('persons_associated.update_household') }}</button>
</div>
<p class="mb-3">{{ $t('persons_associated.person_without_household_warning') }}</p>
<div class="form-check" v-for="p in participationWithoutHousehold">
<input type="checkbox"
class="form-check-input"
v-model="hasNoHousehold"
:id="p.person.id"
:value="p.person.id" />
<label class="form-check-label" for="hasNoHousehold">
{{ p.person.text }}
</label>
</div>
</div></div>
</div>
</div>
</template>
@ -65,6 +88,9 @@ export default {
},
counter() {
return this.currentParticipations.length;
},
participationWithoutHousehold() {
return this.currentParticipations.filter(p => p.person.current_household_id === null);
}
},
methods: {
@ -88,3 +114,29 @@ export default {
}
}
</script>
<style lang="scss" scoped>
div#accompanying-course {
div.vue-component {
& > div.alert {
margin: 1em 0 0;
}
div.no-household {
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;
}
}
}
}
}
}
</style>

View File

@ -47,7 +47,9 @@ const appMessages = {
sure_description: "Une fois confirmé, il ne sera pas possible de faire marche arrière ! La sortie reste cependant consignée dans l'historique du parcours.",
ok: "Oui, l'usager quitte le parcours",
show_household_number: "Voir le ménage (n° {id})",
show_household: "Voir le ménage"
show_household: "Voir le ménage",
person_without_household_warning: "Certaines personnes n'appartiennent à aucun ménage actuellement. Renseignez leur appartenance à un ménage dès que possible.",
update_household: "Modifier l'appartenance",
},
requestor: {
title: "Demandeur",