refactored article to workout

This commit is contained in:
2013-01-18 13:53:18 -05:00
parent ea579b5ab0
commit dd0268e765
23 changed files with 137 additions and 132 deletions

View File

@@ -1,12 +0,0 @@
extends ../layout
block content
h1= article.title
div!= article.body
hr
p
span Author:
 
a(href="/users/" + encodeURIComponent(article.author.name))= article.author.name

View File

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

View File

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

View File

@@ -6,12 +6,12 @@ block content
p
a(href="/users/new") Create new profile
p
a(href="/articles/new") Create new article
a(href="/workouts/new") Create new workout
p
a(href="/users") List Users
p
a(href="/articles") List Articles
a(href="/workouts") List workouts
ul

View File

@@ -10,9 +10,12 @@ block content
- else
h1 Public View
h2 Recent Articles:
h2 Recent workouts:
ul
- recentArticles.forEach(function(article) {
- recentworkouts.forEach(function(workout) {
li
a(href="/articles/" + encodeURIComponent(article._id))= article.title
a(href="/workouts/" + encodeURIComponent(workout._id))= workout.title
- });
- if (session.user.is_admin === true)
a(href="/users/") Goto Admin Page

View File

@@ -1,14 +1,14 @@
extends ../layout
block content
h1 Articles
h1 workouts
p
a(href="/articles/new") Create new article
a(href="/workouts/new") Create new workout
p
a(href="/users") List Users
p
a(href="/articles") List Articles
a(href="/workouts") List workouts
include list

View File

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

View File

@@ -1,9 +1,9 @@
extends ../layout
block content
h1 New Article
h1 New workout
form(method="POST", action="/articles")
form(method="POST", action="/workouts")
p
label(for="title") UserID<br />
input#title(name="User_ID")

View File

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