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

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

View File

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

View File

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

View File

@@ -11,6 +11,7 @@
* buttonText string
* 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)
* isDead boolean (default: false) is the person dead
#}
<span class="onthefly-container"
@@ -28,6 +29,10 @@
data-button-text="{{ buttonText|e('html_attr') }}"
{% endif %}
{% if isDead is defined and isDead == 1 %}
data-is-dead="true"
{% endif %}
{% if displayBadge is defined and displayBadge == 1 %}
data-display-badge="true"
{% endif %}