//jquery Template.info.onRendered(function(){ $('select').material_select(); }); // var type; // Template.home.helpers({ worker: function(){ return workerList.find({}, {sort: {createdAt: -1}}).fetch(); }, manager: function(){ return Meteor.users.find({}, {sort: {createdAt: -1}}).fetch(); }, yourTasks: function(currentManager){//specific tasks belonging to that manager return taskList.find({ assign: currentManager }, {sort: {createdAt: -1}}).fetch(); }, plusOne(idx) {//makes the ranking start at 1 instead of 0 return idx + 1; }, statusColor(status) { if(status == "Open"){ return "red"; }else if(status == "Scheduled"){ return "blue"; }else if(status == "Completed"){ return "green"; }else{//cancelled return "grey"; } }, icon(jobtype) { if(jobtype!=null) type = jobtype; if(type == "Temporary Cleaning"){ return {color: "red", image: "build"}; }else if(type == "Suite Turnover Cleaning"){ return {color: "blue", image: "delete_sweep"}; }else if(type == "General Labour"){ return {color: "green", image: "format_paint"}; }else if(type == "Temporary Labour"){ return {color: "grey", image: "format_paint"}; }else if(type == "Junk Removal"){ return {color: "yellow", image: "format_paint"}; }else if(type == "Apartment Trashing"){ return {color: "green", image: "format_paint"}; }else if(type == "Carpet Cleaning"){ return {color: "green", image: "format_paint"}; }else{ } } }); Template.home.events({ 'click #new': function(){ Router.go('/'); } });