mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
add/remove evaluation from evaluation list
This commit is contained in:
@@ -85,25 +85,22 @@
|
||||
</div>
|
||||
|
||||
<!-- list evaluations -->
|
||||
<div v-if="hasEvaluationsForAction">
|
||||
<add-evaluation
|
||||
:availableEvaluations="evaluationsForAction">
|
||||
</add-evaluation>
|
||||
</div>
|
||||
<add-evaluation v-if="hasEvaluationsForAction"></add-evaluation>
|
||||
|
||||
<!-- box to add new evaluation -->
|
||||
<div class="add_evaluation">
|
||||
<div v-if="showAddEvaluation">
|
||||
<new-evaluation>
|
||||
</new-evaluation>
|
||||
<p>{{ $t('available_evaluations_text') }}</p>
|
||||
<ul class="list-evaluations">
|
||||
<li v-for="e in availableForCheckEvaluation" class="badge bg-primary" @click="addEvaluation(e)">
|
||||
<i class="fa fa-plus"></i>
|
||||
{{ e.title.fr }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button
|
||||
:title="$t('add_an_evaluation')"
|
||||
class="btn btn-create"
|
||||
@click="toggleAddEvaluation">
|
||||
</button>
|
||||
<button :title="$t('add_an_evaluation')" class="btn btn-create" @click="toggleAddEvaluation"></button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
Reference in New Issue
Block a user