more additions.
This commit is contained in:
parent
dd7e4a4933
commit
e8649038ad
5 changed files with 82 additions and 33 deletions
19
client/General/Logbook/logbook.html
Normal file
19
client/General/Logbook/logbook.html
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<template name="logbook">
|
||||
<h1>Logbook</h1>
|
||||
<div class="grid">
|
||||
{{#each workouts}}
|
||||
<div>
|
||||
<article class="clickable" id="{{_id}}">
|
||||
<div class="grid">
|
||||
<div>
|
||||
<h2>{{routineName}}</h2>
|
||||
</div>
|
||||
<div>
|
||||
<h3>{{workoutCount}} {{#if $eq workoutCount 1}}exercise{{else}}exercises{{/if}}</h3>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
</template>
|
||||
27
client/General/Logbook/logbook.js
Normal file
27
client/General/Logbook/logbook.js
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
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({
|
||||
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue