2022-08-16 16:46:14 -05:00
|
|
|
import { Categories } from "../../imports/api/category";
|
|
|
|
|
import { Lists } from "../../imports/api/lists";
|
|
|
|
|
import { Products } from "../../imports/api/products";
|
|
|
|
|
import { Stores } from "../../imports/api/stores";
|
2022-08-05 16:55:56 -05:00
|
|
|
|
2022-08-04 19:50:18 -05:00
|
|
|
|
|
|
|
|
Template.dashboard.onCreated(function() {
|
2022-08-15 18:07:39 -05:00
|
|
|
this.subscribe("userList");
|
2022-08-16 16:46:14 -05:00
|
|
|
this.subscribe("myLists");
|
|
|
|
|
this.subscribe("myCategories");
|
|
|
|
|
this.subscribe("storeInfo");
|
|
|
|
|
this.subscribe("myProducts");
|
2022-08-04 19:50:18 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Template.dashboard.onRendered(function() {
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Template.dashboard.helpers({
|
2022-08-05 16:55:56 -05:00
|
|
|
userCount: function() {
|
|
|
|
|
return Meteor.users.find().count();
|
2022-08-16 16:46:14 -05:00
|
|
|
},
|
|
|
|
|
listCount: function() {
|
|
|
|
|
return Lists.find().count();
|
|
|
|
|
},
|
|
|
|
|
storeCount: function() {
|
|
|
|
|
return Stores.find().count();
|
|
|
|
|
},
|
|
|
|
|
productCount: function() {
|
|
|
|
|
return Products.find().count();
|
|
|
|
|
},
|
|
|
|
|
catCount: function() {
|
|
|
|
|
return Categories.find().count();
|
2022-08-05 16:55:56 -05:00
|
|
|
}
|
2022-08-04 19:50:18 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Template.dashboard.events({
|
2022-08-05 16:55:56 -05:00
|
|
|
"click #usermgmtlink" (event) {
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
FlowRouter.go('/userMgmt');
|
|
|
|
|
},
|
2022-08-04 19:50:18 -05:00
|
|
|
});
|