Commit add43a81 authored by Lucas Détré's avatar Lucas Détré

new explain view with filtering on tags + adjustements

parent cc3e77bf
Pipeline #2875 passed with stage
in 1 minute and 34 seconds
<template>
<div id="Eligibilite">
<ul>
<li v-for="(props, id) in this.conditions" :key="id" :class="{passed: props.status, failed: !props.status}">
<span v-html="transformData(props.condition)"/>
<span v-if="props.children">
<eligibilite :conditions="props.children"/>
</span>
</li>
</ul>
</div>
</template>
<script>
import Eligibilite from './Eligibilite.vue';
export default {
name: 'Eligibilite',
props: ['conditions', 'schema'],
components: {
Eligibilite,
},
methods: {
transformData: function (data) {
return data
.replace(/Ou /g, '<span style="font-style: italic">&nbsp;Ou&nbsp; </span>')
.replace(/OU /g, '<span style="font-style: italic">&nbsp;OU&nbsp; </span>')
.replace(/, ou /g, '<span style="font-style: italic">&nbsp;, ou&nbsp; </span>')
.replace(/Et /g, '<span style="font-style: italic">&nbsp;Et&nbsp; </span>')
.replace(/ET /g, '<span style="font-style: italic">&nbsp;ET&nbsp; </span>')
.replace(/, et /g, '<span style="font-style: italic">&nbsp;, et&nbsp; </span>');
}
}
}
</script>
<style scoped>
.failed:before {
content: '✗';
color: crimson;
}
.passed:before {
content: '✔';
color: forestgreen;
}
li li {
padding-left: 1.5rem;
}
li ul, li.sub {
display: inline;
padding-left: 0;
}
.connective {
font-style: italic !important;
}
</style>
\ No newline at end of file
......@@ -42,20 +42,19 @@
<input type="button" class="btn main-button" value="Simuler" v-on:click="simulate()"/>
</div>
</div>
</div>
<!------------------- RESULTATS --------------->
<div v-else id="simulate-results">
<div v-if="!isLoading" class="mt-5">
<SimulateurResultats :schema="schema" :financements="financements" :financements_eligibles="financements_eligibles" :scenario="scenario" :context="context"></SimulateurResultats>
</div>
<div v-else class="text-center loading-gif">
<img src="./../assets/images/loading.gif" alt="loading...">
</div>
<div v-if="resultats" id="simulate-results">
<div v-if="!isLoading" class="mt-5">
<SimulateurResultats :schema="schema" :financements="financements" :financements_eligibles="financements_eligibles" :scenario="scenario" :context="context"></SimulateurResultats>
</div>
<div v-else class="text-center loading-gif">
<img src="./../assets/images/loading.gif" alt="loading...">
</div>
</div>
</div>
</template>
<script>
import SimulateurStepFormation from './SimulateurStepFormation.vue';
import SimulateurStepOne from './SimulateurStepOne.vue';
import SimulateurStepTwo from './SimulateurStepTwo.vue';
......@@ -155,9 +154,6 @@
schema: {},
}
},
mounted: function () {
this.loadSchema();
},
computed: {
formation_step_completed: function () {
return this.formation.numero != null;
......@@ -199,7 +195,13 @@
},
step_four_completed: function () {
if (this.step_three_completed) {
if (this.situation_inscrit == '1') return true;
if (this.situation_inscrit == '1') {
if(this.situation_contratapprentissage) {
if (this.situation_contratapprentissagetype == false || this.situation_contratapprentissagetype == "-") return false;
}
if(this.situation_contrataide) return (this.situation_personneencourscontrataide === "oui" || this.situation_personneencourscontrataide === "non");
return true;
}
else if (this.situation_inscrit == '2') {
if (this.contrat == 'cdd') {
if (this.moistravailleencdd != '' && this.experience != '') return true;
......@@ -289,7 +291,9 @@
formation : this.formation
}
}
},
mounted: function () {
this.loadSchema();
},
methods: {
loadSchema: function () {
......
<template>
<div id="SimulateurExplain">
<br>
<pre> {{ this.financements }} </pre>
<div class="filter">
<span v-for="(tag, i) in this.tags" :key="i" class="filter-tags label" :class="{eligible: tagsEligibles.includes(tag), selected: selectedTags.includes(tag)}" v-on:click="setFilter(tag)">
{{tag}}
</span>
</div>
<br>
<div>
<span v-if="this.showReinitFilterButton" v-on:click="initFilter();" class="btn main-button pull-right">Réinitialiser les filtres</span>
</div>
<br>
<br>
<ul>
<li v-for="(financement, financement_id) in this.financements" :key="financement_id" class="result" :class="{hide:showFinancement(financement)}">
<br>
<h5 :class="{passed: financement.eligible, failed: !financement.eligible}" data-toggle="collapse" :data-target="'#details_'+financement_id" aria-expanded="false" aria-controls="explain" style="cursor:pointer;" >{{ financement.intitule }}
<div class="pull-right">
<label v-for="(tag, tag_id) in financement.tags" :key="tag_id" class="label">{{ tag }}</label>
</div>
</h5>
<div :id="'details_'+financement_id" class="collapse">
<p><strong>Description</strong> {{ financement.description }}</p>
<p><strong>Démarches</strong> {{ financement.demarches }}</p>
<div v-if="financement.eligible">
<p><strong>Prise en charge</strong> {{ financement.prise_en_charge }}</p>
<p v-if="financement.prise_en_charge_texte"><strong>Prise en charge</strong> {{ financement.prise_en_charge_texte }}</p>
<p><strong>Plafond de prise en charge</strong> {{ financement.plafond_prise_en_charge }}</p>
<p><strong>Plafond de prix horaire</strong> {{ financement.plafond_prix_horaire }}</p>
<p><strong>Nombre d'heures prises en charge</strong> {{ financement.heures }}</p>
<p><strong>Rémunération</strong> {{ financement.remuneration }}</p>
<p v-if="financement.remuneration_texte"><strong>Rémunération</strong> {{ financement.remuneration_texte }}</p>
<p v-if="financement.fin_remuneration"><strong>Fin de la rémunération</strong> {{ renderValue('financement.fin_remuneration', financement.fin_remuneration,schema) }}</p>
<p v-if="financement.rff"><strong>RFF</strong> {{ financement.rff }}</p>
<p v-if="financement.debut_rff"><strong>Début de la RFF</strong> {{ renderValue('financement.debut_rff', financement.debut_rff,schema) }}</p>
<p v-if="financement.fin_rff"><strong>Fin de la RFF</strong> {{ renderValue('financement.fin_rff', financement.fin_rff,schema) }}</p>
<p v-if="financement.organisme"><strong>Organisme</strong> {{ financement.organisme.nom }}</p>
</div>
<p>
<strong>Règles de gestion</strong><br><br>
<eligibilite :conditions="financement.explain" :schema="schema"/>
</p>
</div>
<br>