mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 23:23:51 +00:00
Merge branch 'ameliorations_composants_vue' of gitlab.com:Chill-Projet/chill-bundles into ameliorations_composants_vue
This commit is contained in:
@@ -5,7 +5,8 @@
|
||||
</teleport>
|
||||
|
||||
<teleport to="#header-accompanying_course-name #banner-status">
|
||||
<span v-if="accompanyingCourse.step === 'DRAFT'" class="d-md-block">
|
||||
<span v-if="accompanyingCourse.step === 'DRAFT'"
|
||||
class="text-md-end d-md-block">
|
||||
<span class="badge bg-secondary">
|
||||
{{ $t('course.step.draft') }}
|
||||
</span>
|
||||
|
@@ -0,0 +1,68 @@
|
||||
<template>
|
||||
<li>
|
||||
<button class="btn btn-sm btn-secondary"
|
||||
@click="modal.showModal = true"
|
||||
:title="$t('courselocation.assign_course_address')">
|
||||
<i class="fa fa-map-marker"></i>
|
||||
</button>
|
||||
</li>
|
||||
|
||||
<teleport to="body">
|
||||
<modal v-if="modal.showModal" :modalDialogClass="modal.modalDialogClass" @close="modal.showModal = false">
|
||||
<template v-slot:header>
|
||||
<h2 class="modal-title">{{ $t('courselocation.sure') }}</h2>
|
||||
</template>
|
||||
<template v-slot:body>
|
||||
<show-address :address="person.current_household_address"></show-address>
|
||||
<p>{{ $t('courselocation.sure_description') }}</p>
|
||||
</template>
|
||||
<template v-slot:footer>
|
||||
<button class="btn btn-danger" @click="assignAddress">
|
||||
{{ $t('courselocation.ok') }}
|
||||
</button>
|
||||
</template>
|
||||
</modal>
|
||||
</teleport>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from "vuex";
|
||||
import Modal from 'ChillMainAssets/vuejs/_components/Modal';
|
||||
import ShowAddress from "ChillMainAssets/vuejs/Address/components/ShowAddress";
|
||||
|
||||
export default {
|
||||
name: "ButtonLocation",
|
||||
components: {
|
||||
ShowAddress,
|
||||
Modal,
|
||||
},
|
||||
props: ['person'],
|
||||
data() {
|
||||
return {
|
||||
modal: {
|
||||
showModal: false,
|
||||
modalDialogClass: "modal-dialog-centered modal-md"
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
context: state => state.addressContext
|
||||
}),
|
||||
},
|
||||
methods: {
|
||||
assignAddress() {
|
||||
//console.log('assignAddress id', this.person.current_household_address);
|
||||
let payload = {
|
||||
entity: this.context.entity.type,
|
||||
entityId: this.context.entity.id,
|
||||
locationStatusTo: 'person',
|
||||
personId: this.person.id
|
||||
};
|
||||
this.$store.dispatch('updateLocation', payload);
|
||||
window.location.assign('#section-20');
|
||||
this.modal.showModal = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@@ -1,57 +1,65 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h2><a name="section-60"></a>{{ $t('comment.title') }}</h2>
|
||||
|
||||
<h2><a name="section-80"></a>{{ $t('comment.title') }}</h2>
|
||||
|
||||
<!--div class="error flash_message" v-if="errors.length > 0">
|
||||
{{ errors[0] }}
|
||||
TODO fix errors flashbag for app component
|
||||
</div-->
|
||||
|
||||
|
||||
<div>
|
||||
<form @submit.prevent="submitform">
|
||||
|
||||
<label for="content">{{ $t('comment.label') }}</label>
|
||||
|
||||
<div v-if="initialComment">
|
||||
{{ $t('comment.created_by', [
|
||||
initialComment.creator.text,
|
||||
$d(initialComment.createdAt.datetime, 'long')
|
||||
]) }}
|
||||
</div>
|
||||
|
||||
<textarea
|
||||
name="content"
|
||||
|
||||
<label class="col-form-label" for="content">{{ $t('comment.label') }}</label>
|
||||
|
||||
<ckeditor
|
||||
name="content"
|
||||
v-bind:placeholder="$t('comment.content')"
|
||||
rows="8"
|
||||
cols="80"
|
||||
ckeditor="ckeditor"
|
||||
v-model="content">
|
||||
</textarea>
|
||||
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button type="submit" class="btn btn-save">{{ $t('action.save') }}</button>
|
||||
</li>
|
||||
<li v-if="initialComment !== null">
|
||||
<a class="btn btn-delete"
|
||||
@click="removeComment">
|
||||
{{ $t('action.delete') }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
:editor="editor"
|
||||
v-model="content"
|
||||
tag-name="textarea">
|
||||
</ckeditor>
|
||||
|
||||
<div v-if="initialComment" class="metadata">
|
||||
{{ $t('comment.created_by', [
|
||||
initialComment.creator.text,
|
||||
$d(initialComment.createdAt.datetime, 'long')
|
||||
]) }}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button type="submit" class="btn btn-save">{{ $t('action.save') }}</button>
|
||||
</li>
|
||||
<li v-if="initialComment !== null">
|
||||
<a class="btn btn-delete"
|
||||
@click="removeComment">
|
||||
{{ $t('action.delete') }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CKEditor from '@ckeditor/ckeditor5-vue';
|
||||
import ClassicEditor from "ChillMainAssets/module/ckeditor5";
|
||||
|
||||
export default {
|
||||
name: "Comment",
|
||||
components: {
|
||||
ckeditor: CKEditor.component,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formdata: {
|
||||
editor: ClassicEditor,
|
||||
formdata: {
|
||||
type: "accompanying_period_comment",
|
||||
content: ''
|
||||
}
|
||||
@@ -66,7 +74,7 @@ export default {
|
||||
this.formdata.content = value;
|
||||
},
|
||||
get() {
|
||||
return (this.initialComment)? this.initialComment.content : null;
|
||||
return (this.initialComment)? this.initialComment.content : {};
|
||||
}
|
||||
},
|
||||
errors() {
|
||||
@@ -75,12 +83,12 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
submitform() {
|
||||
console.log('submit');
|
||||
//console.log('submit');
|
||||
this.$store.dispatch('postFirstComment', this.formdata);
|
||||
},
|
||||
removeComment() {
|
||||
console.log('remove');
|
||||
this.$store.dispatch('postFirstComment', null);
|
||||
//console.log('remove');
|
||||
this.$store.dispatch('postFirstComment', {});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -88,12 +96,11 @@ export default {
|
||||
* TODO
|
||||
* - [x] delete button in ul record_actions, but not in form
|
||||
* - [ ] display updatedAt => initialComment fetch PATCH content changes MUST NOT change object id !!
|
||||
* - [ ] ckeditor integration
|
||||
*/
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
div.vue-component > div {
|
||||
//margin: 1em;
|
||||
}
|
||||
<style lang="scss">
|
||||
div.ck-editor.ck-reset {
|
||||
margin: 0.6em 0;
|
||||
}
|
||||
</style>
|
||||
|
@@ -1,26 +1,45 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h2><a name="section-70"></a>
|
||||
<h2><a name="section-90"></a>
|
||||
{{ $t('confirm.title') }}
|
||||
</h2>
|
||||
|
||||
<div>
|
||||
<p>
|
||||
{{ $t('confirm.text_draft') }}
|
||||
<span class="badge bg-secondary">{{ $t('course.step.draft') }}</span>
|
||||
</p>
|
||||
<p>
|
||||
{{ $t('confirm.text_active') }}
|
||||
<span class="badge bg-primary">{{ $t('course.step.active') }}</span>
|
||||
</p>
|
||||
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button class="btn btn-save" @click="modal.showModal = true">
|
||||
{{ $t('confirm.ok') }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
<p v-html="$t('confirm.text_draft', [$t('course.step.draft')])"></p>
|
||||
|
||||
<div v-if="!isValidToBeConfirmed">
|
||||
<div class="alert alert-warning">
|
||||
{{ $t('confirm.alert_validation') }}
|
||||
<ul class="mt-2">
|
||||
<li v-for="k in validationKeys">
|
||||
{{ $t(notValidMessages[k].msg) }}
|
||||
<a :href="notValidMessages[k].anchor">
|
||||
<i class="fa fa-level-up fa-fw"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button class="btn btn-save" disabled>
|
||||
{{ $t('confirm.ok') }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div v-else>
|
||||
<p v-html="$t('confirm.text_active', [$t('course.step.active')])"></p>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button
|
||||
class="btn btn-save"
|
||||
@click="modal.showModal = true">
|
||||
{{ $t('confirm.ok') }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<teleport to="body">
|
||||
@@ -43,6 +62,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapGetters, mapState} from "vuex";
|
||||
import Modal from 'ChillMainAssets/vuejs/_components/Modal';
|
||||
|
||||
export default {
|
||||
@@ -55,26 +75,41 @@ export default {
|
||||
modal: {
|
||||
showModal: false,
|
||||
modalDialogClass: "modal-dialog-centered modal-md"
|
||||
},
|
||||
notValidMessages: {
|
||||
participation: {
|
||||
msg: 'confirm.participation_not_valid',
|
||||
anchor: '#section-10'
|
||||
},
|
||||
location: {
|
||||
msg: 'confirm.location_not_valid',
|
||||
anchor: '#section-20' //
|
||||
},
|
||||
socialIssue: {
|
||||
msg: 'confirm.socialIssue_not_valid',
|
||||
anchor: '#section-50'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
accompanyingCourse() {
|
||||
return this.$store.state.accompanyingCourse
|
||||
}
|
||||
...mapState([
|
||||
'accompanyingCourse'
|
||||
]),
|
||||
...mapGetters([
|
||||
'isParticipationValid',
|
||||
'isSocialIssueValid',
|
||||
'isLocationValid',
|
||||
'validationKeys',
|
||||
'isValidToBeConfirmed'
|
||||
])
|
||||
},
|
||||
methods: {
|
||||
confirmCourse() {
|
||||
console.log('@@ CLICK confirmCourse');
|
||||
//console.log('@@ CLICK confirmCourse');
|
||||
this.$store.dispatch('confirmAccompanyingCourse');
|
||||
console.log('confirm last');
|
||||
//console.log('confirm last');
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
div.vue-component > div {
|
||||
//margin: 1em;
|
||||
}
|
||||
</style>
|
||||
|
@@ -0,0 +1,158 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h2><a name="section-20"></a>
|
||||
{{ $t('courselocation.title') }}
|
||||
</h2>
|
||||
|
||||
<!-- {# include vue_address component #} -->
|
||||
<div v-for="error in displayErrors" class="alert alert-danger my-2">
|
||||
{{ error }}
|
||||
</div>
|
||||
|
||||
<div v-if="hasNoLocation">
|
||||
<label class="chill-no-data-statement">
|
||||
{{ $t('courselocation.no_address') }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div v-if="isPersonLocation">
|
||||
<label class="col-form-label">
|
||||
{{ $t('courselocation.person_locator', [ accompanyingCourse.personLocation.text ]) }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<show-address
|
||||
v-if="accompanyingCourse.location"
|
||||
:address="accompanyingCourse.location">
|
||||
</show-address>
|
||||
|
||||
<div v-if="isTemporaryAddress" class="alert alert-warning">
|
||||
<p>{{ $t('courselocation.temporary_address_must_be_changed') }}</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<add-address
|
||||
v-if="!isPersonLocation"
|
||||
:context="context"
|
||||
:key="addAddress.type"
|
||||
:options="addAddress.options"
|
||||
:result="addAddress.result"
|
||||
@submitAddress="submitTemporaryAddress"
|
||||
ref="addAddress">
|
||||
</add-address>
|
||||
</li>
|
||||
<li v-if="isPersonLocation">
|
||||
<button
|
||||
class="btn btn-remove"
|
||||
@click="removeAddress"
|
||||
:title="$t('courselocation.remove_button')">
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from "vuex";
|
||||
import AddAddress from 'ChillMainAssets/vuejs/Address/components/AddAddress.vue';
|
||||
import ShowAddress from 'ChillMainAssets/vuejs/Address/components/ShowAddress.vue';
|
||||
|
||||
export default {
|
||||
name: "CourseLocation",
|
||||
components: {
|
||||
AddAddress,
|
||||
ShowAddress
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
addAddress: {
|
||||
type: 'accompanying_course_location',
|
||||
options: {
|
||||
/// Options override default.
|
||||
/// null value take default component value
|
||||
button: {
|
||||
text: {
|
||||
create: 'courselocation.add_temporary_address',
|
||||
edit: 'courselocation.edit_temporary_address'
|
||||
}
|
||||
},
|
||||
title: {
|
||||
create: 'courselocation.add_temporary_address',
|
||||
edit: 'courselocation.edit_temporary_address'
|
||||
},
|
||||
/// Display each step in page or Modal
|
||||
bindModal: {
|
||||
//step1: false, step2: false
|
||||
},
|
||||
hideDateFrom: true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
accompanyingCourse: state => state.accompanyingCourse,
|
||||
context: state => state.addressContext
|
||||
}),
|
||||
isTemporaryAddress() {
|
||||
return this.accompanyingCourse.locationStatus === 'address';
|
||||
},
|
||||
isPersonLocation() {
|
||||
return this.accompanyingCourse.locationStatus === 'person';
|
||||
},
|
||||
hasNoLocation() {
|
||||
return this.accompanyingCourse.locationStatus === 'none';
|
||||
},
|
||||
isContextEdit() {
|
||||
return this.context.edit;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
initAddressContext() {
|
||||
let context = {
|
||||
entity: {
|
||||
type: this.accompanyingCourse.type,
|
||||
id: this.accompanyingCourse.id
|
||||
},
|
||||
edit: false,
|
||||
addressId: null
|
||||
}
|
||||
if (this.accompanyingCourse.location) {
|
||||
context['edit'] = true;
|
||||
context['addressId'] = this.accompanyingCourse.location.address_id
|
||||
}
|
||||
this.$store.commit('setAddressContext', context);
|
||||
},
|
||||
removeAddress() {
|
||||
//console.log('remove address');
|
||||
let payload = {
|
||||
entity: this.context.entity.type,
|
||||
entityId: this.context.entity.id,
|
||||
locationStatusTo: 'none'
|
||||
};
|
||||
this.$store.dispatch('updateLocation', payload);
|
||||
},
|
||||
displayErrors() {
|
||||
return this.$refs.addAddress.errorMsg;
|
||||
},
|
||||
submitTemporaryAddress() {
|
||||
//console.log('@@@ click on Submit Temporary Address Button');
|
||||
let payload = this.$refs.addAddress.submitNewAddress();
|
||||
payload['locationStatusTo'] = 'address'; // <== temporary, not none, not person
|
||||
this.$store.dispatch('updateLocation', payload);
|
||||
this.$store.commit('setEditContextTrue');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initAddressContext();
|
||||
|
||||
//console.log('ac.locationStatus', this.accompanyingCourse.locationStatus);
|
||||
//console.log('ac.location (temporary location)', this.accompanyingCourse.location);
|
||||
//console.log('ac.personLocation', this.accompanyingCourse.personLocation);
|
||||
}
|
||||
}
|
||||
</script>
|
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h2><a name="section-15"></a>{{ $t('origin.title') }}</h2>
|
||||
|
||||
<div class="my-4">
|
||||
<h2><a name="section-30"></a>{{ $t('origin.title') }}</h2>
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="selectOrigin">
|
||||
{{ $t('origin.label') }}
|
||||
</label>
|
||||
|
@@ -1,41 +1,26 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h2><a name="section-10"></a>{{ $t('persons_associated.title')}}</h2>
|
||||
|
||||
<div>
|
||||
|
||||
<div v-if="participations.length > 0">
|
||||
<label class="col-form-label">{{ $tc('persons_associated.counter', counter) }}</label>
|
||||
</div>
|
||||
<div class="flex-table mb-3">
|
||||
<participation-item
|
||||
v-for="participation in participations"
|
||||
v-bind:participation="participation"
|
||||
v-bind:key="participation.id"
|
||||
@remove="removeParticipation"
|
||||
@close="closeParticipation">
|
||||
</participation-item>
|
||||
</div>
|
||||
<!-- <table class="table table-bordered table-striped border-dark align-middle" v-if="participations.length > 0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="chill-orange">{{ $t('persons_associated.name') }}</th>
|
||||
<th class="chill-orange">{{ $t('persons_associated.startdate') }}</th>
|
||||
<th class="chill-orange">{{ $t('persons_associated.enddate') }}</th>
|
||||
<th class="chill-orange">{{ $t('action.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<participation-item
|
||||
v-for="participation in participations"
|
||||
v-bind:participation="participation"
|
||||
v-bind:key="participation.id"
|
||||
@remove="removeParticipation"
|
||||
@close="closeParticipation">
|
||||
</participation-item>
|
||||
</tbody>
|
||||
</table> -->
|
||||
<div v-else>
|
||||
<label class="chill-no-data-statement">{{ $tc('persons_associated.counter', counter) }}</label>
|
||||
</div>
|
||||
|
||||
<div class="flex-table mb-3">
|
||||
<participation-item
|
||||
v-for="participation in participations"
|
||||
v-bind:participation="participation"
|
||||
v-bind:key="participation.id"
|
||||
@remove="removeParticipation"
|
||||
@close="closeParticipation">
|
||||
</participation-item>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<add-persons
|
||||
<add-persons
|
||||
buttonTitle="persons_associated.add_persons"
|
||||
modalTitle="add_persons.title"
|
||||
v-bind:key="addPersons.key"
|
||||
@@ -77,15 +62,15 @@ export default {
|
||||
}),
|
||||
methods: {
|
||||
removeParticipation(item) {
|
||||
console.log('@@ CLICK remove participation: item', item);
|
||||
//console.log('@@ CLICK remove participation: item', item);
|
||||
this.$store.dispatch('removeParticipation', item);
|
||||
},
|
||||
closeParticipation(item) {
|
||||
console.log('@@ CLICK close participation: item', item);
|
||||
//console.log('@@ CLICK close participation: item', item);
|
||||
this.$store.dispatch('closeParticipation', item);
|
||||
},
|
||||
addNewPersons({ selected, modal }) {
|
||||
console.log('@@@ CLICK button addNewPersons', selected);
|
||||
//console.log('@@@ CLICK button addNewPersons', selected);
|
||||
selected.forEach(function(item) {
|
||||
this.$store.dispatch('addParticipation', item);
|
||||
}, this
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
|
||||
<person-render-box
|
||||
:options="{
|
||||
addInfo : true,
|
||||
@@ -10,9 +9,8 @@
|
||||
addAge : false,
|
||||
hLevel : 1
|
||||
}"
|
||||
:person="participation.person"
|
||||
>
|
||||
|
||||
:person="participation.person">
|
||||
|
||||
<template v-slot:record-actions>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
@@ -31,46 +29,70 @@
|
||||
</li>
|
||||
<!-- <li>
|
||||
<button class="btn btn-delete"
|
||||
:title="$t('action.delete')"
|
||||
:title="$t('action.delete')"
|
||||
@click.prevent="$emit('remove', participation)">
|
||||
</button>
|
||||
</li> -->
|
||||
<li>
|
||||
<button v-if="!participation.endDate"
|
||||
class="btn btn-remove"
|
||||
v-bind:title="$t('action.remove')"
|
||||
class="btn btn-sm btn-remove"
|
||||
v-bind:title="$t('action.remove')"
|
||||
@click.prevent="$emit('close', participation)">
|
||||
</button>
|
||||
<button v-else class="btn btn-remove disabled"></button>
|
||||
<button v-else class="btn btn-sm btn-remove disabled"></button>
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
|
||||
</template>
|
||||
</person-render-box>
|
||||
|
||||
<!-- dates of participation
|
||||
<tr>
|
||||
<td><span v-if="participation.startDate">
|
||||
{{ $d(participation.startDate.datetime, 'short') }}</span>
|
||||
</td>
|
||||
<td><span v-if="participation.endDate">
|
||||
{{ $d(participation.endDate.datetime, 'short') }}</span>
|
||||
</td>
|
||||
</tr>
|
||||
-->
|
||||
</template>
|
||||
|
||||
|
||||
<!-- <tr>
|
||||
<td><span v-if="participation.startDate">
|
||||
{{ $d(participation.startDate.datetime, 'short') }}</span>
|
||||
</td>
|
||||
<td><span v-if="participation.endDate">
|
||||
{{ $d(participation.endDate.datetime, 'short') }}</span>
|
||||
</td>
|
||||
</tr> -->
|
||||
|
||||
<script>
|
||||
import OnTheFly from 'ChillMainAssets/vuejs/_components/OnTheFly.vue';
|
||||
import PersonRenderBox from '../../../_components/Entity/PersonRenderBox.vue';
|
||||
import ButtonLocation from '../ButtonLocation.vue';
|
||||
import PersonRenderBox from 'ChillPersonAssets/vuejs/_components/Entity/PersonRenderBox.vue';
|
||||
|
||||
export default {
|
||||
name: 'ParticipationItem',
|
||||
components: {
|
||||
OnTheFly,
|
||||
ButtonLocation,
|
||||
PersonRenderBox
|
||||
},
|
||||
props: ['participation'],
|
||||
emits: ['remove', 'close'],
|
||||
data() {
|
||||
return {
|
||||
PersonRenderBox: {
|
||||
participation: 'participation',
|
||||
options: {
|
||||
addInfo: false,
|
||||
addId: true,
|
||||
addAge: false,
|
||||
hLevel: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
hasCurrentHouseholdAddress() {
|
||||
if ( !this.participation.endDate
|
||||
&& this.participation.person.current_household_address !== null ) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h2><a name="section-40"></a>{{ $t('referrer.title') }}</h2>
|
||||
<h2><a name="section-60"></a>{{ $t('referrer.title') }}</h2>
|
||||
|
||||
<div class="my-4">
|
||||
<div>
|
||||
<label class="col-form-label" for="selectReferrer">
|
||||
{{ $t('referrer.label') }}
|
||||
</label>
|
||||
@@ -18,10 +18,12 @@
|
||||
v-bind:options="options"
|
||||
@select="updateReferrer">
|
||||
</VueMultiselect>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button
|
||||
<button
|
||||
class="btn btn-create"
|
||||
type="button"
|
||||
name="button"
|
||||
@@ -30,8 +32,8 @@
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@@ -1,12 +1,12 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
|
||||
<h2><a name="section-20"></a>{{ $t('requestor.title') }}</h2>
|
||||
|
||||
|
||||
<h2><a name="section-40"></a>{{ $t('requestor.title') }}</h2>
|
||||
|
||||
<div v-if="accompanyingCourse.requestor" class="flex-table">
|
||||
|
||||
|
||||
<label>
|
||||
<input type="checkbox" v-model="isAnonymous" class="me-2" /><!-- :value="value" -->
|
||||
<input type="checkbox" v-model="isAnonymous" class="me-2" />
|
||||
{{ $t('requestor.is_anonymous') }}
|
||||
</label>
|
||||
|
||||
@@ -30,31 +30,32 @@
|
||||
addInfo: true
|
||||
}"
|
||||
></person-render-box>
|
||||
|
||||
<!-- </div> -->
|
||||
<!-- <h4>
|
||||
<span class="badge rounded-pill bg-secondary">{{ accompanyingCourse.requestor.type }}</span>
|
||||
{{ accompanyingCourse.requestor.text }}
|
||||
</h4>
|
||||
|
||||
</h4>
|
||||
|
||||
<dl class="content-bloc" v-if="accompanyingCourse.requestor.type === 'person'">
|
||||
|
||||
<dt>{{ $t('requestor.birthdate') }}</dt>
|
||||
|
||||
<dt>{{ $t('requestor.birthdate') }}</dt>
|
||||
<dd>{{ $d(accompanyingCourse.requestor.birthdate.datetime, 'short') }}</dd>
|
||||
|
||||
<dt>{{ $t('requestor.center') }}</dt>
|
||||
|
||||
<dt>{{ $t('requestor.center') }}</dt>
|
||||
<dd>{{ accompanyingCourse.requestor.center.name }}</dd>
|
||||
|
||||
<dt>{{ $t('requestor.phonenumber') }}</dt>
|
||||
|
||||
<dt>{{ $t('requestor.phonenumber') }}</dt>
|
||||
<dd>{{ accompanyingCourse.requestor.phonenumber }}</dd>
|
||||
<dt>{{ $t('requestor.mobilenumber') }}</dt>
|
||||
<dt>{{ $t('requestor.mobilenumber') }}</dt>
|
||||
<dd>{{ accompanyingCourse.requestor.mobilenumber }}</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
<dl class="content-bloc" v-if="accompanyingCourse.requestor.type === 'thirdparty'">
|
||||
|
||||
|
||||
<dt>{{ $t('requestor.address') }}</dt>
|
||||
<dd>{{ accompanyingCourse.requestor.address.text }}</dd>
|
||||
|
||||
|
||||
<dt>{{ $t('requestor.location') }}</dt>
|
||||
<dd>{{ accompanyingCourse.requestor.address.postcode.name }}</dd>
|
||||
</dl>
|
||||
@@ -79,17 +80,17 @@
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button class="btn btn-remove"
|
||||
:title="$t('action.remove')"
|
||||
:title="$t('action.remove')"
|
||||
@click="removeRequestor">
|
||||
{{ $t('action.remove') }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<label>{{ $t('requestor.counter') }}</label>
|
||||
</div>
|
||||
|
||||
<label class="chill-no-data-statement">{{ $t('requestor.counter') }}</label>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<add-persons v-if="accompanyingCourse.requestor === null"
|
||||
buttonTitle="requestor.add_requestor"
|
||||
@@ -163,7 +164,7 @@ export default {
|
||||
|
||||
div.flex-table {
|
||||
margin: 1em 0 0 !important;
|
||||
& > label,
|
||||
& > label,
|
||||
& > ul.record_actions {
|
||||
margin: 1em 3em 0 !important;
|
||||
}
|
||||
|
@@ -1,21 +1,15 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
|
||||
<h2><a name="section-50"></a>{{ $t('resources.title')}}</h2>
|
||||
|
||||
<div>
|
||||
|
||||
<h2><a name="section-70"></a>{{ $t('resources.title')}}</h2>
|
||||
|
||||
<div v-if="resources.length > 0">
|
||||
<label class="col-form-label">{{ $tc('resources.counter', counter) }}</label>
|
||||
</div>
|
||||
|
||||
<table class="table table-bordered table-striped border-dark align-middle" v-if="resources.length > 0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="chill-orange">{{ $t('resources.text') }}</th>
|
||||
<th class="chill-orange">{{ $t('resources.description') }}</th>
|
||||
<th class="chill-orange">{{ $t('action.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<div v-else>
|
||||
<label class="chill-no-data-statement">{{ $tc('resources.counter', counter) }}</label>
|
||||
</div>
|
||||
|
||||
<div class="flex-table mb-3">
|
||||
<resource-item
|
||||
v-for="resource in resources"
|
||||
@@ -25,7 +19,7 @@
|
||||
</resource-item>
|
||||
</div>
|
||||
<div>
|
||||
<add-persons
|
||||
<add-persons
|
||||
buttonTitle="resources.add_resources"
|
||||
modalTitle="resources.add_resources"
|
||||
v-bind:key="addPersons.key"
|
||||
@@ -67,11 +61,11 @@ export default {
|
||||
}),
|
||||
methods: {
|
||||
removeResource(item) {
|
||||
console.log('@@ CLICK remove resource: item', item);
|
||||
//console.log('@@ CLICK remove resource: item', item);
|
||||
this.$store.dispatch('removeResource', item);
|
||||
},
|
||||
addNewPersons({ selected, modal }) {
|
||||
console.log('@@@ CLICK button addNewPersons', selected);
|
||||
//console.log('@@@ CLICK button addNewPersons', selected);
|
||||
selected.forEach(function(item) {
|
||||
this.$store.dispatch('addResource', item);
|
||||
}, this
|
||||
|
@@ -1,24 +1,4 @@
|
||||
<template>
|
||||
<!-- <tr> -->
|
||||
|
||||
<!-- <td>
|
||||
<span class="badge rounded-pill bg-secondary"
|
||||
v-bind:title="resource.resource.id">
|
||||
<span v-if="resource.resource.type === 'person'" >{{ $t('item.type_person') }}</span>
|
||||
<span v-if="resource.resource.type === 'thirdparty'" >{{ $t('item.type_thirdparty') }}</span>
|
||||
</span>
|
||||
{{ resource.resource.text }}
|
||||
</td>
|
||||
|
||||
<td v-if="resource.resource.type === 'person'">
|
||||
{{ $tc('person.born') }}{{ $d(resource.resource.birthdate.datetime, 'short') }}
|
||||
</td>
|
||||
<td v-else-if="resource.resource.type === 'thirdparty'">
|
||||
{{ resource.resource.address.text }}<br>
|
||||
{{ resource.resource.address.postcode.name }}
|
||||
</td>
|
||||
|
||||
<td> -->
|
||||
<third-party-render-box
|
||||
:options="{
|
||||
addLink : false,
|
||||
@@ -46,32 +26,38 @@
|
||||
</li>
|
||||
<li>
|
||||
<button
|
||||
class="btn btn-remove"
|
||||
v-bind:title="$t('action.remove')"
|
||||
class="btn btn-sm btn-remove"
|
||||
v-bind:title="$t('action.remove')"
|
||||
@click.prevent="$emit('remove', resource)">
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
|
||||
|
||||
</third-party-render-box>
|
||||
|
||||
<!-- </td>
|
||||
</tr> -->
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import OnTheFly from 'ChillMainAssets/vuejs/_components/OnTheFly.vue';
|
||||
import ThirdPartyRenderBox from '../../../../../../../ChillThirdPartyBundle/Resources/public/vuejs/_components/ThirdPartyRenderbox.vue'
|
||||
import ButtonLocation from '../ButtonLocation.vue';
|
||||
import ThirdPartyRenderBox from 'ChillThirdPartyAssets/vuejs/_components/Entity/ThirdPartyRenderBox.vue'
|
||||
|
||||
export default {
|
||||
name: 'ResourceItem',
|
||||
components: {
|
||||
OnTheFly,
|
||||
ButtonLocation,
|
||||
ThirdPartyRenderBox
|
||||
},
|
||||
props: ['resource'],
|
||||
emits: ['remove']
|
||||
emits: ['remove'],
|
||||
computed: {
|
||||
hasCurrentHouseholdAddress() {
|
||||
if ( this.resource.resource.type === 'person'
|
||||
&& this.resource.resource.current_household_address !== null ) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@@ -1,15 +1,15 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h2><a name="section-30"></a>{{ $t('social_issue.title') }}</h2>
|
||||
|
||||
<h2><a name="section-50"></a>{{ $t('social_issue.title') }}</h2>
|
||||
|
||||
<div class="my-4">
|
||||
<!--label for="field">{{ $t('social_issue.label') }}</label
|
||||
-->
|
||||
<VueMultiselect
|
||||
name="field"
|
||||
:close-on-select="false"
|
||||
:allow-empty="true"
|
||||
:show-labels="false"
|
||||
:allow-empty="true"
|
||||
:show-labels="false"
|
||||
track-by="id"
|
||||
label="text"
|
||||
:multiple="true"
|
||||
@@ -20,7 +20,7 @@
|
||||
:options="options">
|
||||
</VueMultiselect>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -51,7 +51,7 @@ export default {
|
||||
//console.log('get socialIssues', response.results);
|
||||
this.options = response.results;
|
||||
resolve();
|
||||
})).catch(error => this.$store.commit('catchError', error));
|
||||
})).catch(error => this.$store.commit('catchError', error));
|
||||
},
|
||||
updateSocialIssues(value) {
|
||||
this.$store.dispatch('updateSocialIssues', this.transformValue(value));
|
||||
@@ -60,7 +60,7 @@ export default {
|
||||
let stored = this.value;
|
||||
let added = updated.filter(x => stored.indexOf(x) === -1).shift();
|
||||
let removed = stored.filter(x => updated.indexOf(x) === -1).shift();
|
||||
let method = (typeof removed === 'undefined') ? 'POST' : 'DELETE';
|
||||
let method = (typeof removed === 'undefined') ? 'POST' : 'DELETE';
|
||||
let changed = (typeof removed === 'undefined') ? added : removed;
|
||||
let body = { type: "social_issue", id: changed.id };
|
||||
//console.log('body', body);
|
||||
|
@@ -1,15 +1,15 @@
|
||||
<template>
|
||||
<a
|
||||
v-if="item.key <= 5"
|
||||
:href="item.name"
|
||||
<a
|
||||
v-if="item.key <= 7"
|
||||
:href="item.name"
|
||||
:class="{ 'active': isActive }"
|
||||
>
|
||||
<i class="fa fa-fw fa-square"></i>
|
||||
<span>{{ item.key }}</span>
|
||||
</a>
|
||||
<a
|
||||
<a
|
||||
v-else-if="step === 'DRAFT'"
|
||||
:href="item.name"
|
||||
:href="item.name"
|
||||
:class="{ 'active': isActive }"
|
||||
>
|
||||
<i class="fa fa-fw fa-square"></i>
|
||||
|
Reference in New Issue
Block a user