mirror of
https://github.com/bodyrep/DemoApp.git
synced 2026-01-25 14:43:00 +00:00
fixed search and filters
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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}
|
||||
- });
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user