27 lines
652 B
JavaScript
27 lines
652 B
JavaScript
|
|
import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
|
||
|
|
import { Workouts } from '../../../imports/api/workouts.js';
|
||
|
|
import { WorkoutLog } from '../../../imports/api/workoutLog.js';
|
||
|
|
|
||
|
|
Template.logbook.onCreated(function() {
|
||
|
|
this.subscribe("myWorkoutRoutines");
|
||
|
|
this.subscribe("myWorkoutLog");
|
||
|
|
});
|
||
|
|
|
||
|
|
Template.logbook.onRendered(function() {
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
Template.logbook.helpers({
|
||
|
|
workouts: function() {
|
||
|
|
return Workouts.find({});
|
||
|
|
},
|
||
|
|
workoutCount: function() {
|
||
|
|
let routineId= this._id;
|
||
|
|
let count = WorkoutLog.find({ routineId: routineId }).count();
|
||
|
|
return count;
|
||
|
|
},
|
||
|
|
});
|
||
|
|
|
||
|
|
Template.logbook.events({
|
||
|
|
|
||
|
|
});
|