fixed search and filters

This commit is contained in:
2013-01-29 09:04:40 -05:00
parent 905b3258fb
commit 19e03c4fa0
21 changed files with 414 additions and 388 deletions

View File

@@ -1,27 +1,5 @@
//extends ../layout
//block content
h1 New workout
h3 Exercises (dynamically loaded from database)
ul#exerciselist
li Unpopulated
div#filters
h3 Filters
label Free Weights
input.filter(type="checkbox", checked=true, value="Free Weights")
label Bodyweight
input.filter(type="checkbox", checked=true, value="Bodyweight")
label Exercise Machines
input.filter(type="checkbox", checked=true, value='Exercise Machine')
label Kettlebells
input.filter(type="checkbox", checked=true, value='Kettlebells')
label Cardio
input.filter(type="checkbox", checked=true, value='Cardio')
//button#addExercise(type="button") Add Exercise
hr
form#newworkout(method="POST", action="/workouts")
ul
li

View File

@@ -1,7 +1,11 @@
h3 Recent workouts:
ul
- recentworkouts.forEach(function(workout) {
li
a.map-link(href="/workouts/" + encodeURIComponent(workout._id))= workout._id
- });
- recentworkouts.forEach(function(workout) {
li
a.map-link(href="/workouts/" + encodeURIComponent(workout._id))= workout._id
each element in workout.elements
li= element.exerciseID.name
ol
each split in element.splits
li Reps: #{split.reps} Weight: #{split.weight}
- });

View File

@@ -1,35 +1,9 @@
extends ../layout
h1= workout.title
block content
h1= workout.title
div!= workout.body
hr
p
span Workout ID:
 
a(href="/workouts/" + encodeURIComponent(workout._id))= workout._id
div= workout
ul
li Time: #{workouttime}
each element in workout.elements
li= element.exerciseID
ul
each split in element.splits
li Reps: #{split.reps} Weight: #{split.weight}
- if (session.user)
- if (session.user.is_admin === true)
form(action="/workouts/" + encodeURIComponent(workout._id), method="POST")
input(name="_method", type="hidden", value="DELETE")
input(type="submit", value="Delete")
p
a(href="/workouts") List workouts
- else
- if (session.user._id == workout.userID)
form(action="/workouts/" + encodeURIComponent(workout._id), method="POST")
input(name="_method", type="hidden", value="DELETE")
input(type="submit", value="Delete")
ul
li Time: #{workouttime}
each element in workout.elements
li= element.exerciseID
ul
each split in element.splits
li Reps: #{split.reps} Weight: #{split.weight}