diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue index bb10dc9b5..a8c06c5c6 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue @@ -85,25 +85,22 @@ -
- - -
+
- - +

{{ $t('available_evaluations_text') }}

+
@@ -222,7 +219,7 @@ import CKEditor from '@ckeditor/ckeditor5-vue'; import ClassicEditor from 'ChillMainAssets/module/ckeditor5/index.js'; import AddResult from './components/AddResult.vue'; import AddEvaluation from './components/AddEvaluation.vue'; -import NewEvaluation from './components/NewEvaluation.vue'; +//import FormEvaluation from './components/FormEvaluation.vue'; import Person from 'ChillPersonAssets/vuejs/_components/Person/Person.vue'; import AddPersons from 'ChillPersonAssets/vuejs/_components/AddPersons.vue'; import ShowAddress from 'ChillMainAssets/vuejs/Address/components/ShowAddress.vue'; @@ -254,6 +251,7 @@ const i18n = { add_thirdparties: "Ajouter des tiers", choose_thirdparties: "Choisir des tiers", fix_these_errors: "Veuillez corriger les erreurs suivantes :", + available_evaluations_text: "Évaluations disponibles pour ajout :", } } }; @@ -264,7 +262,7 @@ export default { ckeditor: CKEditor.component, AddResult, AddEvaluation, - NewEvaluation, + //FormEvaluation, AddPersons, Person, ShowAddress, @@ -350,6 +348,12 @@ export default { return this.$store.state.goalsForAction.filter(g => !pickedIds.includes(g.id)); }, + availableForCheckEvaluation() { + console.log('evaluationsPicked', this.$store.state.evaluationsPicked); + console.log('evaluationsForAction', this.$store.state.evaluationsForAction); + let pickedIds = this.$store.state.evaluationsPicked.map(e => e.evaluation.id); + return this.$store.state.evaluationsForAction.filter(e => !pickedIds.includes(e.id)); + }, personsPicked: { get() { let s = this.$store.state.personsPicked.map(p => p.id); @@ -375,6 +379,10 @@ export default { //console.log('remove goal', g); this.$store.commit('removeGoal', g); }, + addEvaluation(e) { + console.log('add Evaluation', e); + this.$store.commit('addEvaluation', e); + }, toggleAddEvaluation() { this.showAddEvaluation = !this.showAddEvaluation; }, @@ -487,40 +495,12 @@ export default { $gray-100 10px, $gray-100 20px ); - text-align: center; font-weight: 700; padding-top: 1.5rem; } } - ul.list-objectives { - list-style-type: none; - padding: 0; - - li { - margin: 0.5rem; - } - } - - div.objective-title { - font-weight: bold; - /* - margin-top: 1rem; - font-size: 1.5rem; - text-align: center; - */ - - i.fa { - padding: 0.25rem; - } - - i.fa-times { - background-color: $red; - color: $white; - } - } - li.badge, div.badge { padding-bottom: 0; padding-top: 0; @@ -533,20 +513,6 @@ export default { i.fa-plus { background-color: $green; } - - } - } - - #objectives, #evaluations { - padding: 0; - - & > div.title { - background-color: $gray-200; - color: $gray-700; - - h3 { - text-align: center; - } } } @@ -574,39 +540,70 @@ export default { #errors { grid-area: errors; } -} -button.hide { - background-color: $primary; -} + #objectives, #evaluations { + padding: 0; -ul.list-results, -ul.list-evaluations { - list-style-type: none; - padding: 0; + & > div.title { + background-color: $gray-200; + color: $gray-700; - li { - margin: 0.5rem; - } - - li.badge { - padding-bottom: 0; - padding-top: 0; - padding-left: 0; - - i.fa { - /*border-radius: 0.25rem; */ - padding: 0.25rem; + h3 { + text-align: center; + } } - i.fa-plus { - background-color: $green; + ul.list-evaluations, ul.list-results { + list-style-type: none; + padding: 0; + + li { + margin: 0.5rem; + } + + li.badge { + padding-bottom: 0; + padding-top: 0; + padding-left: 0; + + i.fa { + /*border-radius: 0.25rem; */ + padding: 0.25rem; + } + + i.fa-plus { + background-color: $green; + } + + i.fa-times { + background-color: $red; + color: $white; + } + } } - i.fa-times { - background-color: $red; - color: $white; + ul.list-evaluations, ul.list-objectives { + list-style-type: none; + padding: 0; + + li { + margin: 0.5rem; + } + } + + div.evaluation-title, div.objective-title { + font-weight: bold; + + i.fa { + padding: 0.25rem; + } + + i.fa-times { + background-color: $red; + color: $white; + } } } } + diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/AddEvaluation.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/AddEvaluation.vue index 7ea6de0c6..de677c820 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/AddEvaluation.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/AddEvaluation.vue @@ -1,35 +1,13 @@ @@ -46,40 +24,23 @@ const i18n = { export default { name: "AddEvaluation", - props: ['availableEvaluations'], + props: [], i18n, data() { return { - isExpanded: false, }; }, computed: { hasEvaluation() { - return this.$store.state.evaluationsForAction.length > 0; + return this.$store.state.evaluationsPicked.length > 0; }, pickedEvaluations() { return this.$store.state.evaluationsPicked; - }, - availableForCheckEvaluations() { - - let pickedIds = this.$store.state.evaluationsPicked.map(e => e.id); - ////console.log('picked ids', pickedIds); - - return this.$store.state.evaluationsForAction.filter(e => !pickedIds.includes(e.id)); } }, methods: { - toggleSelect() { - this.isExpanded = !this.isExpanded; - }, - addEvaluation(e) { - ////console.log('addEvaluation', e); - this.$store.commit('addEvaluationPicked', e); - return; - }, removeEvaluation(e) { - ////console.log('removeEvaluation', e); - this.$store.commit('removeEvaluationPicked', e); + this.$store.commit('removeEvaluation', e); return; } } diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/NewEvaluation.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue similarity index 97% rename from src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/NewEvaluation.vue rename to src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue index f96fb3027..d77771dae 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/NewEvaluation.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue @@ -1,4 +1,6 @@