mirror of
https://github.com/sstent/expressmongotest.git
synced 2026-01-26 17:12:33 +00:00
started defining workout schema
This commit is contained in:
30
test/data/schemas/workout.js
Normal file
30
test/data/schemas/workout.js
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
var Schema = require('mongoose').Schema;
|
||||||
|
|
||||||
|
|
||||||
|
var Split = new Schema({
|
||||||
|
reps: { type: String},
|
||||||
|
weight: { type: String},
|
||||||
|
dropset: { type: Boolean }
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
var Element = new Schema({
|
||||||
|
ExerciseID: { type: Schema.ObjectId, ref: 'exercise'},
|
||||||
|
splits: [Split]
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
var ArticleSchema = new Schema({
|
||||||
|
|
||||||
|
userID: { type: Schema.ObjectId, ref: 'User', required: true },
|
||||||
|
workoutDate: { type: Date, 'default': Date.now },
|
||||||
|
workoutTime: { type: Date, 'default': Date.now },
|
||||||
|
privacySetting: { type: Number},
|
||||||
|
Notes: { type: String},
|
||||||
|
templateID: { type: Schema.ObjectId, ref: 'Template'},
|
||||||
|
circuits: [Number],
|
||||||
|
elements: [Element]
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports = ArticleSchema;
|
||||||
@@ -5,11 +5,6 @@
|
|||||||
var notLoggedIn = require('./middleware/not_logged_in');
|
var notLoggedIn = require('./middleware/not_logged_in');
|
||||||
|
|
||||||
module.exports = function(app) {
|
module.exports = function(app) {
|
||||||
// app.use(function(req, res) {
|
|
||||||
// console.log("session " + req.session + " - " + JSON.stringify(req.session));
|
|
||||||
// res.locals.session = req.session;
|
|
||||||
// });
|
|
||||||
|
|
||||||
app.get('/session/new', notLoggedIn, function(req, res) {
|
app.get('/session/new', notLoggedIn, function(req, res) {
|
||||||
res.render('session/new', {title: "Log in"});
|
res.render('session/new', {title: "Log in"});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user