mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
requestor adapted to use PersonRenderBox or ThirdPartyRenderBox
This commit is contained in:
parent
de7322464b
commit
6ca35d5a18
@ -10,8 +10,28 @@
|
|||||||
{{ $t('requestor.is_anonymous') }}
|
{{ $t('requestor.is_anonymous') }}
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<div class="item-bloc">
|
<!-- <div class="flex-bloc row row-cols-1 g-0"> -->
|
||||||
<h4>
|
<third-party-renderbox v-if="accompanyingCourse.requestor.type == 'thirdparty'"
|
||||||
|
:thirdparty="accompanyingCourse.requestor"
|
||||||
|
:options="{
|
||||||
|
addLink: false,
|
||||||
|
addId: false,
|
||||||
|
addEntity: true,
|
||||||
|
addInfo: true
|
||||||
|
}"
|
||||||
|
></third-party-renderbox>
|
||||||
|
<person-render-box v-else-if="accompanyingCourse.requestor.type == 'person'"
|
||||||
|
:person="accompanyingCourse.requestor"
|
||||||
|
:options="{
|
||||||
|
addLink: false,
|
||||||
|
addId: false,
|
||||||
|
addAltNames: false,
|
||||||
|
addEntity: true,
|
||||||
|
addInfo: true
|
||||||
|
}"
|
||||||
|
></person-render-box>
|
||||||
|
<!-- </div> -->
|
||||||
|
<!-- <h4>
|
||||||
<span class="badge rounded-pill bg-secondary">{{ accompanyingCourse.requestor.type }}</span>
|
<span class="badge rounded-pill bg-secondary">{{ accompanyingCourse.requestor.type }}</span>
|
||||||
{{ accompanyingCourse.requestor.text }}
|
{{ accompanyingCourse.requestor.text }}
|
||||||
</h4>
|
</h4>
|
||||||
@ -54,8 +74,8 @@
|
|||||||
action="edit">
|
action="edit">
|
||||||
</on-the-fly>
|
</on-the-fly>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul> -->
|
||||||
</div>
|
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
<li>
|
<li>
|
||||||
<button class="btn btn-remove"
|
<button class="btn btn-remove"
|
||||||
@ -87,12 +107,16 @@
|
|||||||
<script>
|
<script>
|
||||||
import AddPersons from 'ChillPersonAssets/vuejs/_components/AddPersons.vue';
|
import AddPersons from 'ChillPersonAssets/vuejs/_components/AddPersons.vue';
|
||||||
import OnTheFly from 'ChillMainAssets/vuejs/_components/OnTheFly.vue';
|
import OnTheFly from 'ChillMainAssets/vuejs/_components/OnTheFly.vue';
|
||||||
|
import PersonRenderBox from '../../_components/Entity/PersonRenderBox.vue';
|
||||||
|
import ThirdPartyRenderbox from '../../../../../../ChillThirdPartyBundle/Resources/public/vuejs/_components/ThirdPartyRenderbox.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Requestor',
|
name: 'Requestor',
|
||||||
components: {
|
components: {
|
||||||
AddPersons,
|
AddPersons,
|
||||||
OnTheFly
|
OnTheFly,
|
||||||
|
PersonRenderBox,
|
||||||
|
ThirdPartyRenderbox,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
addEntity: true,
|
addEntity: true,
|
||||||
addInfo: true
|
addInfo: true
|
||||||
}"
|
}"
|
||||||
:thirdparty="resource"
|
:thirdparty="resource.resource"
|
||||||
>
|
>
|
||||||
<template v-slot:record-actions>
|
<template v-slot:record-actions>
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
<template>
|
<template>
|
||||||
|
|
||||||
<div class="item-bloc">
|
<div class="item-bloc">
|
||||||
<section class="chill-entity entity-person">
|
<section class="chill-entity entity-person">
|
||||||
<!-- ENTIRE RENDER_BOX -->
|
<!-- ENTIRE RENDER_BOX -->
|
||||||
@ -70,11 +69,11 @@
|
|||||||
</li>
|
</li>
|
||||||
<!-- PHONENUMBER -->
|
<!-- PHONENUMBER -->
|
||||||
<!-- todo: change href for phonenumbers and format phone number? -->
|
<!-- todo: change href for phonenumbers and format phone number? -->
|
||||||
<li v-if="this.person.mobilenumber">
|
<li v-if="person.mobilenumber">
|
||||||
<i class="fa fa-li fa-mobile"></i>
|
<i class="fa fa-li fa-mobile"></i>
|
||||||
<a :href="'tel: ' + person.mobilenumber">{{ person.mobilenumber }}</a>
|
<a :href="'tel: ' + person.mobilenumber">{{ person.mobilenumber }}</a>
|
||||||
</li>
|
</li>
|
||||||
<li v-else-if="this.person.phonenumber">
|
<li v-else-if="person.phonenumber">
|
||||||
<i class="fa fa-li fa-phone"></i>
|
<i class="fa fa-li fa-phone"></i>
|
||||||
<a :href="'tel: ' + person.phonenumber">{{ person.phonenumber }}</a>
|
<a :href="'tel: ' + person.phonenumber">{{ person.phonenumber }}</a>
|
||||||
</li>
|
</li>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="item-bloc">
|
|
||||||
<section class="chill-entity entity-person">
|
<div class="item-bloc col">
|
||||||
|
<section class="chill-entity entity-thirdparty">
|
||||||
<!-- ENTIRE RENDER_BOX -->
|
<!-- ENTIRE RENDER_BOX -->
|
||||||
<div class="item-row entity-bloc">
|
<div class="item-row entity-bloc">
|
||||||
|
|
||||||
@ -12,15 +13,15 @@
|
|||||||
<!-- todo: make h class dynamic -->
|
<!-- todo: make h class dynamic -->
|
||||||
<div class="denomination h3">
|
<div class="denomination h3">
|
||||||
|
|
||||||
<span v-if="options.addEntity == true && thirdparty.resource.type == 'thirdparty'" class="badge rounded-pill bg-secondary">{{ $t('renderbox.type.thirdparty') }}</span>
|
<span v-if="options.addEntity == true && thirdparty.type == 'thirdparty'" class="badge rounded-pill bg-secondary">{{ $t('renderbox.type.thirdparty') }}</span>
|
||||||
<span v-if="options.addEntity == true && thirdparty.resource.type == 'person'" class="badge rounded-pill bg-secondary">{{ $t('renderbox.type.person') }}</span>
|
<span v-if="options.addEntity == true && thirdparty.type == 'person'" class="badge rounded-pill bg-secondary">{{ $t('renderbox.type.person') }}</span>
|
||||||
<!-- NAME IF ADD LINK AND PERMISSION GRANTED -->
|
<!-- NAME IF ADD LINK AND PERMISSION GRANTED -->
|
||||||
<!-- todo: change href -->
|
<!-- todo: change href -->
|
||||||
<a v-if="this.options.addLink == true" href="#">
|
<a v-if="this.options.addLink == true" href="#">
|
||||||
<span class="name">{{ thirdparty.resource.text }}</span>
|
<span class="name">{{ thirdparty.text }}</span>
|
||||||
</a>
|
</a>
|
||||||
<!-- WITHOUT LINK JUST NAME -->
|
<!-- WITHOUT LINK JUST NAME -->
|
||||||
<span class="name">{{ thirdparty.resource.text }}</span>
|
<span class="name">{{ thirdparty.text }}</span>
|
||||||
|
|
||||||
<!-- IF ADD ENTITY OPTION -->
|
<!-- IF ADD ENTITY OPTION -->
|
||||||
|
|
||||||
@ -32,11 +33,11 @@
|
|||||||
<!-- EXTRA INFO -->
|
<!-- EXTRA INFO -->
|
||||||
<p v-if="this.options.addInfo == true" class="moreinfo">
|
<p v-if="this.options.addInfo == true" class="moreinfo">
|
||||||
<!-- todo: change icon if person is deceased? -->
|
<!-- todo: change icon if person is deceased? -->
|
||||||
<i :class="'fa fa-fw ' + getGenderIcon" title="{{ getGender }}"></i>
|
<i v-if="thirdparty.birthdate" :class="'fa fa-fw ' + getGenderIcon" title="{{ getGender }}"></i>
|
||||||
<time v-if="thirdparty.resource.birthdate" datetime="{{ thirdparty.birthdate.datetime }}" title="{{ birthdate }}">
|
<time v-if="thirdparty.birthdate" datetime="{{ thirdparty.birthdate.datetime }}" title="{{ birthdate }}">
|
||||||
{{ $t(getGender) + ' ' + $d(birthdate, 'short') }}
|
{{ $t(getGender) + ' ' + $d(birthdate, 'short') }}
|
||||||
</time>
|
</time>
|
||||||
<time v-else-if="thirdparty.resource.deathdate" datetime="{{ thirdparty.deathdate.datetime }}" title="{{ thirdparty.deathdate }}">
|
<time v-else-if="thirdparty.deathdate" datetime="{{ thirdparty.deathdate.datetime }}" title="{{ thirdparty.deathdate }}">
|
||||||
{{ birthdate }} - {{ deathdate }}
|
{{ birthdate }} - {{ deathdate }}
|
||||||
</time>
|
</time>
|
||||||
<span class="age">{{ thirdparty.age }}</span>
|
<span class="age">{{ thirdparty.age }}</span>
|
||||||
@ -49,20 +50,20 @@
|
|||||||
<div class="item-col">
|
<div class="item-col">
|
||||||
<ul class="list-content fa-ul">
|
<ul class="list-content fa-ul">
|
||||||
<!-- ADDRESS -->
|
<!-- ADDRESS -->
|
||||||
<li v-if="thirdparty.resource.address" class="chill-entity entity-address">
|
<li v-if="thirdparty.address" class="chill-entity entity-address">
|
||||||
<i class="fa fa-li fa-map-marker"></i>
|
<i class="fa fa-li fa-map-marker"></i>
|
||||||
<show-address :address="thirdparty.resource.address" :multiline="false"></show-address>
|
<show-address :address="thirdparty.address" :multiline="false"></show-address>
|
||||||
</li>
|
</li>
|
||||||
<!-- PHONENUMBER -->
|
<!-- PHONENUMBER -->
|
||||||
<!-- todo: change href for phonenumbers -->
|
<!-- todo: change href for phonenumbers -->
|
||||||
<li>
|
<li>
|
||||||
<i class="fa fa-li fa-mobile"></i>
|
<i class="fa fa-li fa-mobile"></i>
|
||||||
<a v-if="thirdparty.resource.telephone" :href="'tel: ' + thirdparty.resource.telephone">{{ thirdparty.resource.telephone }}</a>
|
<a v-if="thirdparty.telephone" :href="'tel: ' + thirdparty.telephone">{{ thirdparty.telephone }}</a>
|
||||||
<span v-else class="chill-no-data-statement">{{ $t('renderbox.no_information') }}</span>
|
<span v-else class="chill-no-data-statement">{{ $t('renderbox.no_information') }}</span>
|
||||||
</li>
|
</li>
|
||||||
<li v-if="thirdparty.resource.type == 'thirdparty'">
|
<li v-if="thirdparty.type == 'thirdparty'">
|
||||||
<i class="fa fa-li fa-envelope-o"></i>
|
<i class="fa fa-li fa-envelope-o"></i>
|
||||||
<a v-if="thirdparty.resource.email" :href="'mailto: ' + thirdparty.resource.email">{{ thirdparty.resource.email }}</a>
|
<a v-if="thirdparty.email" :href="'mailto: ' + thirdparty.email">{{ thirdparty.email }}</a>
|
||||||
<span v-else class="chill-no-data-statement">{{ $t('renderbox.no_information') }}</span>
|
<span v-else class="chill-no-data-statement">{{ $t('renderbox.no_information') }}</span>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@ -92,17 +93,17 @@ export default {
|
|||||||
props: ['thirdparty', 'options'],
|
props: ['thirdparty', 'options'],
|
||||||
computed: {
|
computed: {
|
||||||
getGender: function() {
|
getGender: function() {
|
||||||
return this.thirdparty.resource.gender == 'woman' ? 'renderbox.birthday.woman' : 'renderbox.birthday.man';
|
return this.thirdparty.gender == 'woman' ? 'renderbox.birthday.woman' : 'renderbox.birthday.man';
|
||||||
},
|
},
|
||||||
getGenderIcon: function() {
|
getGenderIcon: function() {
|
||||||
return this.thirdparty.resource.gender == 'woman' ? 'fa-venus' : this.thirdparty.resource.gender == 'man' ? 'fa-mars' : 'fa-neuter';
|
return this.thirdparty.gender == 'woman' ? 'fa-venus' : this.thirdparty.gender == 'man' ? 'fa-mars' : 'fa-neuter';
|
||||||
},
|
},
|
||||||
birthdate: function(){
|
birthdate: function(){
|
||||||
var date = new Date(this.thirdparty.resource.birthdate.datetime);
|
var date = new Date(this.thirdparty.birthdate.datetime);
|
||||||
return dateToISO(date);
|
return dateToISO(date);
|
||||||
},
|
},
|
||||||
deathdate: function(){
|
deathdate: function(){
|
||||||
var date = new Date(this.thirdparty.resource.deathdate.datetime);
|
var date = new Date(this.thirdparty.deathdate.datetime);
|
||||||
return dateToISO(date);
|
return dateToISO(date);
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user