person: add obele sign for dead persons

This commit is contained in:
juminet 2022-01-19 11:23:51 +00:00 committed by Julien Fastré
parent 532a751509
commit 256dab3739
15 changed files with 34 additions and 14 deletions

View File

@ -11,7 +11,7 @@ and this project adheres to
## Unreleased ## Unreleased
<!-- write down unreleased development here --> <!-- write down unreleased development here -->
* vuejs: add dead information on all on-the-fly person render boxes, in vis graph and other templates (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/271)
* [thirdparty] fix bug in 3rd party view: types was replaced by thirdPartyTypes * [thirdparty] fix bug in 3rd party view: types was replaced by thirdPartyTypes
* [main] location form type: fix unmapped address field (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/246) * [main] location form type: fix unmapped address field (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/246)
* [activity] fix wrong import of js assets for adding and viewing documents in activity (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/83 & https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/176) * [activity] fix wrong import of js assets for adding and viewing documents in activity (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/83 & https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/176)

View File

@ -8,6 +8,7 @@
action: 'show', displayBadge: true, action: 'show', displayBadge: true,
targetEntity: { name: type, id: entity.id }, targetEntity: { name: type, id: entity.id },
buttonText: entity|chill_entity_render_string, buttonText: entity|chill_entity_render_string,
isDead: entity.deathdate is not null,
parent: parent parent: parent
} %} } %}
{% endmacro %} {% endmacro %}

View File

@ -5,6 +5,7 @@
:action="context.action" :action="context.action"
:buttonText="options.buttonText" :buttonText="options.buttonText"
:displayBadge="options.displayBadge === 'true'" :displayBadge="options.displayBadge === 'true'"
:isDead="options.isDead"
:parent="options.parent" :parent="options.parent"
@saveFormOnTheFly="saveFormOnTheFly"> @saveFormOnTheFly="saveFormOnTheFly">
</on-the-fly> </on-the-fly>

View File

@ -2,14 +2,14 @@
<a v-if="isDisplayBadge" @click="openModal"> <a v-if="isDisplayBadge" @click="openModal">
<span class="chill-entity" :class="badgeType"> <span class="chill-entity" :class="badgeType">
{{ buttonText }} {{ buttonText }}<span v-if="isDead"> ()</span>
</span> </span>
</a> </a>
<a v-else class="btn btn-sm" target="_blank" <a v-else class="btn btn-sm" target="_blank"
:class="classAction" :class="classAction"
:title="$t(titleAction)" :title="$t(titleAction)"
@click="openModal"> @click="openModal">
{{ buttonText }} {{ buttonText }}<span v-if="isDead"> ()</span>
</a> </a>
<teleport to="body"> <teleport to="body">
@ -90,7 +90,7 @@ export default {
OnTheFlyThirdparty, OnTheFlyThirdparty,
OnTheFlyCreate OnTheFlyCreate
}, },
props: ['type', 'id', 'action', 'buttonText', 'displayBadge', 'parent', 'canCloseModal'], props: ['type', 'id', 'action', 'buttonText', 'displayBadge', 'isDead', 'parent', 'canCloseModal'],
emits: ['saveFormOnTheFly'], emits: ['saveFormOnTheFly'],
data() { data() {
return { return {

View File

@ -22,6 +22,7 @@ containers.forEach((container) => {
options: { options: {
buttonText: container.dataset.buttonText || null, buttonText: container.dataset.buttonText || null,
displayBadge: container.dataset.displayBadge || false, displayBadge: container.dataset.displayBadge || false,
isDead: container.dataset.isDead || false,
parent: container.dataset.parent ? JSON.parse(container.dataset.parent) : null, parent: container.dataset.parent ? JSON.parse(container.dataset.parent) : null,
} }
} }

View File

@ -11,6 +11,7 @@
* buttonText string * buttonText string
* displayBadge boolean (default: false) replace button by badge, need to define buttonText for content * displayBadge boolean (default: false) replace button by badge, need to define buttonText for content
* parent object (optional) pass parent context of the targetEntity (used for course resource comment) * parent object (optional) pass parent context of the targetEntity (used for course resource comment)
* isDead boolean (default: false) is the person dead
#} #}
<span class="onthefly-container" <span class="onthefly-container"
@ -28,6 +29,10 @@
data-button-text="{{ buttonText|e('html_attr') }}" data-button-text="{{ buttonText|e('html_attr') }}"
{% endif %} {% endif %}
{% if isDead is defined and isDead == 1 %}
data-is-dead="true"
{% endif %}
{% if displayBadge is defined and displayBadge == 1 %} {% if displayBadge is defined and displayBadge == 1 %}
data-display-badge="true" data-display-badge="true"
{% endif %} {% endif %}

View File

@ -130,7 +130,7 @@ const store = createStore({
person.group = person.type person.group = person.type
person._id = person.id person._id = person.id
person.id = `person_${person.id}` person.id = `person_${person.id}`
person.label = `*${person.text}*\n_${getGender(person.gender)}${age}_${debug}` person.label = `*${person.text}${person.deathdate ? ' (‡)' : ''}*\n_${getGender(person.gender)}${age}_${debug}`
person.folded = false person.folded = false
// folded is used for missing persons // folded is used for missing persons
if (options.folded) { if (options.folded) {

View File

@ -127,6 +127,7 @@
<i class="fa fa-stack-1x">T</i> <i class="fa fa-stack-1x">T</i>
</span> </span>
{{ person.text }} {{ person.text }}
<span v-if="person.deathdate" class="deathdate"> ()</span>
</a> </a>
<span v-else> <span v-else>
<span v-if="options.isHolder" class="fa-stack fa-holder" :title="$t('renderbox.holder')"> <span v-if="options.isHolder" class="fa-stack fa-holder" :title="$t('renderbox.holder')">
@ -134,6 +135,7 @@
<i class="fa fa-stack-1x">T</i> <i class="fa fa-stack-1x">T</i>
</span> </span>
{{ person.text }} {{ person.text }}
<span v-if="person.deathdate" class="deathdate"> ()</span>
</span> </span>
<slot name="post-badge"></slot> <slot name="post-badge"></slot>
</span> </span>

View File

@ -3,7 +3,8 @@
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
action: 'show', displayBadge: true, action: 'show', displayBadge: true,
targetEntity: { name: type, id: entity.id }, targetEntity: { name: type, id: entity.id },
buttonText: entity|chill_entity_render_string buttonText: entity|chill_entity_render_string,
isDead: entity.deathdate is not null
} %} } %}
{% endmacro %} {% endmacro %}

View File

@ -9,6 +9,7 @@
action: 'show', displayBadge: true, action: 'show', displayBadge: true,
targetEntity: { name: type, id: entity.id }, targetEntity: { name: type, id: entity.id },
buttonText: entity|chill_entity_render_string, buttonText: entity|chill_entity_render_string,
isDead: entity.deathdate is not null,
parent: parent parent: parent
} %} } %}
{% endmacro %} {% endmacro %}

View File

@ -69,7 +69,8 @@
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
action: 'show', displayBadge: true, action: 'show', displayBadge: true,
targetEntity: { name: 'person', id: p.id }, targetEntity: { name: 'person', id: p.id },
buttonText: p|chill_entity_render_string buttonText: p|chill_entity_render_string,
isDead: entity.deathdate is not null
} %} } %}
</span> </span>
{% endfor %} {% endfor %}

View File

@ -65,7 +65,8 @@
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
action: 'show', displayBadge: true, action: 'show', displayBadge: true,
targetEntity: { name: 'person', id: period.requestorPerson.id }, targetEntity: { name: 'person', id: period.requestorPerson.id },
buttonText: period.requestorPerson|chill_entity_render_string buttonText: period.requestorPerson|chill_entity_render_string,
isDead: period.requestorPerson.deathdate is not null
} %} } %}
</span> </span>
{% endif %} {% endif %}
@ -90,7 +91,8 @@
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
action: 'show', displayBadge: true, action: 'show', displayBadge: true,
targetEntity: { name: 'person', id: p.person.id }, targetEntity: { name: 'person', id: p.person.id },
buttonText: p.person|chill_entity_render_string buttonText: p.person|chill_entity_render_string,
isDead: p.person.deathdate is not null
} %} } %}
</span> </span>
{% endfor %} {% endfor %}

View File

@ -59,7 +59,8 @@
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
action: 'show', displayBadge: true, action: 'show', displayBadge: true,
targetEntity: { name: 'person', id: m.person.id }, targetEntity: { name: 'person', id: m.person.id },
buttonText: m.person|chill_entity_render_string buttonText: m.person|chill_entity_render_string,
isDead: m.person.deathdate is not null
} %} } %}
{%- endfor -%} {%- endfor -%}
{% endif %} {% endif %}

View File

@ -154,7 +154,8 @@
targetEntity: { name: 'person', id: part.person.id }, targetEntity: { name: 'person', id: part.person.id },
action: 'show', action: 'show',
displayBadge: true, displayBadge: true,
buttonText: part.person|chill_entity_render_string buttonText: part.person|chill_entity_render_string,
isDead: part.person.deathdate is not null
} %} } %}
{% else %} {% else %}
{% set participating = true %} {% set participating = true %}
@ -190,7 +191,8 @@
targetEntity: { name: 'person', id: acp.requestorPerson.id }, targetEntity: { name: 'person', id: acp.requestorPerson.id },
action: 'show', action: 'show',
displayBadge: true, displayBadge: true,
buttonText: acp.requestorPerson|chill_entity_render_string buttonText: acp.requestorPerson|chill_entity_render_string,
isDead: acp.requestorPerson.deathdate is not null
} %} } %}
{% endif %} {% endif %}
</div> </div>

View File

@ -22,7 +22,8 @@
targetEntity: { name: 'person', id: task.person.id }, targetEntity: { name: 'person', id: task.person.id },
action: 'show', action: 'show',
displayBadge: true, displayBadge: true,
buttonText: task.person|chill_entity_render_string buttonText: task.person|chill_entity_render_string,
isDead: task.person.deathdate is not null
} %} } %}
</span> </span>
{% elseif task.course is not null %} {% elseif task.course is not null %}
@ -36,7 +37,8 @@
targetEntity: { name: 'person', id: part.person.id }, targetEntity: { name: 'person', id: part.person.id },
action: 'show', action: 'show',
displayBadge: true, displayBadge: true,
buttonText: part.person|chill_entity_render_string buttonText: part.person|chill_entity_render_string,
isDead: part.person.deathdate is not null
} %} } %}
{% endfor %} {% endfor %}