diff --git a/aleksis/apps/alsijil/frontend/components/coursebook/absences/ManageStudentsDialog.vue b/aleksis/apps/alsijil/frontend/components/coursebook/absences/ManageStudentsDialog.vue index c0764f8f3a8d3c735e39bc36c9baf92f25da1285..9bba651a8cae3cd9b2a59e63e72148e8b1155c94 100644 --- a/aleksis/apps/alsijil/frontend/components/coursebook/absences/ManageStudentsDialog.vue +++ b/aleksis/apps/alsijil/frontend/components/coursebook/absences/ManageStudentsDialog.vue @@ -47,6 +47,8 @@ export default { showAlert: false, num: 0, reason: "no reason", + name: "nobody", + personIds: [], }, }; }, @@ -78,8 +80,16 @@ export default { this.$set(this.selected, []); this.$refs.iterator.selected = []; }, - activateFullDayDialog() { - // Separate method as there may be additional logic here in the future + activateFullDayDialog({ data: { updateParticipationStatuses: { items }}}) { + const itemIds = items.map(item => item.id); + const participations = this.documentation.participations.filter(part => itemIds.includes(part.id)); + + if (this.markAsAbsentDay.num === 1) { + this.markAsAbsentDay.name = participations[0].person.firstName; + } + + this.$set(this.markAsAbsentDay.personIds, itemIds); + this.markAsAbsentDay.showAlert = true; } }, diff --git a/aleksis/apps/alsijil/frontend/messages/en.json b/aleksis/apps/alsijil/frontend/messages/en.json index 91b3646df9999233e7bd70e4e422cecfbceac912..7bb2946c12c07fdccf2140b8d956cfa72e4a77de 100644 --- a/aleksis/apps/alsijil/frontend/messages/en.json +++ b/aleksis/apps/alsijil/frontend/messages/en.json @@ -113,7 +113,7 @@ "warning": "The following lessons are in the selected time period. Please check that you want to register the absences for these lessons before confirming." }, "mark_as_absent_day": { - "title": "Error: no person | Successfully marked as '{reason}' | Successfully marked {n} people as '{reason}'", + "title": "Error: no person | Successfully marked {name} as '{reason}' | Successfully marked {n} people as '{reason}'", "description": "Do you want to mark them as '{reason}' for the rest of their day?", "action_button": "Extend absence" }