mirror of
https://github.com/bodyrep/DemoApp.git
synced 2026-02-01 01:51:36 +00:00
can read and display workouts
This commit is contained in:
@@ -9,5 +9,25 @@ block content
|
||||
p
|
||||
span Workout ID:
|
||||
|
||||
a(href="/users/" + encodeURIComponent(workout._id))= 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")
|
||||
|
||||
Reference in New Issue
Block a user