mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +00:00
residential address: show residential address or info in PersonRenderBox + add ThirdPartyText
This commit is contained in:
parent
baf9b6e1ae
commit
6e1b95aa60
@ -69,7 +69,8 @@ const messages = {
|
|||||||
},
|
},
|
||||||
holder: "Titulaire",
|
holder: "Titulaire",
|
||||||
years_old: "an | {n} an | {n} ans",
|
years_old: "an | {n} an | {n} ans",
|
||||||
|
residential_address: "Adresse de résidence",
|
||||||
|
located_at: "réside chez"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -16,6 +16,7 @@ use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable;
|
|||||||
use Chill\PersonBundle\Repository\ResidentialAddressRepository;
|
use Chill\PersonBundle\Repository\ResidentialAddressRepository;
|
||||||
use Chill\PersonBundle\Entity\Person;
|
use Chill\PersonBundle\Entity\Person;
|
||||||
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
||||||
|
use Symfony\Component\Serializer\Annotation\Groups;
|
||||||
use DateTimeImmutable;
|
use DateTimeImmutable;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
@ -28,6 +29,7 @@ class ResidentialAddress
|
|||||||
/**
|
/**
|
||||||
* @ORM\ManyToOne(targetEntity=Address::class)
|
* @ORM\ManyToOne(targetEntity=Address::class)
|
||||||
* @ORM\JoinColumn(nullable=true)
|
* @ORM\JoinColumn(nullable=true)
|
||||||
|
* @Groups({"read"})
|
||||||
*/
|
*/
|
||||||
private ?Address $address = null;
|
private ?Address $address = null;
|
||||||
|
|
||||||
@ -38,18 +40,21 @@ class ResidentialAddress
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="datetime_immutable", nullable=true)
|
* @ORM\Column(type="datetime_immutable", nullable=true)
|
||||||
|
* @Groups({"read"})
|
||||||
*/
|
*/
|
||||||
private ?DateTimeImmutable $endDate = null;
|
private ?DateTimeImmutable $endDate = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\ManyToOne(targetEntity=Person::class)
|
* @ORM\ManyToOne(targetEntity=Person::class)
|
||||||
* @ORM\JoinColumn(nullable=true)
|
* @ORM\JoinColumn(nullable=true)
|
||||||
|
* @Groups({"read"})
|
||||||
*/
|
*/
|
||||||
private ?Person $hostPerson = null;
|
private ?Person $hostPerson = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\ManyToOne(targetEntity=ThirdParty::class)
|
* @ORM\ManyToOne(targetEntity=ThirdParty::class)
|
||||||
* @ORM\JoinColumn(nullable=true)
|
* @ORM\JoinColumn(nullable=true)
|
||||||
|
* @Groups({"read"})
|
||||||
*/
|
*/
|
||||||
private ?ThirdParty $hostThirdParty = null;
|
private ?ThirdParty $hostThirdParty = null;
|
||||||
|
|
||||||
@ -68,6 +73,7 @@ class ResidentialAddress
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="datetime_immutable")
|
* @ORM\Column(type="datetime_immutable")
|
||||||
|
* @Groups({"read"})
|
||||||
*/
|
*/
|
||||||
private ?DateTimeImmutable $startDate = null;
|
private ?DateTimeImmutable $startDate = null;
|
||||||
|
|
||||||
|
@ -117,19 +117,51 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="item-col">
|
<div class="item-col mx-3">
|
||||||
|
<div class="float-button bottom">
|
||||||
|
<div class="box">
|
||||||
<ul class="list-content fa-ul">
|
<ul class="list-content fa-ul">
|
||||||
<li v-if="person.current_residential_address">
|
<li v-if="person.current_residential_address">
|
||||||
ICI l'adresse de résidence, if any
|
|
||||||
<i class="fa fa-li fa-map-marker"></i>
|
<i class="fa fa-li fa-map-marker"></i>
|
||||||
<address-render-box v-if="person.current_residential_address"
|
<div v-if="person.current_residential_address.address">
|
||||||
:address="person.current_residential_address"
|
<address-render-box
|
||||||
|
:address="person.current_residential_address.address"
|
||||||
:isMultiline="isMultiline">
|
:isMultiline="isMultiline">
|
||||||
</address-render-box>
|
</address-render-box>
|
||||||
|
<p>({{ $t('renderbox.residential_address') }})</p>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="person.current_residential_address.hostPerson" class="mt-3">
|
||||||
|
<p>{{ $t('renderbox.located_at') }}:</p>
|
||||||
|
<span class="chill-entity entity-person badge-person">
|
||||||
|
<person-text
|
||||||
|
v-if="person.current_residential_address.hostPerson"
|
||||||
|
:person="person.current_residential_address.hostPerson"
|
||||||
|
></person-text>
|
||||||
|
</span>
|
||||||
|
<address-render-box v-if="person.current_residential_address.hostPerson.address"
|
||||||
|
:address="person.current_residential_address.hostPerson.address"
|
||||||
|
:isMultiline="isMultiline">
|
||||||
|
</address-render-box>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="person.current_residential_address.hostThirdParty" class="mt-3">
|
||||||
|
<p>{{ $t('renderbox.located_at') }}:</p>
|
||||||
|
<span class="chill-entity entity-person badge-thirdparty">
|
||||||
|
<third-party-text
|
||||||
|
v-if="person.current_residential_address.hostThirdParty"
|
||||||
|
:thirdparty="person.current_residential_address.hostThirdParty"
|
||||||
|
></third-party-text>
|
||||||
|
</span>
|
||||||
|
<address-render-box v-if="person.current_residential_address.hostThirdParty.address"
|
||||||
|
:address="person.current_residential_address.hostThirdParty.address"
|
||||||
|
:isMultiline="isMultiline">
|
||||||
|
</address-render-box>
|
||||||
|
</div>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@ -162,6 +194,7 @@ import AddressRenderBox from 'ChillMainAssets/vuejs/_components/Entity/AddressRe
|
|||||||
import Confidential from 'ChillMainAssets/vuejs/_components/Confidential.vue';
|
import Confidential from 'ChillMainAssets/vuejs/_components/Confidential.vue';
|
||||||
import BadgeEntity from 'ChillMainAssets/vuejs/_components/BadgeEntity.vue';
|
import BadgeEntity from 'ChillMainAssets/vuejs/_components/BadgeEntity.vue';
|
||||||
import PersonText from 'ChillPersonAssets/vuejs/_components/Entity/PersonText.vue';
|
import PersonText from 'ChillPersonAssets/vuejs/_components/Entity/PersonText.vue';
|
||||||
|
import ThirdPartyText from 'ChillThirdPartyAssets/vuejs/_components/Entity/ThirdPartyText.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "PersonRenderBox",
|
name: "PersonRenderBox",
|
||||||
@ -169,7 +202,8 @@ export default {
|
|||||||
AddressRenderBox,
|
AddressRenderBox,
|
||||||
Confidential,
|
Confidential,
|
||||||
BadgeEntity,
|
BadgeEntity,
|
||||||
PersonText
|
PersonText,
|
||||||
|
ThirdPartyText
|
||||||
},
|
},
|
||||||
props: ['person', 'options', 'render', 'returnPath'],
|
props: ['person', 'options', 'render', 'returnPath'],
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -62,7 +62,7 @@
|
|||||||
<li>
|
<li>
|
||||||
<i class="fa fa-li fa-home"></i>
|
<i class="fa fa-li fa-home"></i>
|
||||||
<span class="item-key">{{ "Address of"|trans}}</span>
|
<span class="item-key">{{ "Address of"|trans}}</span>
|
||||||
<span class="chill-entity entity-person badge-person">{{ a.hostThirdParty|chill_entity_render_box }}</span>
|
<span class="chill-entity entity-person badge-thirdparty">{{ a.hostThirdParty|chill_entity_render_box }}</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
{% if a.hostThirdParty.address is not null %}
|
{% if a.hostThirdParty.address is not null %}
|
||||||
|
@ -0,0 +1,29 @@
|
|||||||
|
<template>
|
||||||
|
<span v-if="isCut">{{ cutText }}</span>
|
||||||
|
<span v-else class="thirdparty-text">
|
||||||
|
<span class="firstname">{{ thirdparty.text }}</span>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "ThirdPartyText",
|
||||||
|
props: {
|
||||||
|
thirdparty: {
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
isCut: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
cutText: function() {
|
||||||
|
let more = (this.thirdparty.text.length > 15) ?'…' : '';
|
||||||
|
return this.thirdparty.text.slice(0,15) + more;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
Loading…
x
Reference in New Issue
Block a user