Getting A better Log Entry Experience, and history setup

This commit is contained in:
Brian McGonagill 2026-02-18 15:58:45 -06:00
parent 98a86ca6a8
commit 5d3396c333
15 changed files with 428 additions and 140 deletions

View file

@ -0,0 +1,34 @@
import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
import { Workouts } from '../../../../imports/api/workouts';
import { WorkoutLog } from '../../../../imports/api/workoutLog';
import { LogEntry } from '../../../../imports/api/logEntry';
import { Chart } from 'chart.js';
import { dayjs } from 'dayjs';
Template.workoutData.onCreated(function() {
this.subscribe("myWorkoutRoutines");
this.subscribe("myWorkoutLog");
this.subscribe("myLogEntries");
});
Template.workoutData.onRendered(function() {
});
Template.workoutData.helpers({
workoutLog: function() {
return WorkoutLog.find({});
},
lastWorkout: async() => {
const mostRecentDate = await LogEntry.findOneAsync({}, { sort: { dateAdded: -1 } });
if (mostRecentDate) {
return LogEntry.find({ dateAdded: mostRecentDate.dateAdded });
} else {
return [];
}
},
});
Template.workoutData.events({
});