From f89c690f1b3c0927fe1bffbda94cc6f0114707d5 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Wed, 5 May 2021 13:36:45 +0200 Subject: [PATCH 1/2] add scratch fontawesome 'remove' button --- .../modules/scratch/custom/modules/_buttons.scss | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/modules/scratch/custom/modules/_buttons.scss b/src/Bundle/ChillMainBundle/Resources/public/modules/scratch/custom/modules/_buttons.scss index e94aa494e..0b7af263b 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/modules/scratch/custom/modules/_buttons.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/modules/scratch/custom/modules/_buttons.scss @@ -5,7 +5,7 @@ @include button($green, $white); } - &.bt-reset, &.bt-delete { + &.bt-reset, &.bt-delete, &.bt-remove { @include button($red, $white); } @@ -24,6 +24,7 @@ &.bt-save::before, &.bt-new::before, &.bt-delete::before, + &.bt-remove::before, &.bt-update::before, &.bt-edit::before, &.bt-cancel::before, @@ -56,7 +57,12 @@ // add a trash content: ""; } - + + &.bt-remove::before { + // add a times + content: ""; + } + &.bt-edit::before, &.bt-update::before { // add a pencil content: ""; @@ -94,6 +100,7 @@ &.bt-save::before, &.bt-new::before, &.bt-delete::before, + &.bt-remove::before, &.bt-update::before, &.bt-edit::before, &.bt-cancel::before, @@ -123,6 +130,7 @@ &.bt-save::before, &.bt-new::before, &.bt-delete::before, + &.bt-remove::before, &.bt-update::before, &.bt-edit::before, &.bt-cancel::before, From c20e9507d516a0dea0e2d2cd801b9eb4a69d90fe Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Wed, 5 May 2021 15:03:58 +0200 Subject: [PATCH 2/2] prepare close participation button (wip) --- .../AccompanyingCourse/components/PersonItem.vue | 15 +++++++++++++-- .../components/PersonsAssociated.vue | 10 ++++++---- .../vuejs/AccompanyingCourse/store/index.js | 11 +++++++---- .../public/vuejs/_components/AddPersons.vue | 14 +++----------- 4 files changed, 29 insertions(+), 21 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonItem.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonItem.vue index 93b3b1d6e..2df932e0f 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonItem.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonItem.vue @@ -24,10 +24,16 @@
  • +
  • + +
  • @@ -45,6 +51,11 @@ export default { } } }, - emits: ['remove'] + emits: ['remove'], + methods: { + closeParticiapation() { + + } + } } diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated.vue index 22fae5d79..6827ea585 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated.vue @@ -17,17 +17,17 @@ v-for="participation in participations" v-bind:participation="participation" v-bind:key="participation.id" - @remove="removePerson"> + @remove="removeParticipation"> @@ -48,12 +48,14 @@ export default { counter: state => state.accompanying_course.participations.length }), methods: { - removePerson(item) { + removeParticipation(item) { this.$store.dispatch('removeParticipation', item) }, + /* savePersons() { console.log('[wip] saving persons'); } +*/ } } diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js index c3a868950..e69fab0d2 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js @@ -25,10 +25,13 @@ let getDataPromise = getAccompanyingCourse(id) }, mutations: { removeParticipation(state, item) { - //console.log('remove item', item.id); - state.accompanying_course.participations = state.accompanying_course.participations.filter( - participation => participation !== item - ); + //console.log('mutation: remove item', item.id); + state.accompanying_course.participations = state.accompanying_course.participations.filter(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) { //console.log('add new item'); diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue index 7367d1406..8c472157a 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue @@ -43,6 +43,9 @@ v-bind:item="item" v-bind:key="item.id"> + @@ -112,17 +115,6 @@ export default { addPersons() { console.log('add persons'); // 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; } }