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;
|
color: grey;
|
||||||
margin-right: 1em;
|
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>
|
<accompanying-course></accompanying-course>
|
||||||
<persons-associated></persons-associated>
|
<persons-associated></persons-associated>
|
||||||
<requestor></requestor>
|
<requestor></requestor>
|
||||||
|
<social-issue></social-issue>
|
||||||
|
<referrer></referrer>
|
||||||
<resources></resources>
|
<resources></resources>
|
||||||
<comment></comment>
|
<comment></comment>
|
||||||
|
<confirm></confirm>
|
||||||
<!--test></test-->
|
<!--test></test-->
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -13,8 +16,11 @@ import { mapState } from 'vuex'
|
|||||||
import AccompanyingCourse from './components/AccompanyingCourse.vue';
|
import AccompanyingCourse from './components/AccompanyingCourse.vue';
|
||||||
import PersonsAssociated from './components/PersonsAssociated.vue';
|
import PersonsAssociated from './components/PersonsAssociated.vue';
|
||||||
import Requestor from './components/Requestor.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 Resources from './components/Resources.vue';
|
||||||
import Comment from './components/Comment.vue';
|
import Comment from './components/Comment.vue';
|
||||||
|
import Confirm from './components/Confirm.vue';
|
||||||
//import Test from './components/Test.vue';
|
//import Test from './components/Test.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -23,8 +29,11 @@ export default {
|
|||||||
AccompanyingCourse,
|
AccompanyingCourse,
|
||||||
PersonsAssociated,
|
PersonsAssociated,
|
||||||
Requestor,
|
Requestor,
|
||||||
|
SocialIssue,
|
||||||
|
Referrer,
|
||||||
Resources,
|
Resources,
|
||||||
Comment,
|
Comment,
|
||||||
|
Confirm,
|
||||||
//Test
|
//Test
|
||||||
},
|
},
|
||||||
computed: mapState([
|
computed: mapState([
|
||||||
|
@ -1,45 +1,27 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="vue-component">
|
<div class="vue-component" style="display: none;">
|
||||||
<h3>{{ $t('course.title') }}</h3>
|
<h3>{{ $t('course.title') }}</h3>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>{{ $t('course.id') }}</dt>
|
<dt>{{ $t('course.id') }}</dt>
|
||||||
<dd>{{ accompanyingCourse.id }}</dd>
|
<dd>{{ accompanyingCourse.id }}</dd>
|
||||||
|
</dl>
|
||||||
<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>
|
|
||||||
|
|
||||||
<teleport to="#header-accompanying_course-name .grid-4">
|
|
||||||
<toggle-flags
|
|
||||||
v-bind:emergency="accompanyingCourse.emergency"
|
|
||||||
v-bind:confidential="accompanyingCourse.confidential">
|
|
||||||
</toggle-flags>
|
|
||||||
</teleport>
|
|
||||||
|
|
||||||
<teleport to="#header-accompanying_course-name .grid-3">
|
|
||||||
<p style="text-align: right;">
|
|
||||||
<span v-if="accompanyingCourse.openingDate">
|
|
||||||
<i>{{ $t('course.open_at') }}{{ $d(accompanyingCourse.openingDate.datetime, 'text') }}</i>
|
|
||||||
</span><br>
|
|
||||||
<span v-if="accompanyingCourse.user">
|
|
||||||
{{ $t('course.by') }}<b>{{ accompanyingCourse.user.username }}</b>
|
|
||||||
</span>
|
|
||||||
</p>
|
|
||||||
</teleport>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<teleport to="#header-accompanying_course-name .grid-4">
|
||||||
|
<toggle-flags></toggle-flags>
|
||||||
|
</teleport>
|
||||||
|
|
||||||
|
<teleport to="#header-accompanying_course-name .grid-3">
|
||||||
|
<p style="text-align: right;">
|
||||||
|
<span v-if="accompanyingCourse.openingDate">
|
||||||
|
<i>{{ $t('course.open_at') }}{{ $d(accompanyingCourse.openingDate.datetime, 'text') }}</i>
|
||||||
|
</span><br>
|
||||||
|
<span v-if="accompanyingCourse.user">
|
||||||
|
{{ $t('course.by') }}<b>{{ accompanyingCourse.user.username }}</b>
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
|
</teleport>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -24,7 +24,11 @@
|
|||||||
ckeditor="ckeditor"
|
ckeditor="ckeditor"
|
||||||
v-model="content">
|
v-model="content">
|
||||||
</textarea>
|
</textarea>
|
||||||
<button type="submit" class="sc-button bt-save">{{ $t('action.save') }}</button>
|
<ul class="record_actions">
|
||||||
|
<li>
|
||||||
|
<button type="submit" class="sc-button bt-save">{{ $t('action.save') }}</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</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>
|
<template>
|
||||||
<p style="text-align: right;">
|
<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"
|
<button class="badge badge-pill"
|
||||||
:class="{ 'badge-primary': isEmergency, 'badge-secondary': !isEmergency }"
|
:class="{ 'badge-primary': isEmergency, 'badge-secondary': !isEmergency }"
|
||||||
@click="toggleEmergency">
|
@click="toggleEmergency">
|
||||||
@ -15,10 +22,18 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { mapState } from 'vuex';
|
||||||
export default {
|
export default {
|
||||||
name: "ToggleFlags",
|
name: "ToggleFlags",
|
||||||
props: ['emergency', 'confidential'],
|
|
||||||
computed: {
|
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() {
|
isEmergency() {
|
||||||
return (this.emergency) ? true : false;
|
return (this.emergency) ? true : false;
|
||||||
},
|
},
|
||||||
@ -27,6 +42,21 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
toggleEmergency() {
|
||||||
this.$store.dispatch('toggleEmergency', (!this.isEmergency));
|
this.$store.dispatch('toggleEmergency', (!this.isEmergency));
|
||||||
},
|
},
|
||||||
|
@ -21,6 +21,8 @@ const appMessages = {
|
|||||||
by: "par ",
|
by: "par ",
|
||||||
emergency: "urgent",
|
emergency: "urgent",
|
||||||
confidential: "confidentiel",
|
confidential: "confidentiel",
|
||||||
|
regular: "régulier",
|
||||||
|
occasional: "ponctuel"
|
||||||
},
|
},
|
||||||
persons_associated: {
|
persons_associated: {
|
||||||
title: "Usagers concernés",
|
title: "Usagers concernés",
|
||||||
@ -48,6 +50,12 @@ const appMessages = {
|
|||||||
address: "Adresse",
|
address: "Adresse",
|
||||||
location: "Localité",
|
location: "Localité",
|
||||||
},
|
},
|
||||||
|
social_issue: {
|
||||||
|
title: "Problématiques sociales",
|
||||||
|
},
|
||||||
|
referrer: {
|
||||||
|
title: "Référent",
|
||||||
|
},
|
||||||
resources: {
|
resources: {
|
||||||
title: "Interlocuteurs privilégiés",
|
title: "Interlocuteurs privilégiés",
|
||||||
counter: "Pas d'interlocuteur | 1 interlocuteur | {count} interlocuteurs",
|
counter: "Pas d'interlocuteur | 1 interlocuteur | {count} interlocuteurs",
|
||||||
@ -58,7 +66,13 @@ const appMessages = {
|
|||||||
comment: {
|
comment: {
|
||||||
title: "Ajout d'une note",
|
title: "Ajout d'une note",
|
||||||
content: "Rédigez une première 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);
|
//console.log('### mutation: addResource', resource);
|
||||||
state.accompanyingCourse.resources.push(resource);
|
state.accompanyingCourse.resources.push(resource);
|
||||||
},
|
},
|
||||||
|
toggleIntensity(state, value) {
|
||||||
|
state.accompanyingCourse.intensity = value;
|
||||||
|
},
|
||||||
toggleEmergency(state, value) {
|
toggleEmergency(state, value) {
|
||||||
//console.log('### mutation: toggleEmergency');
|
//console.log('### mutation: toggleEmergency');
|
||||||
state.accompanyingCourse.emergency = value;
|
state.accompanyingCourse.emergency = value;
|
||||||
@ -136,6 +139,14 @@ let initPromise = getAccompanyingCourse(id)
|
|||||||
resolve();
|
resolve();
|
||||||
})).catch((error) => { commit('catchError', error) });
|
})).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) {
|
toggleEmergency({ commit }, payload) {
|
||||||
patchAccompanyingCourse(id, { type: "accompanying_period", emergency: payload })
|
patchAccompanyingCourse(id, { type: "accompanying_period", emergency: payload })
|
||||||
.then(course => new Promise((resolve, reject) => {
|
.then(course => new Promise((resolve, reject) => {
|
||||||
|
@ -22,8 +22,8 @@
|
|||||||
|
|
||||||
<div class="grid-3">
|
<div class="grid-3">
|
||||||
<p style="text-align: right;">
|
<p style="text-align: right;">
|
||||||
<i>ouvert le 11 avril 2019</i><br>
|
<i>ouvert le {{ accompanyingCourse.openingDate|format_date('short') }}</i><br>
|
||||||
par <b>Soline Maillet | SIPAS</b>
|
par <b>{{ accompanyingCourse.user.usernameCanonical }}</b>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user