Compare commits

..

No commits in common. "363b5bb5412248e40e3d190499a6759899f26d95" and "8a85cc054d273aaddf0bdf30267e365090c7cefa" have entirely different histories.

2 changed files with 21 additions and 34 deletions

View file

@ -1,7 +1,6 @@
export interface ProtocolPresenceViewModel {
memberId: number;
absent: boolean;
excused: boolean;
protocolId: number;
}

View file

@ -46,8 +46,7 @@
}"
>
<span class="block truncate" :class="{ 'font-medium': selected, 'font-normal': !selected }">
{{ getMember(member.memberId)?.firstname }} {{ getMember(member.memberId)?.lastname }}
{{ getMember(member.memberId)?.nameaffix }}
{{ getMember(member.memberId)?.firstname }} {{ getMember(member.memberId)?.lastname }} {{ getMember(member.memberId)?.nameaffix }}
</span>
<span
v-if="selected"
@ -72,20 +71,11 @@
class="flex flex-row h-fit w-full border border-primary rounded-md bg-primary p-2 text-white justify-between items-center"
>
<div class="flex flex-col items-start">
<p>
{{ getMember(member.memberId)?.lastname }}, {{ getMember(member.memberId)?.firstname }}
{{ getMember(member.memberId)?.nameaffix ? `- ${getMember(member.memberId)?.nameaffix}` : "" }}
</p>
<div class="flex flex-row gap-4">
<p>{{ getMember(member.memberId)?.lastname }}, {{ getMember(member.memberId)?.firstname }} {{ getMember(member.memberId)?.nameaffix ? `- ${getMember(member.memberId)?.nameaffix}` : "" }}</p>
<label class="flex flex-row gap-2 items-center">
<input type="checkbox" v-model="member.absent" />
war abwesend
</label>
<label v-if="member.absent" class="flex flex-row gap-2 items-center">
<input type="checkbox" v-model="member.excused" />
ist entschuldigt
</label>
</div>
</div>
<TrashIcon
v-if="can('create', 'club', 'protocol')"
@ -133,23 +123,21 @@ export default defineComponent({
...mapWritableState(useProtocolPresenceStore, ["presence", "loading"]),
...mapState(useMemberStore, ["members"]),
...mapState(useAbilityStore, ["can"]),
filtered(): Array<{ memberId: number; absent: boolean; excused: boolean; protocolId: number }> {
return (
this.query === ""
filtered(): Array<{memberId:number, absent:boolean; protocolId:number}> {
return (this.query === ""
? this.members
: this.members.filter((member) =>
(member.firstname + " " + member.lastname)
.toLowerCase()
.replace(/\s+/g, "")
.includes(this.query.toLowerCase().replace(/\s+/g, ""))
)
).map((m) => ({ memberId: m.id, absent: false, excused: true, protocolId: parseInt(this.protocolId ?? "") }));
},
getMember() {
return (memberId: number) => {
return this.members.find((m) => memberId == m.id);
};
)).map(m =>({memberId: m.id, absent:false, protocolId:parseInt(this.protocolId ?? "")}));
},
getMember(){
return (memberId:number) => {
return this.members.find(m => memberId == m.id)
}
}
},
mounted() {
this.fetchMembers(0, 1000, "", true);