2025-12-06 15:44:43 -06:00
|
|
|
import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
|
2026-02-08 18:15:44 -06:00
|
|
|
import { Workouts } from '../../../imports/api/workouts';
|
|
|
|
|
import { WorkoutLog } from '../../../imports/api/workoutLog';
|
|
|
|
|
import { LogEntry } from '../../../imports/api/logEntry';
|
|
|
|
|
|
|
|
|
|
Template.home.onCreated(function() {
|
|
|
|
|
this.subscribe("myWorkoutRoutines");
|
|
|
|
|
this.subscribe("myWorkoutLog");
|
2026-02-10 16:38:44 -06:00
|
|
|
this.subscribe("allMyLogEntries");
|
2026-02-08 18:15:44 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Template.home.onRendered(function() {
|
|
|
|
|
|
|
|
|
|
});
|
2025-12-06 15:44:43 -06:00
|
|
|
|
2025-12-08 14:54:14 -06:00
|
|
|
Template.home.helpers({
|
2026-02-03 16:03:34 -06:00
|
|
|
loginOrReg: function () {
|
2025-12-08 14:54:14 -06:00
|
|
|
return Session.get("loginOrReg");
|
|
|
|
|
},
|
2026-02-08 18:15:44 -06:00
|
|
|
workoutCount: function() {
|
|
|
|
|
return Workouts.find({}).count();
|
|
|
|
|
},
|
2026-02-10 16:38:44 -06:00
|
|
|
logCount: function() {
|
|
|
|
|
return LogEntry.find({}).count();
|
|
|
|
|
},
|
2025-12-08 14:54:14 -06:00
|
|
|
});
|
|
|
|
|
|
2025-12-06 15:44:43 -06:00
|
|
|
Template.home.events({
|
2026-02-03 16:03:34 -06:00
|
|
|
'click .infoCard'(e) {
|
|
|
|
|
let route = e.currentTarget.id;
|
|
|
|
|
FlowRouter.go('/' + route);
|
|
|
|
|
},
|
2026-02-10 16:38:44 -06:00
|
|
|
'click #logWorkout' (e) {
|
|
|
|
|
FlowRouter.go('/logEntry');
|
|
|
|
|
},
|
|
|
|
|
'click #logMeasure' (e) {
|
|
|
|
|
FlowRouter.go('/measLogEntry');
|
|
|
|
|
},
|
2025-12-06 15:44:43 -06:00
|
|
|
});
|