create style for badge 3party and introduce in ThirdPartyRenderBox.vue

This commit is contained in:
Julien Fastré 2021-10-12 17:32:17 +02:00
parent 88d073b9a9
commit b84d0100e0
11 changed files with 54 additions and 13 deletions

View File

@ -19,13 +19,13 @@
</div>
<div class="right_actions">
<span class="badge bg-chill-blue" v-if="item.result.kind == 'child'">
<span class="badge bg-thirdparty-child" v-if="item.result.kind == 'child'">
{{ $t('thirdparty.child')}}
</span>
<span class="badge bg-info" v-else-if="item.result.kind == 'company'">
<span class="badge bg-thirdparty-company" v-else-if="item.result.kind == 'company'">
{{ $t('thirdparty.company')}}
</span>
<span class="badge bg-secondary" v-else="item.result.kind == 'contact'">
<span class="badge bg-thirdparty-contact" v-else="item.result.kind == 'contact'">
{{ $t('thirdparty.contact')}}
</span>

View File

@ -0,0 +1,16 @@
@import 'ChillMainAssets/module/bootstrap/shared';
.badge {
&.bg-thirdparty-company {
//@extend .bg-info;
background-color: $yellow;
}
&.bg-thirdparty-child {
//@extend .bg-chill-blue;
background-color: $chill-blue;
}
&.bg-thirdparty-contact {
//@extedn .bg-secondary;
background-color: $secondary;
}
}

View File

@ -0,0 +1 @@
require('./chillthirdparty.scss');

View File

@ -1,2 +1,2 @@
require('./chillthirdparty.scss');
require('./index_3party.scss');

View File

@ -13,6 +13,16 @@
</a>
<span class="name">{{ thirdparty.text }}</span>
<span class="badge bg-thirdparty-child" v-if="thirdparty.kind == 'child'">
{{ $t('thirdparty.child')}}
</span>
<span class="badge bg-thirdparty-company" v-else-if="thirdparty.kind == 'company'">
{{ $t('thirdparty.company')}}
</span>
<span class="badge bg-thirdparty-contact" v-else="thirdparty.kind == 'contact'">
{{ $t('thirdparty.contact')}}
</span>
<span v-if="options.addId == true" class="id-number" :title="'n° ' + thirdparty.id">{{ thirdparty.id }}</span>
<span v-if="options.addEntity == true && thirdparty.type === 'thirdparty'" class="badge rounded-pill bg-secondary">{{ $t('renderbox.type.thirdparty') }}</span>
@ -57,11 +67,23 @@
import AddressRenderBox from 'ChillMainAssets/vuejs/_components/Entity/AddressRenderBox.vue';
import {dateToISO} from 'ChillMainAssets/chill/js/date.js';
const i18n = {
messages: {
fr: {
tparty: {
contact: "Personne physique",
company: "Personne morale"
}
}
}
};
export default {
name: "ThirdPartyRenderBox",
components: {
AddressRenderBox
},
i18n,
props: ['thirdparty', 'options'],
computed: {
isMultiline: function() {

View File

@ -24,13 +24,17 @@
<div class="form-check">
<input class="form-check-input mt-0" type="radio" v-model="kind" value="company" id="tpartyKindInstitution">
<label for="tpartyKindInstitution" class="required">
{{ $t('tparty.company')}}
<span class="badge bg-thirdparty-company">
{{ $t('tparty.company')}}
</span>
</label>
</div>
<div class="form-check">
<input class="form-check-input mt-0" type="radio" v-model="kind" value="contact" id="tpartyKindContact">
<label for="tpartyKindContact" class="required">
{{ $t('tparty.contact')}}
<span class="badge bg-thirdparty-contact">
{{ $t('tparty.contact')}}
</span>
</label>
</div>
</div>

View File

@ -81,13 +81,7 @@
<div class="item-row entity-bloc">
<div class="item-col">
{{ _self.label(thirdparty, options) }}
{% if thirdparty.kind == 'company' %}
<span class="badge bg-info">{{ 'thirdparty.company'|trans }}</span>
{% elseif thirdparty.kind == 'child' %}
<span class="badge bg-chill-blue">{{ 'thirdparty.Child'|trans }}</span>
{% elseif thirdparty.kind == 'contact' %}
<span class="badge bg-secondary">{{ 'thirdparty.contact'|trans }}</span>
{% endif %}
<span class="badge bg-thirdparty-{{ thirdparty.kind }}">{{ ('thirdparty.' ~ thirdparty.kind)|trans }}</span>
</div>
<div class="item-col">
<ul class="list-content fa-ul">

View File

@ -5,6 +5,8 @@ module.exports = function(encore, entries)
ChillThirdPartyAssets: __dirname + '/Resources/public'
});
entries.push(__dirname + '/Resources/public/chill/index.js');
encore.addEntry(
'page_3party_3party_index',
__dirname + '/Resources/public/page/index/index.js'

View File

@ -16,7 +16,9 @@ thirdparty.NameCompany: Service/Département
thirdparty.Acronym: Sigle
thirdparty.Categories: Catégories
thirdparty.Child: Personne de contact
thirdparty.child: Personne de contact
thirdparty.Children: Personnes de contact
thirdparty.children: Personnes de contact
thirdparty.Parent: Tiers institutionnel
thirdparty.Parents: Tiers institutionnels
thirdparty.Civility: Civilité