2015-05-27 17:17:00 +02:00
|
|
|
// Template.cards.events({
|
|
|
|
|
// 'click .member': Popup.open('cardMember')
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
BlazeComponent.extendComponent({
|
2015-09-03 23:12:46 +02:00
|
|
|
template() {
|
2015-05-27 17:17:00 +02:00
|
|
|
return 'minicard';
|
2015-09-03 23:12:46 +02:00
|
|
|
},
|
2018-04-20 23:52:13 -03:00
|
|
|
|
2020-05-25 16:02:37 +00:00
|
|
|
formattedCurrencyCustomFieldValue(definition) {
|
|
|
|
|
const customField = this.data()
|
|
|
|
|
.customFieldsWD()
|
|
|
|
|
.find(f => f._id === definition._id);
|
|
|
|
|
const customFieldTrueValue =
|
|
|
|
|
customField && customField.trueValue ? customField.trueValue : '';
|
|
|
|
|
|
2020-05-25 22:05:06 +00:00
|
|
|
const locale = TAPi18n.getLanguage();
|
|
|
|
|
return new Intl.NumberFormat(locale, {
|
|
|
|
|
style: 'currency',
|
|
|
|
|
currency: definition.settings.currencyCode,
|
|
|
|
|
}).format(customFieldTrueValue);
|
2020-05-25 16:02:37 +00:00
|
|
|
},
|
|
|
|
|
|
2018-04-20 23:52:13 -03:00
|
|
|
events() {
|
2019-06-28 12:52:09 -05:00
|
|
|
return [
|
|
|
|
|
{
|
|
|
|
|
'click .js-linked-link'() {
|
|
|
|
|
if (this.data().isLinkedCard()) Utils.goCardId(this.data().linkedId);
|
|
|
|
|
else if (this.data().isLinkedBoard())
|
|
|
|
|
Utils.goBoardId(this.data().linkedId);
|
|
|
|
|
},
|
2018-04-20 23:52:13 -03:00
|
|
|
},
|
2019-08-07 18:11:34 +03:00
|
|
|
{
|
|
|
|
|
'click .js-toggle-minicard-label-text'() {
|
2020-10-28 15:45:37 +02:00
|
|
|
if (window.localStorage.getItem('hiddenMinicardLabelText')) {
|
|
|
|
|
window.localStorage.removeItem('hiddenMinicardLabelText'); //true
|
New feature: Now there is popup selection of Lists/Swimlanes/Calendar/Roles.
New feature, not set visible yet, because switching to it does not
work properly yet: Collapsible Swimlanes #2804
Fix: Public board now loads correctly. When you select one of Lists/Swimlanes/Calendar view and
reload webbrowser page, it can change view. Closes #2311
Fix: List sorting commented out. Closes #2800
Fix: Errors hasHiddenMinicardText, hasShowDragHandles, showSort, hasSortBy, profile,
FirefoxAndroid/IE11/Vivaldi/Chromium browsers not working by using
cookies instead of database.
More details at https://github.com/wekan/wekan/issues/2643#issuecomment-554907955
Note: Cookie changes are not always immediate, if there is no effect,
you may need to reload webbrowser page.
Closes #2643 .
Thanks to xet7 !
2019-11-18 22:23:49 +02:00
|
|
|
} else {
|
2020-10-28 15:45:37 +02:00
|
|
|
window.localStorage.setItem('hiddenMinicardLabelText', 'true'); //true
|
New feature: Now there is popup selection of Lists/Swimlanes/Calendar/Roles.
New feature, not set visible yet, because switching to it does not
work properly yet: Collapsible Swimlanes #2804
Fix: Public board now loads correctly. When you select one of Lists/Swimlanes/Calendar view and
reload webbrowser page, it can change view. Closes #2311
Fix: List sorting commented out. Closes #2800
Fix: Errors hasHiddenMinicardText, hasShowDragHandles, showSort, hasSortBy, profile,
FirefoxAndroid/IE11/Vivaldi/Chromium browsers not working by using
cookies instead of database.
More details at https://github.com/wekan/wekan/issues/2643#issuecomment-554907955
Note: Cookie changes are not always immediate, if there is no effect,
you may need to reload webbrowser page.
Closes #2643 .
Thanks to xet7 !
2019-11-18 22:23:49 +02:00
|
|
|
}
|
2019-08-07 18:11:34 +03:00
|
|
|
},
|
|
|
|
|
},
|
2019-06-28 12:52:09 -05:00
|
|
|
];
|
2018-04-20 23:52:13 -03:00
|
|
|
},
|
2015-05-27 17:17:00 +02:00
|
|
|
}).register('minicard');
|
2019-08-07 18:11:34 +03:00
|
|
|
|
|
|
|
|
Template.minicard.helpers({
|
2019-10-29 19:05:44 +02:00
|
|
|
showDesktopDragHandles() {
|
2019-11-19 14:09:36 +02:00
|
|
|
currentUser = Meteor.user();
|
|
|
|
|
if (currentUser) {
|
|
|
|
|
return (currentUser.profile || {}).showDesktopDragHandles;
|
2020-10-28 15:45:37 +02:00
|
|
|
} else if (window.localStorage.getItem('showDesktopDragHandles')) {
|
2020-01-03 06:49:35 +02:00
|
|
|
return true;
|
New feature: Now there is popup selection of Lists/Swimlanes/Calendar/Roles.
New feature, not set visible yet, because switching to it does not
work properly yet: Collapsible Swimlanes #2804
Fix: Public board now loads correctly. When you select one of Lists/Swimlanes/Calendar view and
reload webbrowser page, it can change view. Closes #2311
Fix: List sorting commented out. Closes #2800
Fix: Errors hasHiddenMinicardText, hasShowDragHandles, showSort, hasSortBy, profile,
FirefoxAndroid/IE11/Vivaldi/Chromium browsers not working by using
cookies instead of database.
More details at https://github.com/wekan/wekan/issues/2643#issuecomment-554907955
Note: Cookie changes are not always immediate, if there is no effect,
you may need to reload webbrowser page.
Closes #2643 .
Thanks to xet7 !
2019-11-18 22:23:49 +02:00
|
|
|
} else {
|
2020-01-03 06:49:35 +02:00
|
|
|
return false;
|
New feature: Now there is popup selection of Lists/Swimlanes/Calendar/Roles.
New feature, not set visible yet, because switching to it does not
work properly yet: Collapsible Swimlanes #2804
Fix: Public board now loads correctly. When you select one of Lists/Swimlanes/Calendar view and
reload webbrowser page, it can change view. Closes #2311
Fix: List sorting commented out. Closes #2800
Fix: Errors hasHiddenMinicardText, hasShowDragHandles, showSort, hasSortBy, profile,
FirefoxAndroid/IE11/Vivaldi/Chromium browsers not working by using
cookies instead of database.
More details at https://github.com/wekan/wekan/issues/2643#issuecomment-554907955
Note: Cookie changes are not always immediate, if there is no effect,
you may need to reload webbrowser page.
Closes #2643 .
Thanks to xet7 !
2019-11-18 22:23:49 +02:00
|
|
|
}
|
2019-10-29 19:05:44 +02:00
|
|
|
},
|
2019-08-07 18:11:34 +03:00
|
|
|
hiddenMinicardLabelText() {
|
2019-11-19 14:09:36 +02:00
|
|
|
currentUser = Meteor.user();
|
|
|
|
|
if (currentUser) {
|
|
|
|
|
return (currentUser.profile || {}).hiddenMinicardLabelText;
|
2020-10-28 15:45:37 +02:00
|
|
|
} else if (window.localStorage.getItem('hiddenMinicardLabelText')) {
|
2020-01-03 06:49:35 +02:00
|
|
|
return true;
|
New feature: Now there is popup selection of Lists/Swimlanes/Calendar/Roles.
New feature, not set visible yet, because switching to it does not
work properly yet: Collapsible Swimlanes #2804
Fix: Public board now loads correctly. When you select one of Lists/Swimlanes/Calendar view and
reload webbrowser page, it can change view. Closes #2311
Fix: List sorting commented out. Closes #2800
Fix: Errors hasHiddenMinicardText, hasShowDragHandles, showSort, hasSortBy, profile,
FirefoxAndroid/IE11/Vivaldi/Chromium browsers not working by using
cookies instead of database.
More details at https://github.com/wekan/wekan/issues/2643#issuecomment-554907955
Note: Cookie changes are not always immediate, if there is no effect,
you may need to reload webbrowser page.
Closes #2643 .
Thanks to xet7 !
2019-11-18 22:23:49 +02:00
|
|
|
} else {
|
2020-01-03 06:49:35 +02:00
|
|
|
return false;
|
New feature: Now there is popup selection of Lists/Swimlanes/Calendar/Roles.
New feature, not set visible yet, because switching to it does not
work properly yet: Collapsible Swimlanes #2804
Fix: Public board now loads correctly. When you select one of Lists/Swimlanes/Calendar view and
reload webbrowser page, it can change view. Closes #2311
Fix: List sorting commented out. Closes #2800
Fix: Errors hasHiddenMinicardText, hasShowDragHandles, showSort, hasSortBy, profile,
FirefoxAndroid/IE11/Vivaldi/Chromium browsers not working by using
cookies instead of database.
More details at https://github.com/wekan/wekan/issues/2643#issuecomment-554907955
Note: Cookie changes are not always immediate, if there is no effect,
you may need to reload webbrowser page.
Closes #2643 .
Thanks to xet7 !
2019-11-18 22:23:49 +02:00
|
|
|
}
|
2019-08-07 18:11:34 +03:00
|
|
|
},
|
|
|
|
|
});
|