mirror of https://github.com/wekan/wekan
The Open Source kanban (built with Meteor). Keep variable/table/field names camelCase. For translations, only add Pull Request changes to wekan/i18n/en.i18n.json , other translations are done at https://transifex.com/wekan/wekan only.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.5 KiB
59 lines
1.5 KiB
import { ReactiveCache } from '/imports/reactiveCache';
|
|
import { Blaze } from 'meteor/blaze';
|
|
import { Session } from 'meteor/session';
|
|
import moment from 'moment/min/moment-with-locales';
|
|
|
|
Blaze.registerHelper('currentBoard', () => {
|
|
const ret = Utils.getCurrentBoard();
|
|
return ret;
|
|
});
|
|
|
|
Blaze.registerHelper('currentCard', () => {
|
|
const ret = Utils.getCurrentCard();
|
|
return ret;
|
|
});
|
|
|
|
Blaze.registerHelper('currentList', () => {
|
|
const ret = Utils.getCurrentList();
|
|
return ret;
|
|
});
|
|
|
|
Blaze.registerHelper('currentSetting', () => {
|
|
const ret = ReactiveCache.getCurrentSetting();
|
|
return ret;
|
|
});
|
|
|
|
Blaze.registerHelper('currentUser', () => {
|
|
const ret = ReactiveCache.getCurrentUser();
|
|
return ret;
|
|
});
|
|
|
|
Blaze.registerHelper('getUser', userId => ReactiveCache.getUser(userId));
|
|
|
|
Blaze.registerHelper('concat', (...args) => args.slice(0, -1).join(''));
|
|
|
|
Blaze.registerHelper('isMiniScreen', () => Utils.isMiniScreen());
|
|
|
|
Blaze.registerHelper('isTouchScreen', () => Utils.isTouchScreen());
|
|
|
|
Blaze.registerHelper('isShowDesktopDragHandles', () =>
|
|
Utils.isShowDesktopDragHandles(),
|
|
);
|
|
|
|
Blaze.registerHelper('isTouchScreenOrShowDesktopDragHandles', () =>
|
|
Utils.isTouchScreenOrShowDesktopDragHandles(),
|
|
);
|
|
|
|
Blaze.registerHelper('moment', (...args) => {
|
|
args.pop(); // hash
|
|
const [date, format] = args;
|
|
return moment(date).format(format ?? 'LLLL');
|
|
});
|
|
|
|
Blaze.registerHelper('canModifyCard', () =>
|
|
Utils.canModifyCard(),
|
|
);
|
|
|
|
Blaze.registerHelper('canModifyBoard', () =>
|
|
Utils.canModifyBoard(),
|
|
);
|
|
|