mirror of
https://github.com/wekan/wekan.git
synced 2025-04-22 04:57:07 -04:00
display formatted currency custom field on minicard
This commit is contained in:
parent
54b9035eb2
commit
d26786a628
2 changed files with 16 additions and 2 deletions
|
@ -74,8 +74,12 @@ template(name="minicard")
|
|||
+viewer
|
||||
= definition.name
|
||||
.minicard-custom-field-item
|
||||
+viewer
|
||||
= trueValue
|
||||
if $eq definition.type "currency"
|
||||
+viewer
|
||||
= formattedCurrencyCustomFieldValue(definition)
|
||||
else
|
||||
+viewer
|
||||
= trueValue
|
||||
|
||||
if getAssignees
|
||||
.minicard-assignees.js-minicard-assignees
|
||||
|
|
|
@ -9,6 +9,16 @@ BlazeComponent.extendComponent({
|
|||
return 'minicard';
|
||||
},
|
||||
|
||||
formattedCurrencyCustomFieldValue(definition) {
|
||||
const customField = this.data()
|
||||
.customFieldsWD()
|
||||
.find(f => f._id === definition._id);
|
||||
const customFieldTrueValue =
|
||||
customField && customField.trueValue ? customField.trueValue : '';
|
||||
|
||||
return `${definition.settings.currencySymbol}${customFieldTrueValue}`;
|
||||
},
|
||||
|
||||
events() {
|
||||
return [
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue