mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
prepare close participation button (wip)
This commit is contained in:
parent
f89c690f1b
commit
c20e9507d5
@ -24,10 +24,16 @@
|
|||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<button class="sc-button bt-delete"
|
<button class="sc-button bt-delete"
|
||||||
:title="$t('action.remove')"
|
:title="$t('action.delete')"
|
||||||
@click.prevent="$emit('remove', participation)">
|
@click.prevent="$emit('remove', participation)">
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<button class="sc-button bt-remove"
|
||||||
|
:title="$t('action.remove')"
|
||||||
|
@click="closeParticipation">
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -45,6 +51,11 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
emits: ['remove']
|
emits: ['remove'],
|
||||||
|
methods: {
|
||||||
|
closeParticiapation() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -17,17 +17,17 @@
|
|||||||
v-for="participation in participations"
|
v-for="participation in participations"
|
||||||
v-bind:participation="participation"
|
v-bind:participation="participation"
|
||||||
v-bind:key="participation.id"
|
v-bind:key="participation.id"
|
||||||
@remove="removePerson">
|
@remove="removeParticipation">
|
||||||
</person-item>
|
</person-item>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<add-persons></add-persons>
|
<add-persons></add-persons>
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
<li>
|
<!--li>
|
||||||
<button class="sc-button orange" @click="savePersons">
|
<button class="sc-button orange" @click="savePersons">
|
||||||
{{ $t('action.save') }}
|
{{ $t('action.save') }}
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li-->
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -48,12 +48,14 @@ export default {
|
|||||||
counter: state => state.accompanying_course.participations.length
|
counter: state => state.accompanying_course.participations.length
|
||||||
}),
|
}),
|
||||||
methods: {
|
methods: {
|
||||||
removePerson(item) {
|
removeParticipation(item) {
|
||||||
this.$store.dispatch('removeParticipation', item)
|
this.$store.dispatch('removeParticipation', item)
|
||||||
},
|
},
|
||||||
|
/*
|
||||||
savePersons() {
|
savePersons() {
|
||||||
console.log('[wip] saving persons');
|
console.log('[wip] saving persons');
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -25,10 +25,13 @@ let getDataPromise = getAccompanyingCourse(id)
|
|||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
removeParticipation(state, item) {
|
removeParticipation(state, item) {
|
||||||
//console.log('remove item', item.id);
|
//console.log('mutation: remove item', item.id);
|
||||||
state.accompanying_course.participations = state.accompanying_course.participations.filter(
|
state.accompanying_course.participations = state.accompanying_course.participations.filter(participation => participation !== item);
|
||||||
participation => participation !== item
|
},
|
||||||
);
|
closeParticipation(state, item) {
|
||||||
|
console.log('mutation: close item', item.id);
|
||||||
|
let participation = state.accompanying_course.participations.filter(participation => participation === item);
|
||||||
|
console.log('participation', participation);
|
||||||
},
|
},
|
||||||
addParticipation(state, item) {
|
addParticipation(state, item) {
|
||||||
//console.log('add new item');
|
//console.log('add new item');
|
||||||
|
@ -43,6 +43,9 @@
|
|||||||
v-bind:item="item"
|
v-bind:item="item"
|
||||||
v-bind:key="item.id">
|
v-bind:key="item.id">
|
||||||
</person-suggestion>
|
</person-suggestion>
|
||||||
|
<button v-if="query.length >= 3" class="sc-button bt-create ml-5 mt-2" name="createPerson">
|
||||||
|
Ajouter "{{ query }}"
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -112,17 +115,6 @@ export default {
|
|||||||
addPersons() {
|
addPersons() {
|
||||||
console.log('add persons');
|
console.log('add persons');
|
||||||
// code here
|
// code here
|
||||||
/*
|
|
||||||
addPerson() {
|
|
||||||
console.log('[wip] opening add persons modal');
|
|
||||||
this.$store.dispatch('addParticipation', {
|
|
||||||
id: SimpsonId++,
|
|
||||||
person: { firstName: "Lisa", lastName: "Simpson", id: SimpsonId },
|
|
||||||
startDate: { datetime: "1975-09-15T00:00:00+0100" },
|
|
||||||
endDate: { datetime: "1975-09-28T00:00:00+0100" },
|
|
||||||
})
|
|
||||||
},
|
|
||||||
*/
|
|
||||||
this.modal.showModal = false;
|
this.modal.showModal = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user