migrating repo to Bodyrep org

This commit is contained in:
2013-01-19 11:23:43 -05:00
parent 31b7303f43
commit 4ea082330b
891 changed files with 142706 additions and 0 deletions

10
views/index.jade Normal file
View File

@@ -0,0 +1,10 @@
extends ./layout
block content
h1= #{title}
p Welcome to #{title}
p
a(href="/users") List Users
p
a(href="/workouts") List workouts

10
views/layout.jade Normal file
View File

@@ -0,0 +1,10 @@
!!! 5
html
head
title BodyREP - #{title}
link(rel='stylesheet', '/stylesheets/style.css')
include scripts
body
include session/user
block content

5
views/scripts.jade Normal file
View File

@@ -0,0 +1,5 @@
script(src='http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js')
script(src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js')
script(src='/javascripts/scripts.js')
//link(rel='stylesheet', href='/stylesheets/smoothness/jquery-ui-1.8.20.custom.css',type='text/css' )
link(rel='stylesheet', href='/stylesheets/redmond/jquery-ui-1.10.0.custom.css',type='text/css' )

17
views/session/new.jade Normal file
View File

@@ -0,0 +1,17 @@
extends ../layout
block content
h1 Log in
form(method="POST", action="/session")
p
label(for="username") User name:<br />
input#username(name="username")
p
label(for="password") Password:<br />
input#password(type="password", name="password")
p
input(type="submit", value="Log in");
p
a(href="/users/new") Register New User

12
views/session/user.jade Normal file
View File

@@ -0,0 +1,12 @@
- if (session.user)
p
span
b UserName&nbsp;
span= session.user.name
span
b &nbspUserID&nbsp;
span= session.user._id
p
form(method="POST", action="/session")
input(type="hidden", name="_method", value="DELETE")
input(type="submit", value="Log out")

30
views/users/index.jade Normal file
View File

@@ -0,0 +1,30 @@
extends ../layout
block content
h1 Users
p
a(href="/users/new") Create new profile
p
a(href="/workouts/new") Create new workout
p
a(href="/users") List Users
p
a(href="/workouts") List workouts
ul
- users.forEach(function(user) {
li
a(href="/users/" + encodeURIComponent(user.username))= user.name
- });
- if (page > 0) {
a(href="?page=" + (page - 1)) Previous
&nbsp;
- }
- if (! lastPage) {
a(href="?page=" + (page + 1)) Next
- }

19
views/users/new.jade Normal file
View File

@@ -0,0 +1,19 @@
extends ../layout
block content
h1 New User
form(method="POST", action="/users")
p
label(for="username") Username<br />
input#username(name="username")
p
label(for="name") Name<br />
input#name(name="name")
p
label(for="password") Password<br />
input#password(type="password", name="password")
p
label(for="is_admin") Admin<br />
input#isadmin(type="checkbox", name="is_admin", unchecked)
p
input(type="submit", value="Create")

22
views/users/profile.jade Normal file
View File

@@ -0,0 +1,22 @@
extends ../layout
block content
h1= user.name
- if (session.user.name === requested)
h1 Private View
p
a(href="/workouts/new") Create new workout
- else
h1 Public View
h2 Recent workouts:
ul
- recentworkouts.forEach(function(workout) {
li
a(href="/workouts/" + encodeURIComponent(workout._id))= workout._id
- });
- if (session.user.is_admin === true)
a(href="/users/") Goto Admin Page

23
views/workouts/index.jade Normal file
View File

@@ -0,0 +1,23 @@
extends ../layout
block content
h1 workouts
p
a(href="/workouts/new") Create new workout
p
a(href="/users") List Users
p
a(href="/workouts") List workouts
include list
- if (page > 0) {
a(href="?page=" + (page - 1)) Previous
&nbsp;
- }
- if (! lastPage) {
a(href="?page=" + (page + 1)) Next
- }

5
views/workouts/list.jade Normal file
View File

@@ -0,0 +1,5 @@
ul
- workouts.forEach(function(workout) {
li
a(href="/workouts/" + encodeURIComponent(workout._id))= workout._id
- });

19
views/workouts/new.jade Normal file
View File

@@ -0,0 +1,19 @@
extends ../layout
block content
h1 New workout
p THis will be a dropdown to select exercises
input#title(name="Exercise")
button#addExercise(type="button") Add Exercise
form#newworkout(method="POST", action="/workouts")
ul
li
label(for="title", value="UserID")<br />
input#title(name="userID", value=session.user._id)
li
label(for="datepicker", value="Date") Date<br />
input.datepicker(name="workoutDate")
ul#exercises
button(type="submit", value="Save") Save

View File

@@ -0,0 +1,13 @@
extends ../layout
block content
h1= workout.title
div!= workout.body
hr
p
span Workout ID:
&nbsp;
a(href="/users/" + encodeURIComponent(workout._id))= workout._id
div= workout