mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
Merge branch '327_pinned_comment' into issue321_layout_improvements_actionForm
This commit is contained in:
@@ -20,10 +20,10 @@
|
||||
tag-name="textarea">
|
||||
</ckeditor>
|
||||
|
||||
<div v-if="initialComment" class="metadata">
|
||||
<div v-if="pinnedComment" class="metadata">
|
||||
{{ $t('comment.created_by', [
|
||||
initialComment.creator.text,
|
||||
$d(initialComment.createdAt.datetime, 'long')
|
||||
pinnedComment.creator.text,
|
||||
$d(pinnedComment.createdAt.datetime, 'long')
|
||||
]) }}
|
||||
</div>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<li>
|
||||
<button type="submit" class="btn btn-save">{{ $t('action.save') }}</button>
|
||||
</li>
|
||||
<li v-if="initialComment !== null">
|
||||
<li v-if="pinnedComment !== null">
|
||||
<a class="btn btn-delete"
|
||||
@click="removeComment">
|
||||
{{ $t('action.delete') }}
|
||||
@@ -66,15 +66,15 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
initialComment() {
|
||||
return this.$store.state.accompanyingCourse.initialComment;
|
||||
pinnedComment() {
|
||||
return this.$store.state.accompanyingCourse.pinnedComment;
|
||||
},
|
||||
content: {
|
||||
set(value) {
|
||||
this.formdata.content = value;
|
||||
},
|
||||
get() {
|
||||
return (this.initialComment)? this.initialComment.content : {};
|
||||
return (this.pinnedComment)? this.pinnedComment.content : {};
|
||||
}
|
||||
},
|
||||
errors() {
|
||||
@@ -107,7 +107,7 @@ 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 !!
|
||||
* - [ ] display updatedAt => pinnedComment fetch PATCH content changes MUST NOT change object id !!
|
||||
*/
|
||||
</script>
|
||||
|
||||
|
@@ -132,10 +132,6 @@ const appMessages = {
|
||||
sure_description: "Une fois le changement confirmé, il ne sera plus possible de le remettre à l'état de brouillon !",
|
||||
ok: "Confirmer le parcours"
|
||||
},
|
||||
action: {
|
||||
choose_other_social_issue: "Veuillez choisir un autre problématique",
|
||||
cancel: "Annuler",
|
||||
},
|
||||
// catch errors
|
||||
'Error while updating AccompanyingPeriod Course.': "Erreur du serveur lors de la mise à jour du parcours d'accompagnement.",
|
||||
'Error while retriving AccompanyingPeriod Course.': "Erreur du serveur lors du chargement du parcours d'accompagnement.",
|
||||
|
@@ -163,7 +163,7 @@ let initPromise = Promise.all([scopesPromise, accompanyingCoursePromise])
|
||||
},
|
||||
postFirstComment(state, comment) {
|
||||
//console.log('### mutation: postFirstComment', comment);
|
||||
state.accompanyingCourse.initialComment = comment;
|
||||
state.accompanyingCourse.pinnedComment = comment;
|
||||
},
|
||||
updateSocialIssues(state, value) {
|
||||
console.log('updateSocialIssues', value);
|
||||
@@ -565,11 +565,11 @@ let initPromise = Promise.all([scopesPromise, accompanyingCoursePromise])
|
||||
},
|
||||
postFirstComment({ commit }, payload) {
|
||||
const url = `/api/1.0/person/accompanying-course/${id}.json`
|
||||
const body = { type: "accompanying_period", initialComment: payload }
|
||||
const body = { type: "accompanying_period", pinnedComment: payload }
|
||||
|
||||
return makeFetch('PATCH', url, body)
|
||||
.then((response) => {
|
||||
commit('postFirstComment', response.initialComment);
|
||||
commit('postFirstComment', response.pinnedComment);
|
||||
})
|
||||
.catch((error) => {
|
||||
commit('catchError', error);
|
||||
|
@@ -8,10 +8,10 @@
|
||||
<div id="picking">
|
||||
<p>{{ $t('pick_social_issue_linked_with_action') }}</p>
|
||||
<div v-for="si in socialIssues">
|
||||
<input type="radio" checked v-bind:value="si.id" name="socialIssue" v-model="socialIssuePicked"><span class="badge bg-chill-l-gray text-dark">{{ si.text }}</span>
|
||||
<input type="radio" v-bind:value="si.id" name="socialIssue" v-model="socialIssuePicked"><span class="badge bg-chill-l-gray text-dark">{{ si.text }}</span>
|
||||
</div>
|
||||
<div class="my-3">
|
||||
<div class="col-8">
|
||||
<div class="col-11">
|
||||
<vue-multiselect
|
||||
name="otherIssues"
|
||||
label="text"
|
||||
@@ -27,7 +27,7 @@
|
||||
:allow-empty="true"
|
||||
:show-labels="false"
|
||||
:loading="issueIsLoading"
|
||||
:placeholder="$t('action.choose_other_social_issue')"
|
||||
:placeholder="$t('choose_other_social_issue')"
|
||||
:options="socialIssuesOther"
|
||||
@select="addIssueInList">
|
||||
</vue-multiselect>
|
||||
@@ -35,7 +35,7 @@
|
||||
</div>
|
||||
<div v-if="hasSocialIssuePicked">
|
||||
<h2>{{ $t('pick_an_action') }}</h2>
|
||||
<div class="col-8">
|
||||
<div class="col-11">
|
||||
<vue-multiselect
|
||||
v-model="socialActionPicked"
|
||||
label="text"
|
||||
@@ -77,7 +77,7 @@
|
||||
<p>{{ $t('form_has_errors') }}</p>
|
||||
|
||||
<ul>
|
||||
<li v-for="e in errors">
|
||||
<li v-for="e in errors" :key="e.id">
|
||||
{{ e }}
|
||||
</li>
|
||||
</ul>
|
||||
@@ -120,10 +120,11 @@ const i18n = {
|
||||
endDate: "Date de fin",
|
||||
form_has_errors: "Le formulaire comporte des erreurs",
|
||||
pick_social_issue: "Choisir une problématique sociale",
|
||||
pick_other_social_issue: "Veuillez choisir un autre problématique",
|
||||
pick_an_action: "Choisir une action d'accompagnement",
|
||||
pick_social_issue_linked_with_action: "Indiquez la problématique sociale liée à l'action d'accompagnement",
|
||||
persons_involved: "Usagers concernés",
|
||||
|
||||
choose_other_social_issue: "Veuillez choisir un autre problématique",
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -178,12 +179,10 @@ export default {
|
||||
personsPicked: {
|
||||
get() {
|
||||
let s = this.$store.state.personsPicked.map(p => p.id);
|
||||
// console.log('persons picked', s);
|
||||
|
||||
return s;
|
||||
},
|
||||
set(v) {
|
||||
// console.log('persons picked', v);
|
||||
this.$store.commit('setPersonsPickedIds', v);
|
||||
}
|
||||
},
|
||||
@@ -226,6 +225,11 @@ export default {
|
||||
this.$store.commit('setEndDate', ISOToDate(value));
|
||||
}
|
||||
},
|
||||
setSocialIssue: {
|
||||
set() {
|
||||
this.$store.dispatch('setSocialIssue', socialIssues[socialIssues.length - 1])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -280,4 +284,4 @@ span.badge {
|
||||
grid-area: confirm;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@@ -31,7 +31,6 @@ const store = createStore({
|
||||
return null !== state.socialActionPicked;
|
||||
},
|
||||
hasSocialIssuePicked(state) {
|
||||
console.log(state.socialIssuePicked);
|
||||
return null !== state.socialIssuePicked;
|
||||
},
|
||||
isLoadingSocialActions(state) {
|
||||
@@ -74,36 +73,27 @@ const store = createStore({
|
||||
},
|
||||
mutations: {
|
||||
setSocialActionsReachables(state, actions) {
|
||||
// console.log('set social action reachables');
|
||||
// console.log(actions);
|
||||
|
||||
state.socialActionsReachables = actions;
|
||||
},
|
||||
setSocialAction(state, socialAction) {
|
||||
// console.log('socialAction', socialAction);
|
||||
state.socialActionPicked = socialAction;
|
||||
},
|
||||
setSocialIssue(state, socialIssueId) {
|
||||
// console.log('set social issue', socialIssueId);
|
||||
if (socialIssueId === null) {
|
||||
state.socialIssuePicked = null;
|
||||
} else {
|
||||
let mapped = state.socialIssues
|
||||
.find(e => e.id === socialIssueId);
|
||||
state.socialIssuePicked = mapped;
|
||||
// console.log('social issue setted', state.socialIssuePicked);
|
||||
}
|
||||
},
|
||||
addIssueInList(state, issue) {
|
||||
//console.log('add issue list', issue.id);
|
||||
state.socialIssues.push(issue);
|
||||
},
|
||||
updateIssuesOther(state, payload) {
|
||||
//console.log('update issues other');
|
||||
state.socialIssuesOther = payload;
|
||||
},
|
||||
removeIssueInOther(state, issue) {
|
||||
//console.log('remove issue other', issue.id);
|
||||
state.socialIssuesOther = state.socialIssuesOther.filter(
|
||||
(i) => i.id !== issue.id
|
||||
);
|
||||
@@ -124,12 +114,12 @@ const store = createStore({
|
||||
state.endDate = date;
|
||||
},
|
||||
setPersonsPickedIds(state, ids) {
|
||||
console.log('persons ids', ids);
|
||||
|
||||
state.personsPicked = state.personsReachables
|
||||
.filter(p => ids.includes(p.id))
|
||||
},
|
||||
addErrors(state, { errors, cancel_posting }) {
|
||||
console.log('add errors', errors);
|
||||
|
||||
state.errors = errors;
|
||||
if (cancel_posting) {
|
||||
state.isPostingWork = false;
|
||||
@@ -138,8 +128,6 @@ const store = createStore({
|
||||
},
|
||||
actions: {
|
||||
pickSocialIssue({ commit }, socialIssueId) {
|
||||
console.log('pick social issue');
|
||||
|
||||
commit('setIsLoadingSocialActions', true);
|
||||
commit('setSocialAction', null);
|
||||
commit('setSocialActionsReachables', []);
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
<ul class="record_actions">
|
||||
<li v-if="!hasHouseholdAddress && !isHouseholdForceAddress">
|
||||
<button class="btn" @click="markNoAddress">
|
||||
<button class="btn btn-misc" @click="markNoAddress">
|
||||
{{ $t('household_members_editor.household_address.mark_no_address') }}
|
||||
</button>
|
||||
</li>
|
||||
|
@@ -1,5 +1,6 @@
|
||||
|
||||
import { personMessages } from 'ChillPersonAssets/vuejs/_js/i18n'
|
||||
import { personMessages } from 'ChillPersonAssets/vuejs/_js/i18n';
|
||||
import { ontheflyMessages } from 'ChillMainAssets/vuejs/OnTheFly/i18n';
|
||||
import { addressMessages } from 'ChillMainAssets/vuejs/Address/i18n';
|
||||
|
||||
const appMessages = {
|
||||
fr: {
|
||||
@@ -84,7 +85,7 @@ const appMessages = {
|
||||
}
|
||||
};
|
||||
|
||||
Object.assign(appMessages.fr, personMessages.fr);
|
||||
Object.assign(appMessages.fr, personMessages.fr, addressMessages.fr, ontheflyMessages.fr);
|
||||
|
||||
export {
|
||||
appMessages
|
||||
|
@@ -9,6 +9,7 @@ const visMessages = {
|
||||
both: 'neutre, non binaire',
|
||||
woman: 'féminin',
|
||||
man: 'masculin',
|
||||
undefined: "genre non précisé",
|
||||
years: 'ans',
|
||||
click_to_expand: 'cliquez pour étendre',
|
||||
add_relationship_link: "Créer un lien de filiation",
|
||||
|
@@ -153,7 +153,7 @@ const getGender = (gender) => {
|
||||
case 'man':
|
||||
return visMessages.fr.visgraph.man
|
||||
default:
|
||||
throw 'gender undefined'
|
||||
return visMessages.fr.visgraph.undefined
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -38,7 +38,6 @@ const personMessages = {
|
||||
neuter: "Neutre, non binaire",
|
||||
undefined: "Non renseigné"
|
||||
}
|
||||
|
||||
},
|
||||
error_only_one_person: "Une seule personne peut être sélectionnée !"
|
||||
}
|
||||
|
@@ -0,0 +1,92 @@
|
||||
{% extends '@ChillPerson/AccompanyingCourse/layout.html.twig' %}
|
||||
|
||||
{% block title %}
|
||||
{{ 'Accompanying Course Comment list'|trans }}
|
||||
{% endblock %}
|
||||
|
||||
{% macro show_comment(comment, options) %}
|
||||
<div class="item-bloc">
|
||||
<div class="item-row">
|
||||
<div>
|
||||
{% if options.pinned is defined %}
|
||||
<i class="fa fa-flag fa-fw fa-lg" title="{{ 'pinned'|trans }}"></i>
|
||||
{% endif %}
|
||||
<a id="comment{{ comment.id }}" href="{{ '#comment' ~ comment.id }}" class="fa fa-pencil-square-o fa-fw"></a>
|
||||
{{ 'by'|trans }}<b>{{ comment.creator }}</b>{{ ', ' ~ 'on'|trans ~ ' ' ~ comment.createdAt|format_date('long') }}<br>
|
||||
<i>{{ 'Last updated on'|trans ~ ' ' ~ comment.updatedAt|format_datetime('long', 'short') }}</i>
|
||||
</div>
|
||||
<ul class="record_actions">
|
||||
{% if options.pinned is not defined %}
|
||||
<li>
|
||||
<button class="btn btn-sm btn-misc" type="button">
|
||||
<i class="fa fa-flag fa-fw"></i>
|
||||
Épingler
|
||||
</button>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li>
|
||||
<a class="btn btn-sm btn-edit" title="{{ 'Edit'|trans }}" href="{{ path('chill_person_accompanying_period_comment_list', {
|
||||
'accompanying_period_id': comment.accompanyingPeriod.id,
|
||||
'edit': comment.id
|
||||
}) ~ '#comment' ~ comment.id }}"></a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-sm btn-delete" title="{{ 'Delete'|trans }}" href=""></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="item-row separator">
|
||||
<blockquote class="chill-user-quote col">{{ comment.content|chill_markdown_to_html }}</blockquote>
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro form_comment(type, form) %}
|
||||
{% if type == 'edit' %}
|
||||
<div class="item-bloc">
|
||||
<div class="item-row row">
|
||||
{% endif %}
|
||||
{{ form_start(form) }}
|
||||
{{ form_errors(form) }}
|
||||
{{ form_widget(form.content) }}
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
{% if type == 'new' %}
|
||||
<button class="btn btn-create" type="submit">{{ 'Post a new comment'|trans }}</button>
|
||||
{% elseif type == 'edit' %}
|
||||
<button class="btn btn-save" type="submit">{{ 'Save'|trans }}</button>
|
||||
{% endif %}
|
||||
</li>
|
||||
</ul>
|
||||
{{ form_end(form) }}
|
||||
{% if type == 'edit' %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% block content %}
|
||||
<div class="accompanyingcourse-comment-list">
|
||||
<h1>{{ block('title') }}</h1>
|
||||
<div class="flex-table">
|
||||
{% if accompanyingCourse.pinnedComment %}
|
||||
{% if commentEditId == accompanyingCourse.pinnedComment.id %}
|
||||
{{ _self.form_comment('edit', edit_form) }}
|
||||
{% else %}
|
||||
{{ _self.show_comment(accompanyingCourse.pinnedComment, {'pinned': 'true'}) }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% for c in accompanyingCourse.comments %}
|
||||
{% if commentEditId == c.id %}
|
||||
{{ _self.form_comment('edit', edit_form) }}
|
||||
{% else %}
|
||||
{{ _self.show_comment(c) }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="new-comment my-5">
|
||||
<h2 class="chill-blue">{{ 'Write a new comment'|trans }}</h2>
|
||||
{{ _self.form_comment('new', form) }}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
@@ -78,6 +78,25 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if accompanyingCourse.pinnedComment is not empty %}
|
||||
<div class="col col-sm-6 col-lg-4 comment mb-4">
|
||||
<h4 class="item-key">{{ 'Pinned comment'|trans }}</h4>
|
||||
<blockquote class="chill-user-quote">
|
||||
{{ accompanyingCourse.pinnedComment.content }}
|
||||
<div class="metadata">
|
||||
{{ 'Last updated by'| trans }}
|
||||
<span class="user">
|
||||
{{ accompanyingCourse.pinnedComment.updatedBy|chill_entity_render_box }}
|
||||
</span>
|
||||
{{ 'on'|trans ~ ' ' }}
|
||||
<span class="date">
|
||||
{{ accompanyingCourse.pinnedComment.updatedAt|format_datetime("medium", "short") }}
|
||||
</span>
|
||||
</div>
|
||||
</blockquote>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if accompanyingCourse.scopes is not empty %}
|
||||
<div class="col col-sm-6 col-lg-4 scopes mb-4">
|
||||
<h4 class="item-key">{{ 'Scopes'|trans }}</h4>
|
||||
|
@@ -65,11 +65,12 @@
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
{% for p in w.persons %}
|
||||
<span class="wl-item badge-person">
|
||||
{{ p|chill_entity_render_box({
|
||||
'render': 'raw',
|
||||
'addAltNames': false
|
||||
}) }}
|
||||
<span class="wl-item">
|
||||
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
|
||||
action: 'show', displayBadge: true,
|
||||
targetEntity: { name: 'person', id: p.id },
|
||||
buttonText: p|chill_entity_render_string
|
||||
} %}
|
||||
</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
@@ -82,11 +83,12 @@
|
||||
<h3>{{ 'Thirdparty handling'|trans }}</h3>
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
<span class="wl-item badge-thirdparty">
|
||||
{{ w.handlingThierParty|chill_entity_render_box({
|
||||
'render': 'raw',
|
||||
'addAltNames': false
|
||||
}) }}
|
||||
<span class="wl-item">
|
||||
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
|
||||
action: 'show', displayBadge: true,
|
||||
targetEntity: { name: 'thirdparty', id: w.handlingThierParty.id },
|
||||
buttonText: w.handlingThierParty|chill_entity_render_string
|
||||
} %}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -153,7 +155,6 @@
|
||||
</div>
|
||||
|
||||
<div class="item-row column">
|
||||
{# SEULEMENT SI DÉTAILLÉ
|
||||
{% if w.results|length > 0 %}
|
||||
<div class="objective_results without-objectives">
|
||||
<div class="objective">
|
||||
@@ -192,7 +193,6 @@
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
#}
|
||||
</div>
|
||||
|
||||
<div class="item-row separator">
|
||||
|
@@ -43,7 +43,39 @@
|
||||
</ul>
|
||||
|
||||
<ul class="small_in_title evaluations mb-3">
|
||||
{% for e in w.accompanyingPeriodWorkEvaluations %}
|
||||
A{% for g in w.goals %}
|
||||
<li class="with-objectives">
|
||||
<span class="item-key">{{ 'accompanying_course_work.goal'|trans ~ ' : ' }}</span>
|
||||
{{ g.goal.title|localize_translatable_string }}
|
||||
{% if g.results|length > 0 %}
|
||||
<span class="item-key">{{ 'accompanying_course_work.results'|trans }}</span>
|
||||
<ul>
|
||||
{% for r in g.results %}
|
||||
<li>
|
||||
{{ r.title|localize_translatable_string }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
B{% if w.results|length > 0 %}
|
||||
<li class="without-objectives">
|
||||
<span class="item-key">{{ 'accompanying_course_work.goal'|trans }}</span>
|
||||
<p class="chill-no-data-statement">{{ 'accompanying_course_work.results without objective'|trans }}</p>
|
||||
{% if w.results %}
|
||||
<span class="item-key">{{ 'accompanying_course_work.results'|trans }}</span>
|
||||
<ul>
|
||||
{% for r in w.results %}
|
||||
<li>
|
||||
{{ r.title|localize_translatable_string }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
C{% for e in w.accompanyingPeriodWorkEvaluations %}
|
||||
<li>
|
||||
<span class="item-key">{{ 'accompanying_course_work.social_evaluation'|trans ~ ' : ' }}</span>
|
||||
{{ e.evaluation.title|localize_translatable_string }}
|
||||
@@ -55,7 +87,7 @@
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if e.endDate %}
|
||||
<li>
|
||||
<li>
|
||||
<span class="item-key">{{ 'accompanying_course_work.end_date'|trans ~ ' : ' }}</span>
|
||||
<b>{{ e.endDate|format_date('short') }}</b>
|
||||
</li>
|
||||
|
@@ -66,10 +66,22 @@
|
||||
<div class="wl-col title"><h3>{{ 'Requestor'|trans({'gender': null }) }}</h3></div>
|
||||
<div class="wl-col list">
|
||||
{% if accompanying_period.requestorPerson is not null %}
|
||||
<span class="wl-item badge-person">{{ accompanying_period.requestorPerson|chill_entity_render_string }}</span>
|
||||
<span class="wl-item">
|
||||
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
|
||||
action: 'show', displayBadge: true,
|
||||
targetEntity: { name: 'person', id: accompanying_period.requestorPerson.id },
|
||||
buttonText: accompanying_period.requestorPerson|chill_entity_render_string
|
||||
} %}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if accompanying_period.requestorThirdParty is not null %}
|
||||
<span class="wl-item badge-thirdparty">{{ accompanying_period.requestorThirdParty|chill_entity_render_string }}</span>
|
||||
<span class="wl-item">
|
||||
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
|
||||
action: 'show', displayBadge: true,
|
||||
targetEntity: { name: 'thirdparty', id: accompanying_period.requestorThirdParty.id },
|
||||
buttonText: accompanying_period.requestorThirdParty|chill_entity_render_string
|
||||
} %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
@@ -80,13 +92,12 @@
|
||||
<div class="wl-col title"><h3>{{ 'Participants'|trans }}</h3></div>
|
||||
<div class="wl-col list">
|
||||
{% for p in accompanying_period.getCurrentParticipations %}
|
||||
<span class="wl-item badge-person">
|
||||
<a href="{{ path('chill_person_accompanying_period_list', { person_id: p.person.id }) }}">
|
||||
{{ p.person|chill_entity_render_string }}
|
||||
</a>
|
||||
{# or in renderbox mode
|
||||
{{ p.person|chill_entity_render_box({'render': 'label', 'addAltNames': false, 'addLink': true, 'hLevel': 5 }) }}
|
||||
#}
|
||||
<span class="wl-item">
|
||||
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
|
||||
action: 'show', displayBadge: true,
|
||||
targetEntity: { name: 'person', id: p.person.id },
|
||||
buttonText: p.person|chill_entity_render_string
|
||||
} %}
|
||||
</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
@@ -133,7 +133,7 @@
|
||||
{% macro customButtons(member, household) %}
|
||||
<li>
|
||||
<a href="{{ chill_path_add_return_path('chill_person_household_members_editor', {'persons': [ member.person.id ], 'allow_leave_without_household': true } ) }}"
|
||||
class="btn btn-sm btn-unlink" title="{{ 'household.person.leave'|trans }}"></a>
|
||||
class="btn btn-sm btn-misc" title="{{ 'household.person.leave'|trans }}"><i class="fa fa-scissors"></i></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ chill_path_add_return_path('chill_person_household_members_editor', {'persons': [ member.person.id ], 'household': household.id} ) }}"
|
||||
@@ -146,7 +146,7 @@
|
||||
{% for m in members %}
|
||||
{% include '@ChillPerson/Household/_render_member.html.twig' with {
|
||||
'member': m,
|
||||
'customButtons': { 'after': _self.customButtons(m, household) }
|
||||
'customButtons': { 'before': _self.customButtons(m, household) }
|
||||
} %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
@@ -4,176 +4,163 @@
|
||||
|
||||
{% block title 'household.Household history for person'|trans %}
|
||||
|
||||
{% macro bloc_content(p) %}
|
||||
<div class="item-row">
|
||||
<div class="wrap-header">
|
||||
<div class="wh-row">
|
||||
<div class="wh-col">
|
||||
<h3>
|
||||
<i class="fa fa-home"></i>
|
||||
<a href="{{ chill_path_add_return_path('chill_person_household_summary',{ 'household_id': p.household.id }) }}">
|
||||
{{ 'household.Household number'|trans({'household_num': p.household.id }) }}
|
||||
</a>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="wh-col">
|
||||
Depuis le {{ p.startDate|format_date('long') }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="wh-row">
|
||||
<div class="wh-col"></div>
|
||||
{% if p.endDate %}
|
||||
<div class="wh-col">
|
||||
Jusqu'au {{ p.endDate|format_date('long') }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-row separator">
|
||||
<div class="wrap-list">
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title">
|
||||
<h3>En tant que</h3>
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
<p class="item">{{ p.position.label|localize_translatable_string }}
|
||||
{% if p.holder %}
|
||||
<span class="holder">{{ 'household.holder'|trans }}</span>
|
||||
{% endif %}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title">
|
||||
<h3>{{ 'household.Members at same time'|trans }}</h3>
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
{% set simultaneous = p.household.getMembersDuringMembership(p) %}
|
||||
{% if simultaneous|length == 0 %}
|
||||
<p class="chill-no-data-statement">
|
||||
{{ 'household.Any simultaneous members'|trans }}
|
||||
</p>
|
||||
{% else %}
|
||||
{% for m in simultaneous -%}
|
||||
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
|
||||
action: 'show', displayBadge: true,
|
||||
targetEntity: { name: 'person', id: m.person.id },
|
||||
buttonText: m.person|chill_entity_render_string
|
||||
} %}
|
||||
{%- endfor -%}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% block personcontent %}
|
||||
<div class="person-household">
|
||||
<h1>{{ 'household.Household history'|trans }}</h1>
|
||||
|
||||
<h1>{{ 'household.Household history'|trans }}</h1>
|
||||
<h2>{{ 'household.Household shared'|trans }}</h2>
|
||||
<div class="household_shared">
|
||||
<h2 class="chill-blue">{{ 'household.Household shared'|trans }}</h2>
|
||||
{% set memberships = person.getHouseholdParticipationsShareHousehold() %}
|
||||
|
||||
{% set memberships = person.getHouseholdParticipationsShareHousehold() %}
|
||||
{% if memberships|length == 0 %}
|
||||
<p class="chill-no-data-statement">{{ 'household.Never in any household'|trans }}</p>
|
||||
|
||||
{% if memberships|length == 0 %}
|
||||
<p class="chill-no-data-statement">{{ 'household.Never in any household'|trans }}</p>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a class="btn btn-misc" href="{{chill_path_add_return_path('chill_person_household_members_editor', { 'persons': [ person.id ]}) }}">
|
||||
<i class="fa fa-sign-in fa-fw"></i>
|
||||
{{ 'household.Join'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
{% else %}
|
||||
<div class="flex-table">
|
||||
{% for p in memberships %}
|
||||
<div class="item-bloc">
|
||||
|
||||
{{ _self.bloc_content(p) }}
|
||||
|
||||
<div class="item-row separator">
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ chill_path_add_return_path('chill_person_household_summary',{ 'household_id': p.household.id }) }}"
|
||||
class="btn btn-show" title="{{ 'Show'|trans }}"></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ chill_path_add_return_path('chill_person_household_member_edit', { id: p.id }) }}"
|
||||
class="btn btn-edit" title="{{ 'Edit'|trans }}"></a>
|
||||
</li>
|
||||
{% if p.isCurrent() %}
|
||||
<li>
|
||||
<a class="btn btn-misc" href="{{ chill_path_add_return_path( 'chill_person_household_members_editor', { 'persons': [ person.id ], 'allow_leave_without_household': true }) }}">
|
||||
<i class="fa fa-scissors"></i>
|
||||
{{ 'household.Leave'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{% if not person.isSharingHousehold() %}
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a class="btn btn-misc" href="{{chill_path_add_return_path('chill_person_household_members_editor', { 'persons': [ person.id ]}) }}">
|
||||
<i class="fa fa-sign-out"></i>
|
||||
<a class="btn btn-misc" href="{{ chill_path_add_return_path('chill_person_household_members_editor', { 'persons': [ person.id ]}) }}">
|
||||
<i class="fa fa-sign-in fa-fw"></i>
|
||||
{{ 'household.Join'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
{% else %}
|
||||
|
||||
<div class="household">
|
||||
<div class="household__address">
|
||||
|
||||
{% if not person.isSharingHousehold() %}
|
||||
<div class="row">
|
||||
<div class="household__address--date"></div>
|
||||
<div class="household__address--content">
|
||||
<div class="cell">
|
||||
<a class="btn btn-misc" href="{{ chill_path_add_return_path('chill_person_household_members_editor', { 'persons': [ person.id ]}) }}">
|
||||
<i class="fa fa-sign-out"></i>
|
||||
{{ 'household.Join'|trans }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% for p in memberships %}
|
||||
<div class="row">
|
||||
<div class="household__address--date">
|
||||
<div class="cell">
|
||||
<div class="pill">
|
||||
{{ p.startDate|format_date('long') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="household__address--content">
|
||||
<div class="cell">
|
||||
<i class="dot"></i>
|
||||
<div>
|
||||
<div>
|
||||
<p>
|
||||
<i class="fa fa-home"></i>
|
||||
<a href="{{ chill_path_add_return_path('chill_person_household_summary',{ 'household_id': p.household.id }) }}">
|
||||
{{ 'household.Household number'|trans({'household_num': p.household.id }) }}
|
||||
</a>
|
||||
</p>
|
||||
<p>{{ p.position.label|localize_translatable_string }} {% if p.holder %}<span class="badge bg-primary">{{ 'household.holder'|trans }}</span>{% endif %}
|
||||
</div>
|
||||
<div>
|
||||
{% set simultaneous = p.household.getMembersDuringMembership(p) %}
|
||||
{% if simultaneous|length == 0 %}
|
||||
<p class="chill-no-data-statement">
|
||||
{{ 'household.Any simultaneous members'|trans }}
|
||||
</p>
|
||||
{% else %}
|
||||
{{ 'household.Members at same time'|trans }}:
|
||||
{% for p in simultaneous -%}
|
||||
{{- p.person|chill_entity_render_box({'addLink': true }) -}}
|
||||
{%- if p.holder %} <span class="badge bg-primary">{{'household.holder'|trans }}</span> {% endif %}
|
||||
{%- if not loop.last %}, {% endif -%}
|
||||
{%- endfor -%}
|
||||
{% endif %}
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ chill_path_add_return_path('chill_person_household_member_edit', { id: p.id }) }}"
|
||||
class="btn btn-edit"></a>
|
||||
</li>
|
||||
{% if p.isCurrent() %}
|
||||
<li>
|
||||
<a class="btn btn-misc" href="{{ chill_path_add_return_path( 'chill_person_household_members_editor', { 'persons': [ person.id ], 'allow_leave_without_household': true }) }}">
|
||||
<i class="fa fa-sign-out"></i>
|
||||
{{ 'household.Leave'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<h2>{{ 'household.Household not shared'|trans }}</h2>
|
||||
{% endif %}
|
||||
|
||||
{% set memberships = person.getHouseholdParticipationsNotShareHousehold() %}
|
||||
</div>
|
||||
<div class="household_not_shared">
|
||||
{% set memberships = person.getHouseholdParticipationsNotShareHousehold() %}
|
||||
{% if memberships|length > 0 %}
|
||||
|
||||
{% if memberships|length == 0 %}
|
||||
<p class="chill-no-data-statement">{{ 'household.Never in any household'|trans }}</p>
|
||||
{% else %}
|
||||
<table class="table table-bordered border-dark">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ 'household.from'|trans }}</th>
|
||||
<th>{{ 'household.to'|trans }}</th>
|
||||
<th>{{ 'household.Household'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for p in memberships %}
|
||||
<tr>
|
||||
<td>{{ p.startDate|format_date('long') }}</td>
|
||||
<td>
|
||||
{% if p.endDate is not empty %}
|
||||
{{ p.endDate|format_date('long') }}
|
||||
{% else %}
|
||||
{{ 'household.Membership currently running'|trans }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<p>
|
||||
<i class="fa fa-home"></i>
|
||||
<a href="{{ chill_path_add_return_path('chill_person_household_summary', { 'household_id': p.household.id }) }}">
|
||||
{{ 'household.Household number'|trans({'household_num': p.household.id }) }}
|
||||
</a>
|
||||
</p>
|
||||
<p>
|
||||
{{ p.position.label|localize_translatable_string }}
|
||||
{% if p.holder %}
|
||||
<span class="badge bg-primary">{{ 'household.holder'|trans }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div>
|
||||
{% set simultaneous = p.household.getMembersDuringMembership(p) %}
|
||||
{% if simultaneous|length == 0 %}
|
||||
<p class="chill-no-data-statement">
|
||||
{{ 'household.Any simultaneous members'|trans }}
|
||||
</p>
|
||||
{% else %}
|
||||
{{ 'household.Members at same time'|trans }}:
|
||||
{% for p in simultaneous -%}
|
||||
{{- p.person|chill_entity_render_box({'addLink': true }) -}}
|
||||
{%- if p.holder %} <span class="badge bg-primary">{{'household.holder'|trans }}</span> {% endif %}
|
||||
{%- if not loop.last %}, {% endif -%}
|
||||
{%- endfor -%}
|
||||
{% endif %}
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<ul class="record_actions sticky-form-buttons">
|
||||
<li>
|
||||
<a href="{{ chill_path_add_return_path('chill_person_household_member_edit', { id: p.id }) }}"
|
||||
class="btn btn-edit">
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
<h2 class="chill-blue">{{ 'household.Household not shared'|trans }}</h2>
|
||||
|
||||
<div class="flex-table">
|
||||
{% for p in memberships %}
|
||||
<div class="item-bloc">
|
||||
|
||||
{{ _self.bloc_content(p) }}
|
||||
|
||||
<div class="item-row separator">
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ chill_path_add_return_path('chill_person_household_member_edit', { id: p.id }) }}"
|
||||
class="btn btn-edit" title="{{ 'Edit'|trans }}"></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
Reference in New Issue
Block a user