mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-14 06:14:23 +00:00
Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles
This commit is contained in:
commit
3ceb3d4b2b
@ -10,6 +10,14 @@
|
|||||||
</persons-bloc>
|
</persons-bloc>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div v-if="getContext === 'accompanyingCourse' && filterSuggestedPersons.length > 0">
|
||||||
|
<ul>
|
||||||
|
<li v-for="p in filterSuggestedPersons" @click="addNewPerson(p)">
|
||||||
|
{{ p.text }}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
<add-persons
|
<add-persons
|
||||||
buttonTitle="activity.add_persons"
|
buttonTitle="activity.add_persons"
|
||||||
modalTitle="activity.add_persons"
|
modalTitle="activity.add_persons"
|
||||||
@ -23,7 +31,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapState } from 'vuex';
|
import { mapState, mapGetters } from 'vuex';
|
||||||
import AddPersons from 'ChillPersonAssets/vuejs/_components/AddPersons.vue';
|
import AddPersons from 'ChillPersonAssets/vuejs/_components/AddPersons.vue';
|
||||||
import PersonsBloc from './ConcernedGroups/PersonsBloc.vue';
|
import PersonsBloc from './ConcernedGroups/PersonsBloc.vue';
|
||||||
|
|
||||||
@ -79,6 +87,9 @@ export default {
|
|||||||
users: state => state.activity.users,
|
users: state => state.activity.users,
|
||||||
accompanyingCourse: state => state.activity.accompanyingPeriod
|
accompanyingCourse: state => state.activity.accompanyingPeriod
|
||||||
}),
|
}),
|
||||||
|
...mapGetters([
|
||||||
|
'filterSuggestedPersons'
|
||||||
|
]),
|
||||||
getContext() {
|
getContext() {
|
||||||
return (this.accompanyingCourse) ? "accompanyingCourse" : "person";
|
return (this.accompanyingCourse) ? "accompanyingCourse" : "person";
|
||||||
},
|
},
|
||||||
@ -161,7 +172,11 @@ export default {
|
|||||||
this.$refs.addPersons.resetSearch(); // to cast child method
|
this.$refs.addPersons.resetSearch(); // to cast child method
|
||||||
modal.showModal = false;
|
modal.showModal = false;
|
||||||
this.setPersonsInBloc();
|
this.setPersonsInBloc();
|
||||||
}
|
},
|
||||||
|
addNewPerson(person) {
|
||||||
|
this.$store.dispatch('addPersonsInvolved', { result: person, type: 'person' });
|
||||||
|
this.setPersonsInBloc();
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -25,8 +25,18 @@ const store = createStore({
|
|||||||
socialIssuesOther: [],
|
socialIssuesOther: [],
|
||||||
socialActionsList: [],
|
socialActionsList: [],
|
||||||
},
|
},
|
||||||
|
getters: {
|
||||||
|
filterSuggestedPersons(state) {
|
||||||
|
if (typeof(state.activity.accompanyingPeriod) === 'undefined') {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
let existingPersonIds = state.activity.persons.map(p => p.id);
|
||||||
|
return state.activity.accompanyingPeriod.participations.filter(p => p.endDate === null)
|
||||||
|
.map(p => p.person)
|
||||||
|
.filter(p => !existingPersonIds.includes(p.id))
|
||||||
|
}
|
||||||
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
|
|
||||||
// SocialIssueAcc
|
// SocialIssueAcc
|
||||||
addIssueInList(state, issue) {
|
addIssueInList(state, issue) {
|
||||||
//console.log('add issue list', issue.id);
|
//console.log('add issue list', issue.id);
|
||||||
|
@ -116,6 +116,7 @@
|
|||||||
class="btn btn-show" title="{{ 'See accompanying period'|trans }}">{# {{ 'See this period'|trans }} #}</a>
|
class="btn btn-show" title="{{ 'See accompanying period'|trans }}">{# {{ 'See this period'|trans }} #}</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<!-- if new accompanying course, this is not necessary
|
||||||
{% if person is defined %}
|
{% if person is defined %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ path('chill_person_accompanying_period_update', {'person_id' : person.id, 'period_id' : accompanying_period.id } ) }}"
|
<a href="{{ path('chill_person_accompanying_period_update', {'person_id' : person.id, 'period_id' : accompanying_period.id } ) }}"
|
||||||
@ -142,6 +143,7 @@
|
|||||||
{% elseif household is defined %}
|
{% elseif household is defined %}
|
||||||
{# TODO buttons specific for household ? #}
|
{# TODO buttons specific for household ? #}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
-->
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -18,8 +18,8 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="dropdown">
|
<li class="dropdown">
|
||||||
<a class="btn btn-create change-icon dropdown-toggle"
|
<a class="btn btn-create change-icon"
|
||||||
href="#" role="button" id="newAccompanyingPeriod" data-bs-toggle="dropdown" aria-expanded="false">
|
href="{{ path ('chill_person_accompanying_course_new', {'person_id' : [ person.id ] } ) }}" role="button" id="newAccompanyingPeriod">
|
||||||
{{ 'Create an accompanying period'|trans }}
|
{{ 'Create an accompanying period'|trans }}
|
||||||
</a>
|
</a>
|
||||||
<ul class="dropdown-menu" aria-labelledby="newAccompanyingPeriod">
|
<ul class="dropdown-menu" aria-labelledby="newAccompanyingPeriod">
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{% macro button_person(person) %}
|
{% macro button_person(person) %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ path('chill_person_accompanying_course_new') }}"
|
<a href="{{ path('chill_person_accompanying_course_new', { 'person_id': [ person.id ]}) }}"
|
||||||
class="btn btn-sm btn-create change-icon" title="{{ 'Create an accompanying period'|trans }}"><i class="fa fa-random"></i></a>
|
class="btn btn-sm btn-create change-icon" title="{{ 'Create an accompanying period'|trans }}"><i class="fa fa-random"></i></a>
|
||||||
</li>
|
</li>
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
@ -186,48 +186,6 @@ This view should receive those arguments:
|
|||||||
<figure class="person-details">
|
<figure class="person-details">
|
||||||
<h2 class="chill-blue"><i class="fa fa-envelope-o"></i> {{ 'Contact information'|trans }}</h2>
|
<h2 class="chill-blue"><i class="fa fa-envelope-o"></i> {{ 'Contact information'|trans }}</h2>
|
||||||
|
|
||||||
{%- if chill_person.fields.address == 'visible' -%}
|
|
||||||
<dl>
|
|
||||||
<dt>{{ 'Address'|trans }}</dt>
|
|
||||||
<dd>
|
|
||||||
{%- if person.lastAddress is not empty -%}
|
|
||||||
{{ person.lastAddress|chill_entity_render_box({
|
|
||||||
'render': 'bloc',
|
|
||||||
'multiline': true,
|
|
||||||
'extended_infos': true,
|
|
||||||
'has_no_address': true
|
|
||||||
}) }}
|
|
||||||
|
|
||||||
<ul class="list-inline text-right mt-2">
|
|
||||||
<li class="list-inline-item">
|
|
||||||
{# include vue_address component #}
|
|
||||||
{% include '@ChillPerson/Address/_insert_vue_address.html.twig' with {
|
|
||||||
mode: 'edit',
|
|
||||||
address_id: person.lastAddress.id,
|
|
||||||
backUrl: path('chill_person_view', { 'person_id': person.id }),
|
|
||||||
modalTitle: 'Edit address', buttonText: 'Edit address',
|
|
||||||
buttonSize: 'btn-sm',
|
|
||||||
buttonDisplayText: false
|
|
||||||
} %}
|
|
||||||
</li>
|
|
||||||
<li class="list-inline-item">
|
|
||||||
<a class="btn btn-secondary btn-sm" title="{{ "Addresses history"|trans }}"
|
|
||||||
href="{{ path('chill_person_address_list', { 'person_id': person.id } ) }}">
|
|
||||||
<i class="fa fa-list fa-fw"></i>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
{%- else -%}
|
|
||||||
<span class="chill-no-data-statement">{{ 'No address given'|trans }}</span>
|
|
||||||
<a href="{{ path('chill_person_address_new', { 'person_id' : person.id } ) }}" class="">
|
|
||||||
{{ 'Add an address'|trans }}
|
|
||||||
</a>
|
|
||||||
{%- endif -%}
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
{%- endif -%}
|
|
||||||
|
|
||||||
{%- if chill_person.fields.email == 'visible' -%}
|
{%- if chill_person.fields.email == 'visible' -%}
|
||||||
<dl>
|
<dl>
|
||||||
<dt>{{ 'Email'|trans }} :</dt>
|
<dt>{{ 'Email'|trans }} :</dt>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user