mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Merge remote-tracking branch 'origin/139_demandeur' into 139_demandeur
This commit is contained in:
commit
d327dae9fa
@ -182,3 +182,15 @@ div.results {
|
||||
color: grey;
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
a.flag-toggle {
|
||||
color: white;
|
||||
padding: 0 10px;
|
||||
cursor: pointer;
|
||||
&:hover {
|
||||
color: white;
|
||||
//border: 1px solid rgba(255,255,255,0.2);
|
||||
text-decoration: underline;
|
||||
border-radius: 20px;
|
||||
}
|
||||
}
|
||||
|
@ -2,8 +2,11 @@
|
||||
<accompanying-course></accompanying-course>
|
||||
<persons-associated></persons-associated>
|
||||
<requestor></requestor>
|
||||
<social-issue></social-issue>
|
||||
<referrer></referrer>
|
||||
<resources></resources>
|
||||
<comment></comment>
|
||||
<confirm></confirm>
|
||||
<!--test></test-->
|
||||
</template>
|
||||
|
||||
@ -13,8 +16,11 @@ import { mapState } from 'vuex'
|
||||
import AccompanyingCourse from './components/AccompanyingCourse.vue';
|
||||
import PersonsAssociated from './components/PersonsAssociated.vue';
|
||||
import Requestor from './components/Requestor.vue';
|
||||
import SocialIssue from './components/SocialIssue.vue';
|
||||
import Referrer from './components/Referrer.vue';
|
||||
import Resources from './components/Resources.vue';
|
||||
import Comment from './components/Comment.vue';
|
||||
import Confirm from './components/Confirm.vue';
|
||||
//import Test from './components/Test.vue';
|
||||
|
||||
export default {
|
||||
@ -23,8 +29,11 @@ export default {
|
||||
AccompanyingCourse,
|
||||
PersonsAssociated,
|
||||
Requestor,
|
||||
SocialIssue,
|
||||
Referrer,
|
||||
Resources,
|
||||
Comment,
|
||||
Confirm,
|
||||
//Test
|
||||
},
|
||||
computed: mapState([
|
||||
|
@ -1,31 +1,14 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<div class="vue-component" style="display: none;">
|
||||
<h3>{{ $t('course.title') }}</h3>
|
||||
<dl>
|
||||
<dt>{{ $t('course.id') }}</dt>
|
||||
<dd>{{ accompanyingCourse.id }}</dd>
|
||||
|
||||
<dt>{{ $t('course.status') }}</dt>
|
||||
<dd>
|
||||
<div v-if="accompanyingCourse.step !== 'DRAFT'"
|
||||
class="badge badge-pill badge-primary">
|
||||
{{ $t('course.step.active') }}</div>
|
||||
<div v-else class="badge badge-pill badge-secondary">
|
||||
{{ $t('course.step.draft') }}</div>
|
||||
</dd>
|
||||
|
||||
<dt>{{ $t('course.closing_date') }}</dt>
|
||||
<dd v-if="accompanyingCourse.closingDate">{{ $d(accompanyingCourse.closingDate.datetime, 'short') }}</dd>
|
||||
|
||||
<dt>{{ $t('course.closing_motive') }}</dt>
|
||||
<dd v-if="accompanyingCourse.closingMotive">{{ accompanyingCourse.closingMotive.name.fr }}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<teleport to="#header-accompanying_course-name .grid-4">
|
||||
<toggle-flags
|
||||
v-bind:emergency="accompanyingCourse.emergency"
|
||||
v-bind:confidential="accompanyingCourse.confidential">
|
||||
</toggle-flags>
|
||||
<toggle-flags></toggle-flags>
|
||||
</teleport>
|
||||
|
||||
<teleport to="#header-accompanying_course-name .grid-3">
|
||||
@ -39,7 +22,6 @@
|
||||
</p>
|
||||
</teleport>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
@ -24,7 +24,11 @@
|
||||
ckeditor="ckeditor"
|
||||
v-model="content">
|
||||
</textarea>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button type="submit" class="sc-button bt-save">{{ $t('action.save') }}</button>
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
@ -0,0 +1,51 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h3>
|
||||
{{ $t('confirm.title') }}
|
||||
<span v-if="accompanyingCourse.step !== 'DRAFT'"
|
||||
class="badge badge-pill badge-primary">
|
||||
{{ $t('course.step.active') }}
|
||||
</span>
|
||||
<span v-else class="badge badge-pill badge-secondary">
|
||||
{{ $t('course.step.draft') }}
|
||||
</span>
|
||||
</h3>
|
||||
|
||||
<p v-if="accompanyingCourse.step === 'DRAFT'">
|
||||
{{ $t('confirm.text_draft') }}
|
||||
</p>
|
||||
|
||||
<dl v-if="accompanyingCourse.closingDate">
|
||||
<dt>{{ $t('course.closing_date') }}</dt>
|
||||
<dd>{{ $d(accompanyingCourse.closingDate.datetime, 'short') }}</dd>
|
||||
|
||||
<dt>{{ $t('course.closing_motive') }}</dt>
|
||||
<dd v-if="accompanyingCourse.closingMotive">{{ accompanyingCourse.closingMotive.name.fr }}</dd>
|
||||
</dl>
|
||||
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button class="sc-button bt-save"
|
||||
@click="confirmCourse">
|
||||
{{ $t('confirm.ok') }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "Confirm",
|
||||
computed: {
|
||||
accompanyingCourse() {
|
||||
return this.$store.state.accompanyingCourse
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
confirmCourse() {
|
||||
console.log('confirmCourse');
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,11 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h3>{{ $t('referrer.title') }}</h3>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "Referrer",
|
||||
}
|
||||
</script>
|
@ -0,0 +1,11 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h3>{{ $t('social_issue.title') }}</h3>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "SocialIssue",
|
||||
}
|
||||
</script>
|
@ -1,5 +1,12 @@
|
||||
<template>
|
||||
<p style="text-align: right;">
|
||||
|
||||
<a @click="toggleIntensity" class="flag-toggle">
|
||||
{{ $t('course.occasional') }}
|
||||
<i class="fa" :class="{ 'fa-toggle-on': isRegular, 'fa-toggle-off': !isRegular }"></i>
|
||||
{{ $t('course.regular') }}
|
||||
</a>
|
||||
|
||||
<button class="badge badge-pill"
|
||||
:class="{ 'badge-primary': isEmergency, 'badge-secondary': !isEmergency }"
|
||||
@click="toggleEmergency">
|
||||
@ -15,10 +22,18 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex';
|
||||
export default {
|
||||
name: "ToggleFlags",
|
||||
props: ['emergency', 'confidential'],
|
||||
computed: {
|
||||
...mapState({
|
||||
intensity: state => state.accompanyingCourse.intensity,
|
||||
emergency: state => state.accompanyingCourse.emergency,
|
||||
confidential: state => state.accompanyingCourse.confidential,
|
||||
}),
|
||||
isRegular() {
|
||||
return (this.intensity === 'regular')? true : false;
|
||||
},
|
||||
isEmergency() {
|
||||
return (this.emergency) ? true : false;
|
||||
},
|
||||
@ -27,6 +42,21 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toggleIntensity() {
|
||||
let value;
|
||||
switch (this.intensity) {
|
||||
case "occasional":
|
||||
value = "regular";
|
||||
break;
|
||||
case "regular":
|
||||
value = "occasional";
|
||||
break;
|
||||
default:
|
||||
//temporaire (modif backend)
|
||||
value = "occasional";
|
||||
}
|
||||
this.$store.dispatch('toggleIntensity', value);
|
||||
},
|
||||
toggleEmergency() {
|
||||
this.$store.dispatch('toggleEmergency', (!this.isEmergency));
|
||||
},
|
||||
|
@ -21,6 +21,8 @@ const appMessages = {
|
||||
by: "par ",
|
||||
emergency: "urgent",
|
||||
confidential: "confidentiel",
|
||||
regular: "régulier",
|
||||
occasional: "ponctuel"
|
||||
},
|
||||
persons_associated: {
|
||||
title: "Usagers concernés",
|
||||
@ -48,6 +50,12 @@ const appMessages = {
|
||||
address: "Adresse",
|
||||
location: "Localité",
|
||||
},
|
||||
social_issue: {
|
||||
title: "Problématiques sociales",
|
||||
},
|
||||
referrer: {
|
||||
title: "Référent",
|
||||
},
|
||||
resources: {
|
||||
title: "Interlocuteurs privilégiés",
|
||||
counter: "Pas d'interlocuteur | 1 interlocuteur | {count} interlocuteurs",
|
||||
@ -58,7 +66,13 @@ const appMessages = {
|
||||
comment: {
|
||||
title: "Ajout d'une note",
|
||||
content: "Rédigez une première note..."
|
||||
}
|
||||
},
|
||||
confirm: {
|
||||
title: "Confirmation",
|
||||
text_draft: "Le parcours est actuellement au statut de brouillon. En validant cette étape, vous lui donnez le statut actif.",
|
||||
ok: "Activer le parcours"
|
||||
},
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -62,6 +62,9 @@ let initPromise = getAccompanyingCourse(id)
|
||||
//console.log('### mutation: addResource', resource);
|
||||
state.accompanyingCourse.resources.push(resource);
|
||||
},
|
||||
toggleIntensity(state, value) {
|
||||
state.accompanyingCourse.intensity = value;
|
||||
},
|
||||
toggleEmergency(state, value) {
|
||||
//console.log('### mutation: toggleEmergency');
|
||||
state.accompanyingCourse.emergency = value;
|
||||
@ -136,6 +139,14 @@ let initPromise = getAccompanyingCourse(id)
|
||||
resolve();
|
||||
})).catch((error) => { commit('catchError', error) });
|
||||
},
|
||||
toggleIntensity({ commit }, payload) {
|
||||
console.log(payload);
|
||||
patchAccompanyingCourse(id, { type: "accompanying_period", intensity: payload })
|
||||
.then(course => new Promise((resolve, reject) => {
|
||||
commit('toggleIntensity', course.intensity);
|
||||
resolve();
|
||||
})).catch((error) => { commit('catchError', error) });
|
||||
},
|
||||
toggleEmergency({ commit }, payload) {
|
||||
patchAccompanyingCourse(id, { type: "accompanying_period", emergency: payload })
|
||||
.then(course => new Promise((resolve, reject) => {
|
||||
|
@ -22,8 +22,8 @@
|
||||
|
||||
<div class="grid-3">
|
||||
<p style="text-align: right;">
|
||||
<i>ouvert le 11 avril 2019</i><br>
|
||||
par <b>Soline Maillet | SIPAS</b>
|
||||
<i>ouvert le {{ accompanyingCourse.openingDate|format_date('short') }}</i><br>
|
||||
par <b>{{ accompanyingCourse.user.usernameCanonical }}</b>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user