mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Merge branch 'ameliorations_composants_vue' into improve_ux
This commit is contained in:
commit
6253927e2e
@ -9,7 +9,15 @@
|
|||||||
<label class="chill-no-data-statement">{{ $tc('persons_associated.counter', counter) }}</label>
|
<label class="chill-no-data-statement">{{ $tc('persons_associated.counter', counter) }}</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<table class="table table-bordered table-striped border-dark align-middle" v-if="participations.length > 0">
|
<participation-item
|
||||||
|
v-for="participation in participations"
|
||||||
|
v-bind:participation="participation"
|
||||||
|
v-bind:key="participation.id"
|
||||||
|
@remove="removeParticipation"
|
||||||
|
@close="closeParticipation">
|
||||||
|
</participation-item>
|
||||||
|
|
||||||
|
<!-- <table class="table table-bordered table-striped border-dark align-middle" v-if="participations.length > 0">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="chill-orange">{{ $t('persons_associated.name') }}</th>
|
<th class="chill-orange">{{ $t('persons_associated.name') }}</th>
|
||||||
@ -19,15 +27,15 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<person-item
|
<participation-item
|
||||||
v-for="participation in participations"
|
v-for="participation in participations"
|
||||||
v-bind:participation="participation"
|
v-bind:participation="participation"
|
||||||
v-bind:key="participation.id"
|
v-bind:key="participation.id"
|
||||||
@remove="removeParticipation"
|
@remove="removeParticipation"
|
||||||
@close="closeParticipation">
|
@close="closeParticipation">
|
||||||
</person-item>
|
</participation-item>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table> -->
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<add-persons
|
<add-persons
|
||||||
@ -45,13 +53,13 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapState } from 'vuex';
|
import { mapState } from 'vuex';
|
||||||
import PersonItem from "./PersonsAssociated/PersonItem.vue"
|
import ParticipationItem from "./PersonsAssociated/ParticipationItem.vue"
|
||||||
import AddPersons from 'ChillPersonAssets/vuejs/_components/AddPersons.vue'
|
import AddPersons from 'ChillPersonAssets/vuejs/_components/AddPersons.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'PersonsAssociated',
|
name: 'PersonsAssociated',
|
||||||
components: {
|
components: {
|
||||||
PersonItem,
|
ParticipationItem,
|
||||||
AddPersons
|
AddPersons
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
@ -1,8 +1,26 @@
|
|||||||
<template>
|
<template>
|
||||||
<tr>
|
|
||||||
|
<person-render-box
|
||||||
|
:options="{
|
||||||
|
addInfo : true,
|
||||||
|
addId : true,
|
||||||
|
addEntity: false,
|
||||||
|
addLink: false,
|
||||||
|
addAltNames: true,
|
||||||
|
addAge : false,
|
||||||
|
hLevel : 1
|
||||||
|
}"
|
||||||
|
:participation="participation">
|
||||||
|
</person-render-box>
|
||||||
|
|
||||||
|
<!-- <tr>
|
||||||
<td>
|
<td>
|
||||||
{{ participation.person.firstName }}
|
{{ participation.person.firstName }}
|
||||||
{{ participation.person.lastName }}
|
{{ participation.person.lastName }}
|
||||||
|
<person-render-box
|
||||||
|
v-bind:options="options"
|
||||||
|
v-bind:participation="participation"
|
||||||
|
></person-render-box>
|
||||||
</td>
|
</td>
|
||||||
<td><span v-if="participation.startDate">
|
<td><span v-if="participation.startDate">
|
||||||
{{ $d(participation.startDate.datetime, 'short') }}</span>
|
{{ $d(participation.startDate.datetime, 'short') }}</span>
|
||||||
@ -30,12 +48,12 @@
|
|||||||
action="edit">
|
action="edit">
|
||||||
</on-the-fly>
|
</on-the-fly>
|
||||||
</li>
|
</li>
|
||||||
<!--li>
|
li>
|
||||||
<button class="btn btn-delete"
|
<button class="btn btn-delete"
|
||||||
:title="$t('action.delete')"
|
:title="$t('action.delete')"
|
||||||
@click.prevent="$emit('remove', participation)">
|
@click.prevent="$emit('remove', participation)">
|
||||||
</button>
|
</button>
|
||||||
</li-->
|
</li
|
||||||
<li>
|
<li>
|
||||||
<button v-if="!participation.endDate"
|
<button v-if="!participation.endDate"
|
||||||
class="btn btn-sm btn-remove"
|
class="btn btn-sm btn-remove"
|
||||||
@ -46,21 +64,36 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr> -->
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import OnTheFly from 'ChillMainAssets/vuejs/_components/OnTheFly.vue';
|
import OnTheFly from 'ChillMainAssets/vuejs/_components/OnTheFly.vue';
|
||||||
import ButtonLocation from '../ButtonLocation.vue';
|
import ButtonLocation from '../ButtonLocation.vue';
|
||||||
|
import PersonRenderBox from 'ChillPersonAssets/vuejs/_components/Entity/PersonRenderBox.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'PersonItem',
|
name: 'ParticipationItem',
|
||||||
components: {
|
components: {
|
||||||
OnTheFly,
|
OnTheFly,
|
||||||
ButtonLocation
|
ButtonLocation,
|
||||||
|
PersonRenderBox
|
||||||
},
|
},
|
||||||
props: ['participation'],
|
props: ['participation'],
|
||||||
emits: ['remove', 'close'],
|
emits: ['remove', 'close'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
PersonRenderBox: {
|
||||||
|
participation: 'participation',
|
||||||
|
options: {
|
||||||
|
addInfo: false,
|
||||||
|
addId: true,
|
||||||
|
addAge: false,
|
||||||
|
hLevel: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
hasCurrentHouseholdAddress() {
|
hasCurrentHouseholdAddress() {
|
||||||
if ( !this.participation.endDate
|
if ( !this.participation.endDate
|
@ -0,0 +1,170 @@
|
|||||||
|
<template>
|
||||||
|
<div class="flex-table mb-3">
|
||||||
|
<div class="item-bloc">
|
||||||
|
<section class="chill-entity entity-person">
|
||||||
|
<!-- ENTIRE RENDER_BOX -->
|
||||||
|
<div class="item-row entity-bloc">
|
||||||
|
|
||||||
|
<!-- LABEL -->
|
||||||
|
<div class="item-col">
|
||||||
|
<div class="entity-label">
|
||||||
|
|
||||||
|
<!-- NAME TAG -->
|
||||||
|
<div class="denomination h3">
|
||||||
|
|
||||||
|
<!-- NAME IF ADD LINK AND PERMISSION GRANTED -->
|
||||||
|
<a v-if="this.options.addLink == true" href="#">
|
||||||
|
<span class="firstname">{{ participation.person.firstName }}</span>
|
||||||
|
<span class="lastname">{{ participation.person.lastName }}</span>
|
||||||
|
<!-- IF ALT NAMES -->
|
||||||
|
<span v-if="this.options.addAltNames == true" class="altnames">
|
||||||
|
<!-- LOOP THROUGH ALT NAMES -->
|
||||||
|
<span :class="'altname altname-' + altNameKey">{{ altNameLabel }}</span>
|
||||||
|
<!-- END LOOP -->
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<!-- WITHOUT LINK JUST NAME -->
|
||||||
|
<span class="firstname">{{ participation.person.firstName }}</span>
|
||||||
|
<span class="lastname">{{ participation.person.lastName }}</span>
|
||||||
|
<!-- IF ALT NAMES -->
|
||||||
|
<span v-if="this.options.addAltNames == true" class="altnames">
|
||||||
|
<!-- LOOP THROUGH ALT NAMES -->
|
||||||
|
<span :class="'altname altname-' + altNameKey">{{ altNameLabel }}</span>
|
||||||
|
<!-- END LOOP -->
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<!-- IF ADD ENTITY OPTION -->
|
||||||
|
<span v-if="this.options.addEntity == true" class="badge rounded-pill bg-secondary">Person</span>
|
||||||
|
<span v-if="this.options.addId == true" class="id-number" title="n° participation.person.id">{{ participation.person.id }}</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- END NAME TAG -->
|
||||||
|
|
||||||
|
<!-- BIRTHDATE / DEATHDATE AND AGE -->
|
||||||
|
<p v-if="this.options.addInfo == true" class="moreinfo">
|
||||||
|
<i :class="'fa fa-fw ' + getGender" title="{{ getGender }}"></i>
|
||||||
|
<time datetime="{{ participation.person.birthdate }}" title="**birthdate**">
|
||||||
|
Né le {{ birthdate }}
|
||||||
|
</time>
|
||||||
|
<span class="age">{{ participation.person.age }}</span>
|
||||||
|
</p>
|
||||||
|
<!-- END BIRTH/DEATH AND AGE -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- END LABEL -->
|
||||||
|
|
||||||
|
<!-- EXTRA INFO AND ACTIONS-->
|
||||||
|
<div class="item-col">
|
||||||
|
<ul class="list-content fa-ul">
|
||||||
|
<li>
|
||||||
|
<!-- ADDRESS -->
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<!-- PHONENUMBER -->
|
||||||
|
<li>
|
||||||
|
<div v-if="this.participation.person.mobilenumber">
|
||||||
|
<i class="fa fa-li fa-mobile"></i>
|
||||||
|
<a href="#">{{ participation.person.mobilenumber }}</a>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="this.participation.person.phonenumber">
|
||||||
|
<i class="fa fa-li fa-phone"></i>
|
||||||
|
<a href="#">{{ participation.person.phonenumber }}</a>
|
||||||
|
</div>
|
||||||
|
<span v-else class="chill-no-data-statement">Pas d'information</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<ul class="record_actions">
|
||||||
|
<li>
|
||||||
|
<on-the-fly
|
||||||
|
v-bind:type="participation.person.type"
|
||||||
|
v-bind:id="participation.person.id"
|
||||||
|
action="show">
|
||||||
|
</on-the-fly>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<on-the-fly
|
||||||
|
v-bind:type="participation.person.type"
|
||||||
|
v-bind:id="participation.person.id"
|
||||||
|
action="edit">
|
||||||
|
</on-the-fly>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<button class="btn btn-delete"
|
||||||
|
:title="$t('action.delete')"
|
||||||
|
@click.prevent="$emit('remove', participation)">
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<button v-if="!participation.endDate"
|
||||||
|
class="btn btn-remove"
|
||||||
|
v-bind:title="$t('action.remove')"
|
||||||
|
@click.prevent="$emit('close', participation)">
|
||||||
|
</button>
|
||||||
|
<button v-else class="btn btn-remove disabled"></button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<!-- END ADDRESS AND PHONE NUMBER -->
|
||||||
|
|
||||||
|
<!-- ACTION BUTTONS -->
|
||||||
|
<!-- <ul class="record_actions">
|
||||||
|
<li>
|
||||||
|
<a class="btn btn-show" target="_blank" title="Show person"
|
||||||
|
href="#"></a>
|
||||||
|
</li>
|
||||||
|
</ul> -->
|
||||||
|
<!-- END ACTIONS -->
|
||||||
|
</div>
|
||||||
|
<!-- END EXTRA INFO AND ACTIONS -->
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import OnTheFly from 'ChillMainAssets/vuejs/_components/OnTheFly.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "PersonRenderBox",
|
||||||
|
components: {
|
||||||
|
OnTheFly
|
||||||
|
},
|
||||||
|
props: ['participation', 'options'],
|
||||||
|
computed: {
|
||||||
|
getGender: function() {
|
||||||
|
// gender
|
||||||
|
return this.participation.person.gender == 'woman' ? 'fa-venus' : this.participation.person.gender == 'man' ? 'fa-mars' : 'fa-neuter';
|
||||||
|
},
|
||||||
|
birthdate: function(){
|
||||||
|
var date = new Date(this.participation.person.birthdate.datetime);
|
||||||
|
var day = date.getDate()
|
||||||
|
var months = ["Jan.", "Fevr.", "Mars", "Avril", "Mai", "Juin", "Juill.", "Août", "Sept.", "Oct.", "Nov.", "Dec."]
|
||||||
|
var month = date.getMonth()
|
||||||
|
var year = date.getFullYear()
|
||||||
|
return `${day} ${months[month]} ${year}`;
|
||||||
|
},
|
||||||
|
altNameLabel: function(){
|
||||||
|
for(let i = 0; i < this.participation.person.altNames.length; i++){
|
||||||
|
return this.participation.person.altNames[i].label
|
||||||
|
}
|
||||||
|
},
|
||||||
|
altNameKey: function(){
|
||||||
|
for(let i = 0; i < this.participation.person.altNames.length; i++){
|
||||||
|
return this.participation.person.altNames[i].key
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
.lastname:before{
|
||||||
|
content: " "
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user