onthefly create thirdparty: use badge-entity for radio buttons label

This commit is contained in:
Mathieu Jaumotte 2021-12-10 15:37:12 +01:00
parent 94ec165c4c
commit 3592434623
2 changed files with 12 additions and 20 deletions

View File

@ -26,17 +26,19 @@
<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">
<span class="badge rounded-pill bg-thirdparty-company" style="padding-top: 0;">
{{ $t('tparty.company')}}
</span>
<badge-entity
:entity="{ type: 'thirdparty', kind: 'company' }"
:options="{ displayLong: true }">
</badge-entity>
</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">
<span class="badge rounded-pill bg-thirdparty-contact" style="padding-top: 0;">
{{ $t('tparty.contact')}}
</span>
<badge-entity
:entity="{ type: 'thirdparty', kind: 'contact' }"
:options="{ displayLong: true }">
</badge-entity>
</label>
</div>
</div>
@ -97,26 +99,16 @@
import ThirdPartyRenderBox from '../Entity/ThirdPartyRenderBox.vue';
import AddAddress from 'ChillMainAssets/vuejs/Address/components/AddAddress';
import { getThirdparty } from '../../_api/OnTheFly';
const i18n = {
messages: {
fr: {
tparty: {
contact: "Personne physique",
company: "Personne morale"
}
}
}
};
import BadgeEntity from 'ChillMainAssets/vuejs/_components/BadgeEntity.vue';
export default {
name: "OnTheFlyThirdParty",
props: ['id', 'type', 'action'],
components: {
ThirdPartyRenderBox,
AddAddress
AddAddress,
BadgeEntity
},
i18n,
data() {
return {
//context: {}, <--

View File

@ -12,7 +12,7 @@
{% block crud_content_header %}
<h1>
{{ 'Update third party %name%'|trans({ '%name%': thirdParty.name }) }}
<span class="badge bg-{{ thirdParty.active ? 'success' : 'danger' }}"
<span class="badge bg-{{ thirdParty.active ? 'success' : 'danger' }} float-end"
title="{{ (thirdParty.active ? 'shown to users' : 'not shown to users')|trans }}">
{{ (thirdParty.active ? 'Active' : 'Inactive')|trans }}
</span>