mirror of
https://github.com/wekan/wekan.git
synced 2026-03-13 17:06:13 +01:00
Migrate sidebar and settings components from BlazeComponent to Template
Convert sidebar, sidebarArchives, sidebarCustomFields, sidebarFilters, sidebarSearches, and all settings panel components to use native Meteor Template.onCreated/helpers/events pattern.
This commit is contained in:
parent
d3625db755
commit
bae23f9ed8
12 changed files with 2937 additions and 3046 deletions
|
|
@ -1,18 +1,18 @@
|
|||
import { TAPi18n } from '/imports/i18n';
|
||||
const filesize = require('filesize');
|
||||
|
||||
BlazeComponent.extendComponent({
|
||||
onCreated() {
|
||||
this.info = new ReactiveVar({});
|
||||
Meteor.call('getStatistics', (error, ret) => {
|
||||
if (!error && ret) {
|
||||
this.info.set(ret);
|
||||
}
|
||||
});
|
||||
},
|
||||
Template.statistics.onCreated(function () {
|
||||
this.info = new ReactiveVar({});
|
||||
Meteor.call('getStatistics', (error, ret) => {
|
||||
if (!error && ret) {
|
||||
this.info.set(ret);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Template.statistics.helpers({
|
||||
statistics() {
|
||||
return this.info.get();
|
||||
return Template.instance().info.get();
|
||||
},
|
||||
|
||||
humanReadableTime(time) {
|
||||
|
|
@ -47,4 +47,4 @@ BlazeComponent.extendComponent({
|
|||
}
|
||||
return ret;
|
||||
},
|
||||
}).register('statistics');
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue