mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
ThirdPartyRenderBox created and old view replaced
This commit is contained in:
parent
4a0ffd2cba
commit
90cfcd0569
@ -69,7 +69,11 @@ const messages = {
|
|||||||
man: "Né le",
|
man: "Né le",
|
||||||
woman: "Née le"
|
woman: "Née le"
|
||||||
} ,
|
} ,
|
||||||
no_information: "Pas d'information"
|
no_information: "Pas d'information",
|
||||||
|
type: {
|
||||||
|
thirdparty: "Tiers",
|
||||||
|
person: "Usager"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -15,16 +15,15 @@
|
|||||||
<th class="chill-orange">{{ $t('action.actions') }}</th>
|
<th class="chill-orange">{{ $t('action.actions') }}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
|
||||||
<resource-item
|
|
||||||
v-for="resource in resources"
|
|
||||||
v-bind:resource="resource"
|
|
||||||
v-bind:key="resource.id"
|
|
||||||
@remove="removeResource">
|
|
||||||
</resource-item>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
</table>
|
||||||
|
<div class="flex-table mb-3">
|
||||||
|
<resource-item
|
||||||
|
v-for="resource in resources"
|
||||||
|
v-bind:resource="resource"
|
||||||
|
v-bind:key="resource.id"
|
||||||
|
@remove="removeResource">
|
||||||
|
</resource-item>
|
||||||
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<add-persons
|
<add-persons
|
||||||
buttonTitle="resources.add_resources"
|
buttonTitle="resources.add_resources"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<tr>
|
<!-- <tr> -->
|
||||||
|
|
||||||
<td>
|
<!-- <td>
|
||||||
<span class="badge rounded-pill bg-secondary"
|
<span class="badge rounded-pill bg-secondary"
|
||||||
v-bind:title="resource.resource.id">
|
v-bind:title="resource.resource.id">
|
||||||
<span v-if="resource.resource.type === 'person'" >{{ $t('item.type_person') }}</span>
|
<span v-if="resource.resource.type === 'person'" >{{ $t('item.type_person') }}</span>
|
||||||
@ -18,41 +18,58 @@
|
|||||||
{{ resource.resource.address.postcode.name }}
|
{{ resource.resource.address.postcode.name }}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td> -->
|
||||||
<ul class="record_actions">
|
<third-party-render-box
|
||||||
<li>
|
:options="{
|
||||||
<on-the-fly
|
addLink : false,
|
||||||
v-bind:type="resource.resource.type"
|
addId : false,
|
||||||
v-bind:id="resource.resource.id"
|
addEntity: true,
|
||||||
action="show">
|
addInfo: true
|
||||||
</on-the-fly>
|
}"
|
||||||
</li>
|
:thirdparty="resource"
|
||||||
<li>
|
>
|
||||||
<on-the-fly
|
<template v-slot:record-actions>
|
||||||
v-bind:type="resource.resource.type"
|
<ul class="record_actions">
|
||||||
v-bind:id="resource.resource.id"
|
<li>
|
||||||
action="edit">
|
<on-the-fly
|
||||||
</on-the-fly>
|
v-bind:type="resource.resource.type"
|
||||||
</li>
|
v-bind:id="resource.resource.id"
|
||||||
<li>
|
action="show">
|
||||||
<button
|
</on-the-fly>
|
||||||
class="btn btn-remove"
|
</li>
|
||||||
v-bind:title="$t('action.remove')"
|
<li>
|
||||||
@click.prevent="$emit('remove', resource)">
|
<on-the-fly
|
||||||
</button>
|
v-bind:type="resource.resource.type"
|
||||||
</li>
|
v-bind:id="resource.resource.id"
|
||||||
</ul>
|
action="edit">
|
||||||
</td>
|
</on-the-fly>
|
||||||
</tr>
|
</li>
|
||||||
|
<li>
|
||||||
|
<button
|
||||||
|
class="btn btn-remove"
|
||||||
|
v-bind:title="$t('action.remove')"
|
||||||
|
@click.prevent="$emit('remove', resource)">
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
</third-party-render-box>
|
||||||
|
|
||||||
|
<!-- </td>
|
||||||
|
</tr> -->
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import OnTheFly from 'ChillMainAssets/vuejs/_components/OnTheFly.vue';
|
import OnTheFly from 'ChillMainAssets/vuejs/_components/OnTheFly.vue';
|
||||||
|
import ThirdPartyRenderBox from '../../../../../../../ChillThirdPartyBundle/Resources/public/vuejs/_components/ThirdPartyRenderbox.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ResourceItem',
|
name: 'ResourceItem',
|
||||||
components: {
|
components: {
|
||||||
OnTheFly
|
OnTheFly,
|
||||||
|
ThirdPartyRenderBox
|
||||||
},
|
},
|
||||||
props: ['resource'],
|
props: ['resource'],
|
||||||
emits: ['remove']
|
emits: ['remove']
|
||||||
|
@ -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 -->
|
||||||
@ -13,24 +12,34 @@
|
|||||||
<!-- 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.resource.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.name }}</span>
|
<span class="name">{{ thirdparty.resource.text }}</span>
|
||||||
</a>
|
</a>
|
||||||
<!-- WITHOUT LINK JUST NAME -->
|
<!-- WITHOUT LINK JUST NAME -->
|
||||||
<span v-else class="name">{{ thirdparty.name }}</span>
|
<span class="name">{{ thirdparty.resource.text }}</span>
|
||||||
|
|
||||||
<!-- IF ADD ENTITY OPTION -->
|
<!-- IF ADD ENTITY OPTION -->
|
||||||
<span v-if="this.options.addEntity == true" class="badge rounded-pill bg-secondary">{{ $t('renderbox.third_party') }}</span>
|
|
||||||
<span v-if="this.options.addId == true" class="id-number" :title="'n° ' + thirdparty.id">{{ thirdparty.id }}</span>
|
<span v-if="options.addId == true" class="id-number" :title="'n° ' + thirdparty.id">{{ thirdparty.id }}</span>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!-- END NAME TAG -->
|
<!-- END NAME TAG -->
|
||||||
|
|
||||||
<!-- EXTRA INFO -->
|
<!-- EXTRA INFO -->
|
||||||
<p v-if="this.options.addInfo == true" class="moreinfo">
|
<p v-if="this.options.addInfo == true" class="moreinfo">
|
||||||
<!-- todo: what to add here as extra info? -->
|
<!-- todo: change icon if person is deceased? -->
|
||||||
|
<i :class="'fa fa-fw ' + getGenderIcon" title="{{ getGender }}"></i>
|
||||||
|
<time v-if="thirdparty.resource.birthdate" datetime="{{ thirdparty.birthdate.datetime }}" title="{{ birthdate }}">
|
||||||
|
{{ $t(getGender) + ' ' + $d(birthdate, 'short') }}
|
||||||
|
</time>
|
||||||
|
<time v-else-if="thirdparty.resource.deathdate" datetime="{{ thirdparty.deathdate.datetime }}" title="{{ thirdparty.deathdate }}">
|
||||||
|
{{ birthdate }} - {{ deathdate }}
|
||||||
|
</time>
|
||||||
|
<span class="age">{{ thirdparty.age }}</span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -40,20 +49,21 @@
|
|||||||
<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.address" class="chill-entity entity-address">
|
<li v-if="thirdparty.resource.address" class="chill-entity entity-address">
|
||||||
<i class="fa fa-fw fa-map-marker"></i>
|
<i class="fa fa-li fa-map-marker"></i>
|
||||||
<show-address :address="thirdparty.address" :multiline="false"></show-address>
|
<show-address :address="thirdparty.resource.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="this.thirdparty.telephone" :href="'tel: ' + thirdparty.telephone">{{ thirdparty.telephone }}</a>
|
<a v-if="thirdparty.resource.telephone" :href="'tel: ' + thirdparty.resource.telephone">{{ thirdparty.resource.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>
|
<li v-if="thirdparty.resource.type == 'thirdparty'">
|
||||||
<i class="fa fa-li fa-envelope-o"></i>
|
<i class="fa fa-li fa-envelope-o"></i>
|
||||||
<a v-if="this.thirdparty.telephone" :href="'mailto: ' + thirdparty.email">{{ thirdparty.email }}</a>
|
<a v-if="thirdparty.resource.email" :href="'mailto: ' + thirdparty.resource.email">{{ thirdparty.resource.email }}</a>
|
||||||
|
<span v-else class="chill-no-data-statement">{{ $t('renderbox.no_information') }}</span>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
@ -72,21 +82,44 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ShowAddress from 'ChillMainAssets/vuejs/Address/components/ShowAddress.vue';
|
import ShowAddress from 'ChillMainAssets/vuejs/Address/components/ShowAddress.vue';
|
||||||
|
import {dateToISO} from 'ChillMainAssets/chill/js/date.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "ThirdPartyRenderBox",
|
name: "ThirdPartyRenderBox",
|
||||||
components: {
|
components: {
|
||||||
ThirdPartyRenderBox,
|
|
||||||
ShowAddress
|
ShowAddress
|
||||||
},
|
},
|
||||||
props: ['thirdparty', 'options'],
|
props: ['thirdparty', 'options'],
|
||||||
|
computed: {
|
||||||
|
getGender: function() {
|
||||||
|
return this.thirdparty.resource.gender == 'woman' ? 'renderbox.birthday.woman' : 'renderbox.birthday.man';
|
||||||
|
},
|
||||||
|
getGenderIcon: function() {
|
||||||
|
return this.thirdparty.resource.gender == 'woman' ? 'fa-venus' : this.thirdparty.resource.gender == 'man' ? 'fa-mars' : 'fa-neuter';
|
||||||
|
},
|
||||||
|
birthdate: function(){
|
||||||
|
var date = new Date(this.thirdparty.resource.birthdate.datetime);
|
||||||
|
return dateToISO(date);
|
||||||
|
},
|
||||||
|
deathdate: function(){
|
||||||
|
var date = new Date(this.thirdparty.resource.deathdate.datetime);
|
||||||
|
return dateToISO(date);
|
||||||
|
},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style lang="scss">
|
||||||
|
|
||||||
.lastname:before{
|
.lastname{
|
||||||
content: " "
|
&:before{
|
||||||
|
content: " "
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.name{
|
||||||
|
&:before{
|
||||||
|
content: " "
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user